-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
186 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# 项目排除路径 | ||
/.gradle/ | ||
/.idea/ | ||
/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,84 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = "forge https" | ||
url = "https://files.minecraftforge.net/maven" | ||
url = "https://jcenter.bintray.com/" | ||
} | ||
maven { | ||
name = "forge" | ||
url = "https://maven.minecraftforge.net/" | ||
} | ||
maven { | ||
name = "sonatype" | ||
url = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
} | ||
} | ||
dependencies { | ||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' | ||
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.1.+') { | ||
changing = true | ||
} | ||
} | ||
} | ||
|
||
apply plugin: 'forge' | ||
apply plugin: 'java' | ||
apply plugin: 'idea' | ||
apply plugin: 'maven-publish' | ||
|
||
version = "1.3" | ||
|
||
version = "1.4" | ||
group= "club.someoneice.togocup.pineapple_tag" | ||
archivesBaseName = "PineappleTag" | ||
|
||
minecraft { | ||
version = "1.7.10-10.13.4.1614-1.7.10" | ||
runDir = "eclipse" | ||
} | ||
|
||
sourceCompatibility = targetCompatibility = "1.8" | ||
|
||
repositories { | ||
maven { url "http://maven.snowlyicewolf.club/" } | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'lib', includes: ['*.jar']) | ||
implementation "club.someoneice.togocup.recipebook:PineappleRecipeBook:1.0" | ||
} | ||
|
||
processResources{ | ||
duplicatesStrategy = 'include' | ||
inputs.property "version", project.version | ||
inputs.property "mcversion", project.minecraft.version | ||
|
||
from(sourceSets.main.resources.srcDirs) { | ||
include 'mcmod.info' | ||
|
||
expand 'version':project.version, 'mcversion':project.minecraft.version | ||
expand 'version':project.version, 'mcversion':project.minecraft.version, 'name':project.archivesBaseName | ||
} | ||
|
||
from(sourceSets.main.resources.srcDirs) { | ||
exclude 'mcmod.info' | ||
} | ||
} | ||
|
||
apply from: 'maven.gradle' | ||
minecraft { | ||
version = "1.7.10-10.13.4.1614-1.7.10" | ||
runDir = "eclipse" | ||
} | ||
|
||
sourceCompatibility = targetCompatibility = "1.8" | ||
|
||
tasks.withType(Jar) { | ||
compileJava.options.encoding = 'UTF-8' | ||
compileJava.options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "PineappleTags" | ||
url = uri("https://maven.pkg.github.com/amarokice/pineappletags") | ||
credentials { | ||
username = "AmarokIce" | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
} | ||
|
||
publications { | ||
gpr(MavenPublication) { | ||
from(components.java) | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/club/someoneice/togocup/tags/ItemStackTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package club.someoneice.togocup.tags; | ||
|
||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class ItemStackTag extends Tag<ItemStack> { | ||
ItemStackTag(String name) { | ||
super(name); | ||
} | ||
|
||
@Override | ||
public boolean has(Object item) { | ||
if (item instanceof ItemStack) return hasItemStack((ItemStack) item); | ||
else if (item instanceof Item) return hasItemStack(new ItemStack((Item) item)); | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean hasAssignableFrom(Object item) { | ||
if (item instanceof ItemStack) return hasItemAssignableFrom(((ItemStack) item).getItem()); | ||
else if (item instanceof Item) return hasItemAssignableFrom((Item) item); | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean hasAssignableBy(Object item) { | ||
return super.hasAssignableBy(item); | ||
} | ||
|
||
public boolean hasItemStack(ItemStack item) { | ||
if (item == null) return false; | ||
for (ItemStack it : this.items) | ||
if (item.getItem() == it.getItem() && item.getItemDamage() == it.getItemDamage()) | ||
return true; | ||
return false; | ||
} | ||
|
||
|
||
public boolean hasItemAssignableFrom(Item item) { | ||
for (ItemStack obj : items) | ||
if (obj.getItem().getClass().isAssignableFrom(item.getClass())) return true; | ||
return false; | ||
} | ||
|
||
public boolean hasItemAssignableBy(Item item) { | ||
for (ItemStack obj : items) | ||
if (item.getClass().isAssignableFrom(obj.getItem().getClass())) return true; | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=== Pineapple license === | ||
I will provide all or part of the code, as long as you use it within the limits of the law, you can use these codes as you like. | ||
You can get full access to this source code without paying any royalties, which will be permanent and irrevocable if you are granted this license. | ||
You can get full right to use this source code without paying any royalties, which will be perpetual and will not be revoked if you are granted this license, unless you have violated this agreement or have been prevented by me from granting it to you in any way. | ||
If you have made a copy of the Program with these code, you should include this license to keep the original code open source. | ||
|
||
Of course this license doesn't used in court, just like you know that none of us want legal battles for these meaningless things, so I hope you will respect this brief license. | ||
I do not want my code to be used for commercial purposes, including but not limited to paid downloads and download with AD(e.g. AdF.ly). | ||
If you used my code to do some instructional videos, or if you used my code to the fullest, put it in the pineapple juicer and sold the juicer to make money, it's your credit, you can certainly do it. | ||
If you think my mod is good to learn something, if you like, invite me to a cup of pineapple juice. | ||
|
||
If you do not follow this simple agreement and legal liability arises, this has nothing to do with me, please take responsibility for yourself. | ||
If you're selling my source code or compiled code, I'll be very angry and accuse you smelling ugly. | ||
|
||
I reserve the right to make changes to the license without affecting your exercise of this license. | ||
If you are unable to accept a license other than those approved by the Open Source Initiative, you may use these codes using the AFL-3.0 license, instead of complying with this license. | ||
If you choose to accept AFL-3.0, you may need to show in your README or somewhere else that is very convenient to see, you are using the AFL-3.0 license. | ||
|
||
|
||
|
||
=== 凤梨许可证 === | ||
我会提供全部或者部分的代码,只要您在法律限制之内使用,您可以随意的使用这些代码。 | ||
您可以获取这份源代码全部的使用权并且不需要支付任何版权税,如果您被授权了这份许可证,这将会永久生效且不会撤回,除非您已经违反了这份协议或由我以任何形式阻止了这份协议授权于您。 | ||
如果您使用这些代码制作了副本,您应当将本许可证包涵其中保持原有代码依然开源。 | ||
|
||
当然,这个许可证在法庭中站不住脚,您知道的,我们都不希望为了这些没有意义的事情而产生法律纠纷,所以我希望您能尊重这份非常简短的许可证。 | ||
我不希望我的代码被用于商业用途,包括但不限于付费下载与广告下载(例如AdF.ly)。 | ||
如果您使用我的代码做了一些教学影片,或者您充分的使用了我的代码,把它写入了凤梨榨汁机里然后贩卖榨汁机赚取了钱,这是您的功劳,您当然可以这样做。 | ||
如果您觉得您可以在我的代码中收获点什么,若您愿意,那就请我喝一杯凤梨汁吧。 | ||
|
||
如果您没有按照这份简单的协议执行,出现了法律责任,这与我无关,请您自己承担责任。 | ||
如果您正在贩卖我的源代码或者编译后代码,我会非常愤怒的指责你闻起来很臭。 | ||
|
||
我将保留在不影响您执行这份许可证的情况下对许可证进行改动。 | ||
如果您无法接受一份在开源社区协会认可之外的许可证,您可以参照AFL-3.0许可证来使用这些代码,而不是遵照这份许可证。 | ||
若您选择接受AFL-3.0,您可能需要在您的README中或者别的能够非常方便的看到的地方著名,您正在使用AFL-3.0许可证的情况下使用这些代码。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
"minecraft:apple" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
[ | ||
{ | ||
"modid": "pineapple_tag", | ||
"name": "PineappleTag", | ||
"description": "PineappleTag", | ||
"version": "1.0", | ||
"mcversion": "${mcversion}", | ||
"url": "", | ||
"updateUrl": "", | ||
"authorList": ["Someoneice"], | ||
"credits": "", | ||
"logoFile": "", | ||
"screenshots": [], | ||
"dependencies": [] | ||
} | ||
{ | ||
"modid": "pineapple_tag", | ||
"name": "PineappleTag", | ||
"description": "PineappleTag", | ||
"version": "1.4", | ||
"mcversion": "${mcversion}", | ||
"url": "", | ||
"updateUrl": "", | ||
"authorList": ["Someoneice"], | ||
"credits": "", | ||
"logoFile": "", | ||
"screenshots": [], | ||
"dependencies": [] | ||
} | ||
] |