diff --git a/.gitignore b/.gitignore index 5fabe22c3..ae3937ec4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/rebuild.bat /doAllTheThings.bat /.gradle /build diff --git a/LICENSE.md b/LICENSE.md index 399f876a1..8714aaf52 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -4,27 +4,27 @@ The things listed below are special cases and exceptions from the above. They ha Everything that is not listed below applies to the above. ### YOU MAY -* Fork and modify the Code -* Submit Pull Requests -* Copy (SMALL!) Parts of the Code for other Projects -* Make a Review/Spotlight of the Mod or use it in a Modpack -* Make Let's Play (and similar) Videos containing the Mod +* Fork and modify the code. +* Submit pull requests. +* Copy small parts of code for other projects. +* Make a review/spotlight of the mod or use it in a modpack. +* Make Let's Play (and similar) videos containing the mod. ### YOU CAN NOT -* Copy the entire Code or claim it is yours. -* Reupload the Code or Mod to another website or claim you made it. -* Copy entire Classes, Methods or other big Parts of Code. +* Copy entire classes, methods or features or claim you made them. +* Redistribute the mod. This does not apply, however, when it comes to pre-packaged modpacks. ### YOU HAVE TO -* Always credit me. Don't be a jerk and copy entire portions of the code and claim they're yours. -* When it comes to the code, always link back to this Repository. -* When it comes to the Mod, always link back to the the Forum Thread linked above. +* When modifying or using code, always explicitly credit Ellpeck as the creator. +* When making a review/spotlight containing the mod or using it in a modpack, always make clear that Actually Additions is used. +* When it comes to the code, always link back to the official repository. +* When it comes to the mod, always link back to the the official Minecraft Forum thread or CurseForge page. ### NOTES * The Actually Additions API can be excerpted for use in other projects, however it should not be modified. It can be redistributed with other mods (if it is getting used), however it should still be visible that it is a part of Actually Additions. Do not remove the copyright header from any of the API's files. -* The above License only applies for Code I wrote myself, any APIs used (such as the CoFH API) have their own License that is being respected. -* There are some excerpts from other code used (such as the OpenBlocks XP System). Credit to the creators of these parts is always given and their Permission is granted or their License is respected. -* Almost all of the Assets used in this Mod are made by Glenthor and are owned by me. You are not allowed to copy them for any other Project. -* Parts of this License, especially restrictive ones, can be ignored with Personal Permission. Said Permission, however, will only be given to people I know or someone who has a very good reason for needing it. If you don't, don't ask. +* The above License only applies for code I wrote myself, any APIs used (such as the CoFH API) have their own License that is being respected. +* There are some excerpts from other code used (such as the OpenBlocks XP system). Credit to the creators of these parts is always given and their permission is granted or their license is respected. +* Almost all of the assets used in this mod are made by Glenthor and are owned by me. You are not allowed to copy them for any other project. +* Parts of this license, especially restrictive ones, can be ignored with personal permission. Said permission, however, will only be given to people I know or someone who has a very good reason for needing it. © 2015-2016 Ellpeck \ No newline at end of file diff --git a/README.md b/README.md index e0c360ad9..f63b8d05a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -![](https://raw.githubusercontent.com/Ellpeck/ActuallyAdditions/master/pics/logoBig.png) +![](https://raw.githubusercontent.com/Ellpeck/ActuallyAdditions/master/pics/logo.png) ##It's a Minecraft Mod! -For more information, visit the main Minecraft Forum Thread at http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2551118 \ No newline at end of file +For more information, visit the main Minecraft Forum Thread by [clicking here](http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2551118)! \ No newline at end of file diff --git a/build.gradle b/build.gradle index 922d1dfb2..3d26e29f4 100644 --- a/build.gradle +++ b/build.gradle @@ -7,22 +7,24 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } -apply plugin: 'net.minecraftforge.gradle.forge' -version = "1.8.9-r25" +apply plugin: 'net.minecraftforge.gradle.forge' +apply plugin: 'idea' + +version = "1.10.2-r47" group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" minecraft { - version = "1.8.9-11.15.1.1732" + version = "1.10.2-12.18.0.2002-1.10.0" runDir = "idea" - mappings = "stable_20" + mappings = "snapshot_20160519" makeObfSourceJar = false - useDepAts = true + //useDepAts = true replaceIn "ModUtil.java" replace "@VERSION@", project.version.toString() @@ -35,6 +37,9 @@ repositories { maven { url "http://dvs1.progwml6.com/files/maven" } + maven { + url "http://maven.epoxide.xyz" + } } dependencies { @@ -42,7 +47,8 @@ dependencies { //compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev" //compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev" - deobfCompile "mezz.jei:jei_1.8.9:2.25.6.140" + compile "net.darkhax.tesla:Tesla:1.9.4-1.1.0.24" + deobfCompile "mezz.jei:jei_1.10:3.7.1.219" } processResources { @@ -60,10 +66,13 @@ processResources { } } -jar {} +jar { + +} task deobfJar(type: Jar) { from sourceSets.main.output + from sourceSets.main.java classifier = 'dev' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9397848f1..6917d27a0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip diff --git a/pics/forum1.png b/pics/forum1.png deleted file mode 100644 index 58192e5b7..000000000 Binary files a/pics/forum1.png and /dev/null differ diff --git a/pics/forum2.png b/pics/forum2.png deleted file mode 100644 index 83e404485..000000000 Binary files a/pics/forum2.png and /dev/null differ diff --git a/pics/items.png b/pics/items.png deleted file mode 100644 index df042775b..000000000 Binary files a/pics/items.png and /dev/null differ diff --git a/pics/logo.png b/pics/logo.png new file mode 100644 index 000000000..1de278c31 Binary files /dev/null and b/pics/logo.png differ diff --git a/pics/logoBig.png b/pics/logoBig.png deleted file mode 100644 index b0e6da87b..000000000 Binary files a/pics/logoBig.png and /dev/null differ diff --git a/pics/logoSquare.png b/pics/logoSquare.png index 6b5cce0a0..d717e634c 100644 Binary files a/pics/logoSquare.png and b/pics/logoSquare.png differ diff --git a/specialPeopleStuff.properties b/specialPeopleStuff.properties index 8d03c5a99..54ebcf149 100644 --- a/specialPeopleStuff.properties +++ b/specialPeopleStuff.properties @@ -1,12 +1,15 @@ #Because he's me -ellpeck=ActuallyAdditions:itemBooklet@0 +ellpeck=actuallyadditions:itemBooklet@0 #Because he submitted tons of ideas for the mod dqmhose=minecraft:torch@0 #Because he does all of the textures -twoofeight=ActuallyAdditions:blockHeatCollector@0 +twoofeight=actuallyadditions:blockHeatCollector@0 #Because she is awesome and squids are cool -larixine=ActuallyAdditions:blockBlackLotus@0 +larixine=actuallyadditions:blockBlackLotus@0 #Because he helps me with models and stuff -canitzp=ActuallyAdditions:blockCoffeeMachine@0 +canitzp=actuallyadditions:blockCoffeeMachine@0 #Because he's an awesome guy and helps with lots of stuff -xdjackiexd=ActuallyAdditions:itemDrill@14 +xdjackiexd=actuallyadditions:itemDrill@14 + +#Patreon stuff +ftog_thorgal=actuallyadditions:itemCrystal@0 \ No newline at end of file diff --git a/src/main/java/cofh/api/CoFHAPIProps.java b/src/main/java/cofh/api/CoFHAPIProps.java index 9b528304a..eb2e05ade 100644 --- a/src/main/java/cofh/api/CoFHAPIProps.java +++ b/src/main/java/cofh/api/CoFHAPIProps.java @@ -6,6 +6,6 @@ public class CoFHAPIProps { } - public static final String VERSION = "1.7.10R1.0.2"; + public static final String VERSION = "1.8.9R1.2.0B1"; } diff --git a/src/main/java/cofh/api/energy/EnergyStorage.java b/src/main/java/cofh/api/energy/EnergyStorage.java index 25e0126ab..dd7dd3e02 100644 --- a/src/main/java/cofh/api/energy/EnergyStorage.java +++ b/src/main/java/cofh/api/energy/EnergyStorage.java @@ -51,29 +51,33 @@ public class EnergyStorage implements IEnergyStorage { return nbt; } - public void setCapacity(int capacity) { + public EnergyStorage setCapacity(int capacity) { this.capacity = capacity; if (energy > capacity) { energy = capacity; } + return this; } - public void setMaxTransfer(int maxTransfer) { + public EnergyStorage setMaxTransfer(int maxTransfer) { setMaxReceive(maxTransfer); setMaxExtract(maxTransfer); + return this; } - public void setMaxReceive(int maxReceive) { + public EnergyStorage setMaxReceive(int maxReceive) { this.maxReceive = maxReceive; + return this; } - public void setMaxExtract(int maxExtract) { + public EnergyStorage setMaxExtract(int maxExtract) { this.maxExtract = maxExtract; + return this; } public int getMaxReceive() { @@ -87,7 +91,7 @@ public class EnergyStorage implements IEnergyStorage { } /** - * This function is included to allow for server -> client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers + * This function is included to allow for server to client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers * are guaranteed to have it. * * @param energy diff --git a/src/main/java/cofh/api/energy/IEnergyConnection.java b/src/main/java/cofh/api/energy/IEnergyConnection.java index 268721a92..29ef0a1ce 100644 --- a/src/main/java/cofh/api/energy/IEnergyConnection.java +++ b/src/main/java/cofh/api/energy/IEnergyConnection.java @@ -2,6 +2,7 @@ package cofh.api.energy; import net.minecraft.util.EnumFacing; + /** * Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not * accept it; otherwise just use IEnergyHandler. diff --git a/src/main/java/cofh/api/energy/IEnergyHandler.java b/src/main/java/cofh/api/energy/IEnergyHandler.java index 1f8967bea..16b236e7a 100644 --- a/src/main/java/cofh/api/energy/IEnergyHandler.java +++ b/src/main/java/cofh/api/energy/IEnergyHandler.java @@ -6,53 +6,22 @@ import net.minecraft.util.EnumFacing; * Implement this interface on Tile Entities which should handle energy, generally storing it in one or more internal {@link IEnergyStorage} objects. *

* A reference implementation is provided {@link TileEnergyHandler}. + *

+ * Note that {@link IEnergyReceiver} and {@link IEnergyProvider} are extensions of this. * * @author King Lemming * */ -public interface IEnergyHandler extends IEnergyProvider, IEnergyReceiver { - - // merely a convenience interface (remove these methods in 1.8; provided here for back-compat via compiler doing things) - - /** - * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. - * - * @param from - * Orientation the energy is received from. - * @param maxReceive - * Maximum amount of energy to receive. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received. - */ - @Override - int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate); - - /** - * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. - * - * @param from - * Orientation the energy is extracted from. - * @param maxExtract - * Maximum amount of energy to extract. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted. - */ - @Override - int extractEnergy(EnumFacing from, int maxExtract, boolean simulate); - +public interface IEnergyHandler extends IEnergyConnection { /** * Returns the amount of energy currently stored. */ - @Override int getEnergyStored(EnumFacing from); /** * Returns the maximum amount of energy that can be stored. */ - @Override int getMaxEnergyStored(EnumFacing from); } diff --git a/src/main/java/cofh/api/energy/IEnergyProvider.java b/src/main/java/cofh/api/energy/IEnergyProvider.java index 584c1ebcf..ef0e09d06 100644 --- a/src/main/java/cofh/api/energy/IEnergyProvider.java +++ b/src/main/java/cofh/api/energy/IEnergyProvider.java @@ -2,6 +2,7 @@ package cofh.api.energy; import net.minecraft.util.EnumFacing; + /** * Implement this interface on Tile Entities which should provide energy, generally storing it in one or more internal {@link IEnergyStorage} objects. *

@@ -10,7 +11,7 @@ import net.minecraft.util.EnumFacing; * @author King Lemming * */ -public interface IEnergyProvider extends IEnergyConnection { +public interface IEnergyProvider extends IEnergyHandler { /** * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. @@ -25,14 +26,4 @@ public interface IEnergyProvider extends IEnergyConnection { */ int extractEnergy(EnumFacing from, int maxExtract, boolean simulate); - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(EnumFacing from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(EnumFacing from); - } diff --git a/src/main/java/cofh/api/energy/IEnergyReceiver.java b/src/main/java/cofh/api/energy/IEnergyReceiver.java index 775cc11b6..989e9baa5 100644 --- a/src/main/java/cofh/api/energy/IEnergyReceiver.java +++ b/src/main/java/cofh/api/energy/IEnergyReceiver.java @@ -2,6 +2,7 @@ package cofh.api.energy; import net.minecraft.util.EnumFacing; + /** * Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects. *

@@ -10,7 +11,7 @@ import net.minecraft.util.EnumFacing; * @author King Lemming * */ -public interface IEnergyReceiver extends IEnergyConnection { +public interface IEnergyReceiver extends IEnergyHandler { /** * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. @@ -25,14 +26,4 @@ public interface IEnergyReceiver extends IEnergyConnection { */ int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate); - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(EnumFacing from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(EnumFacing from); - } diff --git a/src/main/java/cofh/api/energy/ItemEnergyContainer.java b/src/main/java/cofh/api/energy/ItemEnergyContainer.java index 5fee42639..0fb36dab6 100644 --- a/src/main/java/cofh/api/energy/ItemEnergyContainer.java +++ b/src/main/java/cofh/api/energy/ItemEnergyContainer.java @@ -43,27 +43,30 @@ public class ItemEnergyContainer extends Item implements IEnergyContainerItem { return this; } - public void setMaxTransfer(int maxTransfer) { + public ItemEnergyContainer setMaxTransfer(int maxTransfer) { setMaxReceive(maxTransfer); setMaxExtract(maxTransfer); + return this; } - public void setMaxReceive(int maxReceive) { + public ItemEnergyContainer setMaxReceive(int maxReceive) { this.maxReceive = maxReceive; + return this; } - public void setMaxExtract(int maxExtract) { + public ItemEnergyContainer setMaxExtract(int maxExtract) { this.maxExtract = maxExtract; + return this; } /* IEnergyContainerItem */ @Override public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { - if (container.getTagCompound() == null) { + if (!container.hasTagCompound()) { container.setTagCompound(new NBTTagCompound()); } int energy = container.getTagCompound().getInteger("Energy"); diff --git a/src/main/java/cofh/api/energy/TileEnergyHandler.java b/src/main/java/cofh/api/energy/TileEnergyHandler.java deleted file mode 100644 index 175ee6676..000000000 --- a/src/main/java/cofh/api/energy/TileEnergyHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; - -/** - * Reference implementation of {@link IEnergyHandler}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class TileEnergyHandler extends TileEntity implements IEnergyHandler { - - protected EnergyStorage storage = new EnergyStorage(32000); - - @Override - public void readFromNBT(NBTTagCompound nbt) { - - super.readFromNBT(nbt); - storage.readFromNBT(nbt); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - - super.writeToNBT(nbt); - storage.writeToNBT(nbt); - } - - /* IEnergyConnection */ - @Override - public boolean canConnectEnergy(EnumFacing from) { - - return true; - } - - /* IEnergyReceiver */ - @Override - public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate) { - - return storage.receiveEnergy(maxReceive, simulate); - } - - /* IEnergyProvider */ - @Override - public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate) { - - return storage.extractEnergy(maxExtract, simulate); - } - - /* IEnergyReceiver and IEnergyProvider */ - @Override - public int getEnergyStored(EnumFacing from) { - - return storage.getEnergyStored(); - } - - @Override - public int getMaxEnergyStored(EnumFacing from) { - - return storage.getMaxEnergyStored(); - } - -} diff --git a/src/main/java/cofh/api/energy/package-info.java b/src/main/java/cofh/api/energy/package-info.java index 880844fca..da8566735 100644 --- a/src/main/java/cofh/api/energy/package-info.java +++ b/src/main/java/cofh/api/energy/package-info.java @@ -1,10 +1,10 @@ /** - * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub + * (C) 2014-2016 Team CoFH / CoFH / Cult of the Full Hub * http://www.teamcofh.com */ @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|energy") package cofh.api.energy; -import cofh.api.CoFHAPIProps; import net.minecraftforge.fml.common.API; +import cofh.api.CoFHAPIProps; diff --git a/src/main/java/cofh/api/package-info.java b/src/main/java/cofh/api/package-info.java index 25e1ecc5d..e2847daad 100644 --- a/src/main/java/cofh/api/package-info.java +++ b/src/main/java/cofh/api/package-info.java @@ -1,8 +1,9 @@ /** - * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub + * (C) 2014-2016 Team CoFH / CoFH / Cult of the Full Hub * http://www.teamcofh.com */ @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHLib", provides = "CoFHAPI") package cofh.api; -import net.minecraftforge.fml.common.API; \ No newline at end of file +import net.minecraftforge.fml.common.API; + diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java index 840c6e8cc..f061d87ec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java @@ -1,44 +1,53 @@ /* - * This file ("ActuallyAdditionsAPI.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ActuallyAdditionsAPI.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; -import de.ellpeck.actuallyadditions.api.recipe.BallOfFurReturn; -import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; -import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; -import de.ellpeck.actuallyadditions.api.recipe.TreasureChestLoot; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; +import de.ellpeck.actuallyadditions.api.internal.IMethodHandler; +import de.ellpeck.actuallyadditions.api.lens.Lens; +import de.ellpeck.actuallyadditions.api.lens.LensConversion; +import de.ellpeck.actuallyadditions.api.recipe.*; +import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; -public class ActuallyAdditionsAPI{ +public final class ActuallyAdditionsAPI{ - public static final String MOD_ID = "ActuallyAdditions"; - public static final String API_ID = MOD_ID+"API"; - public static final String API_VERSION = "8"; - - public static List crusherRecipes = new ArrayList(); - public static List ballOfFurReturnItems = new ArrayList(); - public static List treasureChestLoot = new ArrayList(); - public static List reconstructorLensNoneRecipes = new ArrayList(); - public static List coffeeMachineIngredients = new ArrayList(); - - public static List bookletEntries = new ArrayList(); - public static List bookletPagesWithItemStackData = new ArrayList(); - - //These are getting initlized in Actually Additions' PreInit phase + public static final String MOD_ID = "actuallyadditions"; + public static final String API_ID = MOD_ID+"api"; + public static final String API_VERSION = "17"; + public static final List CRUSHER_RECIPES = new ArrayList(); + public static final List BALL_OF_FUR_RETURN_ITEMS = new ArrayList(); + public static final List TREASURE_CHEST_LOOT = new ArrayList(); + public static final List RECONSTRUCTOR_LENS_CONVERSION_RECIPES = new ArrayList(); + public static final Map RECONSTRUCTOR_LENS_COLOR_CHANGERS = new HashMap(); + public static final List COFFEE_MACHINE_INGREDIENTS = new ArrayList(); + public static final List COMPOST_RECIPES = new ArrayList(); + public static final List BOOKLET_ENTRIES = new ArrayList(); + public static final List BOOKLET_PAGES_WITH_ITEM_DATA = new ArrayList(); + /** + * Use this to handle things that aren't based in the API itself + * DO NOT CHANGE/OVERRIDE THIS!! + * This is getting initialized in Actually Additions' PreInit phase + */ + public static IMethodHandler methodHandler; + //These are getting initialized in Actually Additions' PreInit phase + //DO NOT CHANGE/OVERRIDE THESE!! public static IBookletEntry entryGettingStarted; public static IBookletEntry entryFunctionalNonRF; public static IBookletEntry entryFunctionalRF; @@ -48,6 +57,14 @@ public class ActuallyAdditionsAPI{ public static IBookletEntry entryMisc; public static IBookletEntry allAndSearch; + //These are getting initialized in Actually Additions' PreInit phase + //DO NOT CHANGE/OVERRIDE THESE!! + public static LensConversion lensDefaultConversion; + public static Lens lensDetonation; + public static Lens lensDeath; + public static Lens lensColor; + public static Lens lensDisruption; + /** * Adds a Recipe to the Crusher Recipe Registry * The second output will be nothing @@ -71,8 +88,8 @@ public class ActuallyAdditionsAPI{ * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) */ public static void addCrusherRecipe(String input, String outputOne, int outputOneAmount, String outputTwo, int outputTwoAmount, int outputTwoChance){ - if(!OreDictionary.getOres(input).isEmpty() && !OreDictionary.getOres(outputOne).isEmpty() && (outputTwo == null || outputTwo.isEmpty() || !OreDictionary.getOres(outputTwo).isEmpty())){ - crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount, outputTwo, outputTwoAmount, outputTwoChance)); + if(!OreDictionary.getOres(input, false).isEmpty() && !OreDictionary.getOres(outputOne, false).isEmpty() && (outputTwo == null || outputTwo.isEmpty() || !OreDictionary.getOres(outputTwo, false).isEmpty())){ + CRUSHER_RECIPES.add(new CrusherRecipe(input, outputOne, outputOneAmount, outputTwo, outputTwoAmount, outputTwoChance)); } } @@ -97,7 +114,7 @@ public class ActuallyAdditionsAPI{ * @param outputTwoChance The chance of the second output (0 won't occur at all, 100 will all the time) */ public static void addCrusherRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance){ - crusherRecipes.add(new CrusherRecipe(input, outputOne, outputTwo, outputTwoChance)); + CRUSHER_RECIPES.add(new CrusherRecipe(input, outputOne, outputTwo, outputTwoChance)); } /** @@ -109,11 +126,24 @@ public class ActuallyAdditionsAPI{ * @param outputOneAmount The amount of the first output */ public static void addCrusherRecipe(ItemStack input, String outputOne, int outputOneAmount){ - if(!OreDictionary.getOres(outputOne).isEmpty()){ - crusherRecipes.add(new CrusherRecipe(input, outputOne, outputOneAmount)); + if(!OreDictionary.getOres(outputOne, false).isEmpty()){ + CRUSHER_RECIPES.add(new CrusherRecipe(input, outputOne, outputOneAmount)); } } + /** + * Adds a new conversion recipe to the compost. + * StackSize is regarded on both input and output and they can be different. + * + * @param input The itemstack to be input into the compost + * @param inputDisplay The block to display when there is input in the compost + * @param output The itemstack to be output from the compost once conversion finishes + * @param outputDisplay The block to display when there is output in the compost + */ + public static void addCompostRecipe(ItemStack input, Block inputDisplay, ItemStack output, Block outputDisplay){ + COMPOST_RECIPES.add(new CompostRecipe(input, inputDisplay, output, outputDisplay)); + } + /** * Adds an item to the list of possible items to be returned when right-clicking a Ball Of Fur * @@ -121,7 +151,7 @@ public class ActuallyAdditionsAPI{ * @param chance The chance (this is from WeightedRandom.Item) */ public static void addBallOfFurReturnItem(ItemStack stack, int chance){ - ActuallyAdditionsAPI.ballOfFurReturnItems.add(new BallOfFurReturn(stack, chance)); + BALL_OF_FUR_RETURN_ITEMS.add(new BallOfFurReturn(stack, chance)); } /** @@ -133,30 +163,55 @@ public class ActuallyAdditionsAPI{ * @param maxAmount The maximum stacksize of the returned stack */ public static void addTreasureChestLoot(ItemStack stack, int chance, int minAmount, int maxAmount){ - ActuallyAdditionsAPI.treasureChestLoot.add(new TreasureChestLoot(stack, chance, minAmount, maxAmount)); + TREASURE_CHEST_LOOT.add(new TreasureChestLoot(stack, chance, minAmount, maxAmount)); } /** - * Adds a recipe to the Atomic Reconstructor conversion without lens + * Adds a recipe to the Atomic Reconstructor conversion lenses * StackSizes can only be 1 and greater ones will be ignored * * @param input The input as an ItemStack * @param output The output as an ItemStack * @param energyUse The amount of RF used per conversion + * @param type The type of lens used for the conversion. To use the default type, use method below. + * Note how this always has to be the same instance of the lens type that the item also has for it to work! */ - public static void addReconstructorLensNoneRecipe(ItemStack input, ItemStack output, int energyUse){ - reconstructorLensNoneRecipes.add(new LensNoneRecipe(input, output, energyUse)); + public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse, LensConversion type){ + RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type)); + } + + public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse){ + addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion); } /** - * Adds a recipe to the Atomic Reconstructor conversion without lens + * Adds a recipe to the Atomic Reconstructor conversion lenses * * @param input The input's OreDictionary name * @param output The output's OreDictionary name * @param energyUse The amount of RF used per conversion + * @param type The type of lens used for the conversion. To use the default type, use method below + * Note how this always has to be the same instance of the lens type that the item also has for it to work! */ - public static void addReconstructorLensNoneRecipe(String input, String output, int energyUse){ - reconstructorLensNoneRecipes.add(new LensNoneRecipe(input, output, energyUse)); + public static void addReconstructorLensConversionRecipe(String input, String output, int energyUse, LensConversion type){ + RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type)); + } + + public static void addReconstructorLensConversionRecipe(String input, String output, int energyUse){ + addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion); + } + + /** + * Adds an item and the way it is modified to the Atomic Reconstructor's color lens. + * This also works for blocks, but they have to be in their item form. + * The way it is modified is an instance of IColorLensChanger. When modifying the item, + * its modifyItem() method will be called with a stack containing the item. + * + * @param item The item (or block's item) to add + * @param changer The change mechanism + */ + public static void addReconstructorLensColorChangeItem(Item item, IColorLensChanger changer){ + RECONSTRUCTOR_LENS_COLOR_CHANGERS.put(item, changer); } /** @@ -165,7 +220,7 @@ public class ActuallyAdditionsAPI{ * @param ingredient The ingredient to add */ public static void addCoffeeMachineIngredient(CoffeeIngredient ingredient){ - coffeeMachineIngredients.add(ingredient); + COFFEE_MACHINE_INGREDIENTS.add(ingredient); } /** @@ -174,7 +229,7 @@ public class ActuallyAdditionsAPI{ * @param entry The entry to add */ public static void addBookletEntry(IBookletEntry entry){ - bookletEntries.add(entry); + BOOKLET_ENTRIES.add(entry); } /** @@ -184,6 +239,6 @@ public class ActuallyAdditionsAPI{ * @param page The page to add */ public static void addPageWithItemStackData(BookletPage page){ - bookletPagesWithItemStackData.add(page); + BOOKLET_PAGES_WITH_ITEM_DATA.add(page); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/BookletPage.java b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/BookletPage.java index e22994256..bc8aaee35 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/BookletPage.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/BookletPage.java @@ -1,16 +1,17 @@ /* - * This file ("IBookletPage.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletPage.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.booklet; import de.ellpeck.actuallyadditions.api.internal.IBookletGui; +import net.minecraft.client.gui.GuiButton; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -20,6 +21,18 @@ public abstract class BookletPage{ public boolean arePageStacksWildcard; protected IBookletChapter chapter; + public void onOpened(IBookletGui gui){ + + } + + public void onClosed(IBookletGui gui){ + + } + + public boolean onActionPerformed(IBookletGui gui, GuiButton button){ + return false; + } + /** * The ID of the page, for the page number etc. * Don't make two pages in the same chapter with the same ID. diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletChapter.java b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletChapter.java index 85900c627..41179427b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletChapter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletChapter.java @@ -1,11 +1,11 @@ /* - * This file ("IBookletChapter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IBookletChapter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.booklet; diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java index c053dfa1f..a46b9dc44 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/booklet/IBookletEntry.java @@ -1,11 +1,11 @@ /* - * This file ("IBookletEntry.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IBookletEntry.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.booklet; diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/internal/IAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/api/internal/IAtomicReconstructor.java index b4625cc17..bcd2153c3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/internal/IAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/internal/IAtomicReconstructor.java @@ -1,15 +1,16 @@ /* - * This file ("IAtomicReconstructor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IAtomicReconstructor.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.internal; +import de.ellpeck.actuallyadditions.api.lens.Lens; import net.minecraft.world.World; /** @@ -49,4 +50,6 @@ public interface IAtomicReconstructor{ * Gets the amount of energy the Reconstructor has stored in its RF storage */ int getEnergy(); + + Lens getLens(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/internal/IBookletGui.java b/src/main/java/de/ellpeck/actuallyadditions/api/internal/IBookletGui.java index 96d279db3..ca92ace10 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/internal/IBookletGui.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/internal/IBookletGui.java @@ -1,20 +1,23 @@ /* - * This file ("IBookletGui.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IBookletGui.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.internal; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; +import net.minecraft.client.gui.GuiButton; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.List; + /** * This is a helper interface for BookletPage * This is not supposed to be implemented. @@ -27,9 +30,8 @@ public interface IBookletGui{ * This method should be used when drawing an ItemStack to a booklet page * It displays the hoverover text of the item and also contains the "show more info"-text and clickable part * - * @param renderTransferButton if the "show more info"-text and clickable part should exist- + * @param renderTransferButton if the "show more info"-text and clickable part should exist */ - @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) void renderTooltipAndTransferButton(BookletPage from, ItemStack stack, int x, int y, boolean renderTransferButton, boolean mousePressed); @@ -43,5 +45,7 @@ public interface IBookletGui{ void drawRect(int startX, int startY, int u, int v, int xSize, int ySize); - EntrySet getCurrentEntrySet(); + IEntrySet getCurrentEntrySet(); + + List getButtonList(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/internal/IEntrySet.java b/src/main/java/de/ellpeck/actuallyadditions/api/internal/IEntrySet.java new file mode 100644 index 000000000..7340e315b --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/api/internal/IEntrySet.java @@ -0,0 +1,41 @@ +/* + * This file ("IEntrySet.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.api.internal; + +import de.ellpeck.actuallyadditions.api.booklet.BookletPage; +import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; +import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; +import net.minecraft.nbt.NBTTagCompound; + +public interface IEntrySet{ + + void setEntry(BookletPage page, IBookletChapter chapter, IBookletEntry entry, int pageInIndex); + + void removeEntry(); + + NBTTagCompound writeToNBT(); + + BookletPage getCurrentPage(); + + IBookletEntry getCurrentEntry(); + + IBookletChapter getCurrentChapter(); + + int getPageInIndex(); + + void setPage(BookletPage page); + + void setEntry(IBookletEntry entry); + + void setChapter(IBookletChapter chapter); + + void setPageInIndex(int page); +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/internal/IMethodHandler.java b/src/main/java/de/ellpeck/actuallyadditions/api/internal/IMethodHandler.java new file mode 100644 index 000000000..388c1971b --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/api/internal/IMethodHandler.java @@ -0,0 +1,37 @@ +/* + * This file ("IMethodHandler.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.api.internal; + +import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.math.BlockPos; + +/** + * This is the internal method handler. + * Use ActuallyAdditionsAPI.methodHandler for calling + * This is not supposed to be implemented. + */ +public interface IMethodHandler{ + + boolean addEffectToStack(ItemStack stack, CoffeeIngredient ingredient); + + PotionEffect getSameEffectFromStack(ItemStack stack, PotionEffect effect); + + void addEffectProperties(ItemStack stack, PotionEffect effect, boolean addDur, boolean addAmp); + + void addEffectToStack(ItemStack stack, PotionEffect effect); + + PotionEffect[] getEffectsFromStack(ItemStack stack); + + boolean invokeConversionLens(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile); +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/lens/ILensItem.java b/src/main/java/de/ellpeck/actuallyadditions/api/lens/ILensItem.java index e1faa032f..339e24820 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/lens/ILensItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/lens/ILensItem.java @@ -1,11 +1,11 @@ /* - * This file ("ILensItem.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ILensItem.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.lens; diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java b/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java index de2bd038c..d1a1c3004 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/lens/Lens.java @@ -1,22 +1,22 @@ /* - * This file ("Lens.java") is part of the Actually Additions Mod for Minecraft. + * This file ("Lens.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.lens; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; /** * This is the base class for a Reconstructor Lens Type (NOT THE ITEM!) - * You need to call register() to register the type */ public abstract class Lens{ @@ -32,7 +32,7 @@ public abstract class Lens{ * @param tile The tile the lens was invoked from * @return If the Reconstructor should stop continuing (return false if you want it to go through blocks) */ - public abstract boolean invoke(BlockPos hitBlock, IAtomicReconstructor tile); + public abstract boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile); /** * Returns the color in an array of 3 float values that are r, g, b @@ -40,12 +40,12 @@ public abstract class Lens{ public abstract float[] getColor(); /** - * Gets the maximum distance the beam goes with this lense + * Gets the maximum distance the beam goes with this lens */ public abstract int getDistance(); /** - * Sets the item corresponding to the lense + * Sets the item corresponding to the lens */ public void setLensItem(Item item){ this.lensItem = item; diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/lens/LensConversion.java b/src/main/java/de/ellpeck/actuallyadditions/api/lens/LensConversion.java new file mode 100644 index 000000000..186210036 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/api/lens/LensConversion.java @@ -0,0 +1,43 @@ +/* + * This file ("LensConversion.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.api.lens; + + +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; + +/** + * This is the base class for a Reconstructor Lens Type that converts two items + * via the ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES list. + *

+ * If you want to make a new type of conversion, just use your type in the recipe + * If you want to use the default type of conversion, use ActuallyAdditionsAPI.lensDefaultConversion. + */ +public class LensConversion extends Lens{ + + @Override + public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ + return ActuallyAdditionsAPI.methodHandler.invokeConversionLens(hitState, hitBlock, tile); + } + + @Override + public float[] getColor(){ + return new float[]{27F/255F, 109F/255F, 1F}; + } + + @Override + public int getDistance(){ + return 10; + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/misc/IDisplayStandItem.java b/src/main/java/de/ellpeck/actuallyadditions/api/misc/IDisplayStandItem.java new file mode 100644 index 000000000..5ca033915 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/api/misc/IDisplayStandItem.java @@ -0,0 +1,21 @@ +/* + * This file ("IDisplayStandItem.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.api.misc; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +public interface IDisplayStandItem{ + + boolean update(ItemStack stack, TileEntity tile, int elapsedTicks); + + int getUsePerTick(ItemStack stack, TileEntity tile, int elapsedTicks); +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/package-info.java b/src/main/java/de/ellpeck/actuallyadditions/api/package-info.java index f2612d9f4..1a290e29b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/package-info.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/package-info.java @@ -1,11 +1,11 @@ /* - * This file ("package-info.java") is part of the Actually Additions Mod for Minecraft. + * This file ("package-info.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ @API(owner = ActuallyAdditionsAPI.MOD_ID, apiVersion = ActuallyAdditionsAPI.API_VERSION, provides = ActuallyAdditionsAPI.API_ID) package de.ellpeck.actuallyadditions.api; diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/BallOfFurReturn.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/BallOfFurReturn.java index 845a3e17b..e2006733c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/BallOfFurReturn.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/BallOfFurReturn.java @@ -1,11 +1,11 @@ /* - * This file ("BallOfFurReturn.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BallOfFurReturn.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.recipe; @@ -15,7 +15,7 @@ import net.minecraft.util.WeightedRandom; public class BallOfFurReturn extends WeightedRandom.Item{ - public ItemStack returnItem; + public final ItemStack returnItem; public BallOfFurReturn(ItemStack returnItem, int chance){ super(chance); diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/coffee/CoffeeIngredient.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CoffeeIngredient.java similarity index 76% rename from src/main/java/de/ellpeck/actuallyadditions/api/recipe/coffee/CoffeeIngredient.java rename to src/main/java/de/ellpeck/actuallyadditions/api/recipe/CoffeeIngredient.java index 53f67a3b4..b195fc671 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/coffee/CoffeeIngredient.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CoffeeIngredient.java @@ -1,15 +1,16 @@ /* - * This file ("CoffeeIngredient.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CoffeeIngredient.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ -package de.ellpeck.actuallyadditions.api.recipe.coffee; +package de.ellpeck.actuallyadditions.api.recipe; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; @@ -30,7 +31,7 @@ public class CoffeeIngredient{ } public boolean effect(ItemStack stack){ - return CoffeeBrewing.addEffectToStack(stack, this); + return ActuallyAdditionsAPI.methodHandler.addEffectToStack(stack, this); } public String getExtraText(){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/ColorLensChangerByDyeMeta.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/ColorLensChangerByDyeMeta.java new file mode 100644 index 000000000..87b6095e7 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/ColorLensChangerByDyeMeta.java @@ -0,0 +1,36 @@ +/* + * This file ("ColorLensChangerByDyeMeta.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.api.recipe; + +import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; + +/** + * Changes an item's color by changing its metadata. + * Much like dye and wool, 0 is white and 15 is black and it will cycle around. + */ +public class ColorLensChangerByDyeMeta implements IColorLensChanger{ + + @Override + public ItemStack modifyItem(ItemStack stack, IBlockState hitBlockState, BlockPos hitBlock, IAtomicReconstructor tile){ + ItemStack newStack = stack.copy(); + int meta = newStack.getItemDamage(); + if(meta >= 15){ + newStack.setItemDamage(0); + } + else{ + newStack.setItemDamage(meta+1); + } + return newStack; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CompostRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CompostRecipe.java new file mode 100644 index 000000000..cab1f74ee --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CompostRecipe.java @@ -0,0 +1,30 @@ +/* + * This file ("CompostRecipe.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.api.recipe; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +public class CompostRecipe{ + + public final ItemStack input; + public final ItemStack output; + public final Block inputDisplay; + public final Block outputDisplay; + + public CompostRecipe(ItemStack input, Block inputDisplay, ItemStack output, Block outputDisplay){ + this.input = input; + this.output = output; + this.inputDisplay = inputDisplay; + this.outputDisplay = outputDisplay; + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java index 31c326130..530b892cd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CrusherRecipe.java @@ -1,11 +1,11 @@ /* - * This file ("CrusherRecipe.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CrusherRecipe.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.recipe; @@ -60,7 +60,7 @@ public class CrusherRecipe{ return null; } - List stacks = OreDictionary.getOres(this.outputOne); + List stacks = OreDictionary.getOres(this.outputOne, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ @@ -84,7 +84,7 @@ public class CrusherRecipe{ return null; } - List stacks = OreDictionary.getOres(this.outputTwo); + List stacks = OreDictionary.getOres(this.outputTwo, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ @@ -108,7 +108,7 @@ public class CrusherRecipe{ return null; } - List stacks = OreDictionary.getOres(this.input); + List stacks = OreDictionary.getOres(this.input, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/IColorLensChanger.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/IColorLensChanger.java new file mode 100644 index 000000000..e80da6b2a --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/IColorLensChanger.java @@ -0,0 +1,40 @@ +/* + * This file ("IColorLensChanger.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.api.recipe; + +import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; + +/** + * Used for the Atomic Reconstructor's Color Lens changing algorythm. + * When registering a new item to be changed, it needs an IColorLensChanger which + * is the method with which the item will be changed. + *

+ * See ColorLensChangerByDyeMeta for reference. + */ +public interface IColorLensChanger{ + + /** + * Modifies the given item. + * Will only be called with stacks containing items that are registered with + * this IColorLensChanger. + * + * @param stack the stack to modify + * @param hitBlockState The state of the block that was hit + * @param hitBlock the block that was hit (usually air, or the block that is also in the stack) + * @param tile the Reconstructor doing the color conversion + * @return the modified stack. Please make sure to return a modified COPY of the input stack. + */ + ItemStack modifyItem(ItemStack stack, IBlockState hitBlockState, BlockPos hitBlock, IAtomicReconstructor tile); + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensNoneRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensConversionRecipe.java similarity index 79% rename from src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensNoneRecipe.java rename to src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensConversionRecipe.java index 12d7b8aa1..43edbcc13 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensNoneRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/LensConversionRecipe.java @@ -1,15 +1,16 @@ /* - * This file ("LensNoneRecipe.java") is part of the Actually Additions Mod for Minecraft. + * This file ("LensConversionRecipe.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.recipe; +import de.ellpeck.actuallyadditions.api.lens.LensConversion; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; @@ -17,24 +18,27 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class LensNoneRecipe{ +public class LensConversionRecipe{ - public int energyUse; + public final int energyUse; + public final LensConversion type; private String input; private String output; private ItemStack inputStack; private ItemStack outputStack; - public LensNoneRecipe(ItemStack input, ItemStack output, int energyUse){ + public LensConversionRecipe(ItemStack input, ItemStack output, int energyUse, LensConversion type){ this.inputStack = input; this.outputStack = output; this.energyUse = energyUse; + this.type = type; } - public LensNoneRecipe(String input, String output, int energyUse){ + public LensConversionRecipe(String input, String output, int energyUse, LensConversion type){ this.input = input; this.output = output; this.energyUse = energyUse; + this.type = type; } public List getOutputs(){ @@ -46,7 +50,7 @@ public class LensNoneRecipe{ return null; } - List stacks = OreDictionary.getOres(this.output); + List stacks = OreDictionary.getOres(this.output, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ @@ -70,7 +74,7 @@ public class LensNoneRecipe{ return null; } - List stacks = OreDictionary.getOres(this.input); + List stacks = OreDictionary.getOres(this.input, false); if(stacks != null && !stacks.isEmpty()){ List stacksCopy = new ArrayList(); for(ItemStack stack : stacks){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/TreasureChestLoot.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/TreasureChestLoot.java index 7c02f8855..df310f16f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/TreasureChestLoot.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/TreasureChestLoot.java @@ -1,11 +1,11 @@ /* - * This file ("TreasureChestLoot.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TreasureChestLoot.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.recipe; @@ -15,9 +15,9 @@ import net.minecraft.util.WeightedRandom; public class TreasureChestLoot extends WeightedRandom.Item{ - public ItemStack returnItem; - public int minAmount; - public int maxAmount; + public final ItemStack returnItem; + public final int minAmount; + public final int maxAmount; public TreasureChestLoot(ItemStack returnItem, int chance, int minAmount, int maxAmount){ super(chance); diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/coffee/CoffeeBrewing.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/coffee/CoffeeBrewing.java deleted file mode 100644 index b7ec3e8b6..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/coffee/CoffeeBrewing.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This file ("CoffeeBrewing.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.api.recipe.coffee; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.PotionEffect; - -import java.util.ArrayList; - -/** - * This is a util class for adding Ingredients to ItemStacks - * Use when making a custom Coffee Ingredient - */ -public class CoffeeBrewing{ - - public static boolean addEffectToStack(ItemStack stack, CoffeeIngredient ingredient){ - boolean worked = false; - if(ingredient != null){ - PotionEffect[] effects = ingredient.getEffects(); - if(effects != null && effects.length > 0){ - for(PotionEffect effect : effects){ - PotionEffect effectHas = getSameEffectFromStack(stack, effect); - if(effectHas != null){ - if(effectHas.getAmplifier() < ingredient.maxAmplifier-1){ - addEffectProperties(stack, effect, false, true); - worked = true; - } - } - else{ - addEffectToStack(stack, effect); - worked = true; - } - } - } - } - return worked; - } - - public static PotionEffect getSameEffectFromStack(ItemStack stack, PotionEffect effect){ - PotionEffect[] effectsStack = getEffectsFromStack(stack); - if(effectsStack != null && effectsStack.length > 0){ - for(PotionEffect effectStack : effectsStack){ - if(effect.getPotionID() == effectStack.getPotionID()){ - return effectStack; - } - } - } - return null; - } - - public static void addEffectProperties(ItemStack stack, PotionEffect effect, boolean addDur, boolean addAmp){ - PotionEffect[] effects = getEffectsFromStack(stack); - stack.setTagCompound(new NBTTagCompound()); - for(int i = 0; i < effects.length; i++){ - if(effects[i].getPotionID() == effect.getPotionID()){ - effects[i] = new PotionEffect(effects[i].getPotionID(), effects[i].getDuration()+(addDur ? effect.getDuration() : 0), effects[i].getAmplifier()+(addAmp ? (effect.getAmplifier() > 0 ? effect.getAmplifier() : 1) : 0)); - } - addEffectToStack(stack, effects[i]); - } - } - - public static void addEffectToStack(ItemStack stack, PotionEffect effect){ - NBTTagCompound tag = stack.getTagCompound(); - if(tag == null){ - tag = new NBTTagCompound(); - } - - int prevCounter = tag.getInteger("Counter"); - NBTTagCompound compound = new NBTTagCompound(); - compound.setInteger("ID", effect.getPotionID()); - compound.setInteger("Duration", effect.getDuration()); - compound.setInteger("Amplifier", effect.getAmplifier()); - - int counter = prevCounter+1; - tag.setTag(counter+"", compound); - tag.setInteger("Counter", counter); - - stack.setTagCompound(tag); - } - - public static PotionEffect[] getEffectsFromStack(ItemStack stack){ - ArrayList effects = new ArrayList(); - NBTTagCompound tag = stack.getTagCompound(); - if(tag != null){ - int counter = tag.getInteger("Counter"); - while(counter > 0){ - NBTTagCompound compound = (NBTTagCompound)tag.getTag(counter+""); - PotionEffect effect = new PotionEffect(compound.getInteger("ID"), compound.getInteger("Duration"), compound.getByte("Amplifier")); - if(effect.getPotionID() > 0){ - effects.add(effect); - } - counter--; - } - } - return effects.size() > 0 ? effects.toArray(new PotionEffect[effects.size()]) : null; - } - -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/tile/IPhantomTile.java b/src/main/java/de/ellpeck/actuallyadditions/api/tile/IPhantomTile.java index e034a2228..80b6729ae 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/tile/IPhantomTile.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/tile/IPhantomTile.java @@ -1,16 +1,16 @@ /* - * This file ("IPhantomTile.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IPhantomTile.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.api.tile; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; /** * Extending this will cause a TileEntity to be able to be connected via a Phantom Connector diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index bbd2131d6..856379623 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -1,15 +1,16 @@ /* - * This file ("ActuallyAdditions.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ActuallyAdditions.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.booklet.InitBooklet; @@ -17,7 +18,7 @@ import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler; import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting; import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting; import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting; -import de.ellpeck.actuallyadditions.mod.event.InitEvents; +import de.ellpeck.actuallyadditions.mod.event.CommonEvents; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.gen.InitVillager; import de.ellpeck.actuallyadditions.mod.gen.OreGen; @@ -25,10 +26,14 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.items.InitForeignPaxels; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; -import de.ellpeck.actuallyadditions.mod.items.lens.LensNoneRecipeHandler; +import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler; +import de.ellpeck.actuallyadditions.mod.items.lens.Lenses; import de.ellpeck.actuallyadditions.mod.material.InitArmorMaterials; import de.ellpeck.actuallyadditions.mod.material.InitToolMaterials; -import de.ellpeck.actuallyadditions.mod.misc.*; +import de.ellpeck.actuallyadditions.mod.misc.BannerHelper; +import de.ellpeck.actuallyadditions.mod.misc.DungeonLoot; +import de.ellpeck.actuallyadditions.mod.misc.MethodHandler; +import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.ore.InitOreDict; import de.ellpeck.actuallyadditions.mod.proxy.IProxy; @@ -37,16 +42,16 @@ import de.ellpeck.actuallyadditions.mod.recipe.HairyBallHandler; import de.ellpeck.actuallyadditions.mod.recipe.TreasureChestHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.update.UpdateChecker; -import de.ellpeck.actuallyadditions.mod.util.FakePlayerUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraft.init.Items; -import net.minecraft.server.MinecraftServer; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.event.*; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import java.util.Locale; @@ -57,13 +62,22 @@ public class ActuallyAdditions{ @Instance(ModUtil.MOD_ID) public static ActuallyAdditions instance; - @SidedProxy(clientSide = "de.ellpeck.actuallyadditions.mod.proxy.ClientProxy", serverSide = "de.ellpeck.actuallyadditions.mod.proxy.ServerProxy") + @SidedProxy(clientSide = ModUtil.PROXY_CLIENT, serverSide = ModUtil.PROXY_SERVER) public static IProxy proxy; + static{ + //For some reason, this has to be done here + FluidRegistry.enableUniversalBucket(); + } + @EventHandler public void preInit(FMLPreInitializationEvent event){ ModUtil.LOGGER.info("Starting PreInitialization Phase..."); + ActuallyAdditionsAPI.methodHandler = new MethodHandler(); + Lenses.init(); + InitBooklet.preInit(); + new ConfigurationHandler(event.getSuggestedConfigurationFile()); PacketHandler.init(); InitToolMaterials.init(); @@ -72,8 +86,9 @@ public class ActuallyAdditions{ InitFluids.init(); InitItems.init(); FuelHandler.init(); - UpdateChecker.init(); - InitBooklet.preInit(); + BannerHelper.init(); + SoundHandler.init(); + new UpdateChecker(); proxy.preInit(event); ModUtil.LOGGER.info("PreInitialization Finished."); @@ -86,11 +101,12 @@ public class ActuallyAdditions{ InitOreDict.init(); InitAchievements.init(); GuiHandler.init(); - OreGen.init(); + new OreGen(); TileEntityBase.init(); - InitEvents.init(); + new CommonEvents(); InitCrafting.init(); DungeonLoot.init(); + proxy.init(event); ModUtil.LOGGER.info("Initialization Finished."); @@ -106,41 +122,25 @@ public class ActuallyAdditions{ ItemCrafting.initMashedFoodRecipes(); HairyBallHandler.init(); TreasureChestHandler.init(); - LensNoneRecipeHandler.init(); + LensRecipeHandler.init(); InitForeignPaxels.init(); InitBooklet.postInit(); proxy.postInit(event); ModUtil.LOGGER.info("PostInitialization Finished."); - FakePlayerUtil.info(); - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event){ - Util.registerDispenserHandler(InitItems.itemBucketOil, new DispenserHandlerEmptyBucket()); - Util.registerDispenserHandler(InitItems.itemBucketCanolaOil, new DispenserHandlerEmptyBucket()); - Util.registerDispenserHandler(Items.bucket, new DispenserHandlerFillBucket()); - Util.registerDispenserHandler(InitItems.itemFertilizer, new DispenserHandlerFertilize()); - } - - @EventHandler - public void serverStarted(FMLServerStartedEvent event){ - if(LaserRelayConnectionHandler.getInstance() == null){ - LaserRelayConnectionHandler.setInstance(new LaserRelayConnectionHandler()); - } - - WorldData.init(MinecraftServer.getServer()); } @EventHandler public void missingMapping(FMLMissingMappingsEvent event){ for(FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){ - //Ignore removal of foreign paxels - if(mapping.name != null && mapping.name.toLowerCase(Locale.ROOT).startsWith(ModUtil.MOD_ID_LOWER+":")){ - if(mapping.name.contains("paxel") || mapping.name.contains("itemSpecial") || mapping.name.contains("blockBookStand")){ - mapping.ignore(); - ModUtil.LOGGER.info("Missing Mapping "+mapping.name+" is getting ignored. This is intentional."); + if(mapping.name != null){ + String name = mapping.name.toLowerCase(Locale.ROOT); + if(name.startsWith(ModUtil.MOD_ID+":")){ + if(name.contains("paxel") || name.contains("itemspecial") || name.contains("blockbookstand") || name.contains("rarmor") || name.contains("bucket") || name.contains("modulereconstructor")){ + mapping.ignore(); + ModUtil.LOGGER.info("Missing Mapping "+mapping.name+" is getting ignored. This is intentional."); + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/achievement/InitAchievements.java b/src/main/java/de/ellpeck/actuallyadditions/mod/achievement/InitAchievements.java index e8bf4f7eb..077190796 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/achievement/InitAchievements.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/achievement/InitAchievements.java @@ -1,11 +1,11 @@ /* - * This file ("InitAchievements.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitAchievements.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.achievement; @@ -17,20 +17,20 @@ import net.minecraftforge.common.AchievementPage; import java.util.ArrayList; -public class InitAchievements{ +public final class InitAchievements{ + public static final ArrayList ACHIEVEMENT_LIST = new ArrayList(); public static int pageNumber; public static AchievementPage theAchievementPage; - public static ArrayList achievementList = new ArrayList(); public static void init(){ ModUtil.LOGGER.info("Initializing Achievements..."); for(int i = 0; i < TheAchievements.values().length; i++){ - achievementList.add(TheAchievements.values()[i].ach); + ACHIEVEMENT_LIST.add(TheAchievements.values()[i].chieve); } - theAchievementPage = new AchievementPage(StringUtil.localize("achievement.page."+ModUtil.MOD_ID_LOWER), achievementList.toArray(new Achievement[achievementList.size()])); + theAchievementPage = new AchievementPage(StringUtil.localize("achievement.page."+ModUtil.MOD_ID), ACHIEVEMENT_LIST.toArray(new Achievement[ACHIEVEMENT_LIST.size()])); pageNumber = AchievementPage.getAchievementPages().size(); AchievementPage.registerAchievementPage(theAchievementPage); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/achievement/TheAchievements.java b/src/main/java/de/ellpeck/actuallyadditions/mod/achievement/TheAchievements.java index 09043220f..b0a338a99 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/achievement/TheAchievements.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/achievement/TheAchievements.java @@ -1,26 +1,28 @@ /* - * This file ("TheAchievements.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheAchievements.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.achievement; +import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements.Type; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; public enum TheAchievements{ - OPEN_BOOKLET("openBooklet", 0, 0, new ItemStack(InitItems.itemBooklet), null, InitAchievements.Type.MISC), - NAME_SMILEY_CLOUD("nameSmileyCloud", 4, 2, new ItemStack(InitBlocks.blockSmileyCloud), null, InitAchievements.Type.MISC, true), - OPEN_TREASURE_CHEST("openTreasureChest", 1, -3, new ItemStack(InitBlocks.blockTreasureChest), OPEN_BOOKLET, InitAchievements.Type.MISC), + OPEN_BOOKLET("openBooklet", 0, 0, new ItemStack(InitItems.itemBooklet), null, Type.MISC), + NAME_SMILEY_CLOUD("nameSmileyCloud", 4, 2, new ItemStack(InitBlocks.blockSmileyCloud), null, Type.MISC, true), + OPEN_TREASURE_CHEST("openTreasureChest", 1, -3, new ItemStack(InitBlocks.blockTreasureChest), OPEN_BOOKLET, Type.MISC), CRAFT_COAL_GEN("craftCoalGen", -2, 0, new ItemStack(InitBlocks.blockCoalGenerator), OPEN_BOOKLET), CRAFT_LEAF_GEN("craftLeafGen", -3, -2, new ItemStack(InitBlocks.blockLeafGenerator), CRAFT_COAL_GEN), CRAFT_RECONSTRUCTOR("craftReconstructor", -5, 0, new ItemStack(InitBlocks.blockAtomicReconstructor), CRAFT_COAL_GEN), @@ -29,29 +31,31 @@ public enum TheAchievements{ CRAFT_ENERGYFACE("craftEnergyface", 2, -2, new ItemStack(InitBlocks.blockPhantomEnergyface), CRAFT_PHANTOMFACE), CRAFT_LASER_RELAY("craftLaserRelay", -7, -2, new ItemStack(InitBlocks.blockLaserRelay), CRAFT_RECONSTRUCTOR), CRAFT_CRUSHER("craftCrusher", -8, 0, new ItemStack(InitBlocks.blockGrinder), CRAFT_RECONSTRUCTOR), - PICK_UP_COFFEE("pickUpCoffee", -4, 2, new ItemStack(InitItems.itemCoffeeBean), CRAFT_RECONSTRUCTOR, InitAchievements.Type.PICK_UP), - CRAFT_COFFEE_MACHINE("craftCoffeeMachine", -3, 3, new ItemStack(InitBlocks.blockCoffeeMachine), PICK_UP_COFFEE); + PICK_UP_COFFEE("pickUpCoffee", -4, 2, new ItemStack(InitItems.itemCoffeeBean), CRAFT_RECONSTRUCTOR, Type.PICK_UP), + CRAFT_COFFEE_MACHINE("craftCoffeeMachine", -3, 3, new ItemStack(InitBlocks.blockCoffeeMachine), PICK_UP_COFFEE), + OBSCURED("obscured", 5, -5, new ItemStack(Items.RECORD_11), null, Type.MISC, true), + CRAFT_FIREWORK_BOX("craftFireworkBox", -6, -4, new ItemStack(InitBlocks.blockFireworkBox), null, Type.CRAFTING, true); - public final Achievement ach; - public final InitAchievements.Type type; + public final Achievement chieve; + public final Type type; TheAchievements(String name, int x, int y, ItemStack displayStack, TheAchievements hasToHaveBefore){ - this(name, x, y, displayStack, hasToHaveBefore, InitAchievements.Type.CRAFTING, false); + this(name, x, y, displayStack, hasToHaveBefore, Type.CRAFTING, false); } - TheAchievements(String name, int x, int y, ItemStack displayStack, TheAchievements hasToHaveBefore, InitAchievements.Type type, boolean special){ - this.ach = new Achievement("achievement."+ModUtil.MOD_ID_LOWER+"."+name, ModUtil.MOD_ID_LOWER+"."+name, x, y, displayStack, hasToHaveBefore == null ? null : hasToHaveBefore.ach); + TheAchievements(String name, int x, int y, ItemStack displayStack, TheAchievements hasToHaveBefore, Type type, boolean special){ + this.chieve = new Achievement("achievement."+ModUtil.MOD_ID+"."+name, ModUtil.MOD_ID+"."+name, x, y, displayStack, hasToHaveBefore == null ? null : hasToHaveBefore.chieve); if(hasToHaveBefore == null){ - this.ach.initIndependentStat(); + this.chieve.initIndependentStat(); } if(special){ - this.ach.setSpecial(); + this.chieve.setSpecial(); } - this.ach.registerStat(); + this.chieve.registerStat(); this.type = type; } - TheAchievements(String name, int x, int y, ItemStack displayStack, TheAchievements hasToHaveBefore, InitAchievements.Type type){ + TheAchievements(String name, int x, int y, ItemStack displayStack, TheAchievements hasToHaveBefore, Type type){ this(name, x, y, displayStack, hasToHaveBefore, type, false); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java index e96154ccf..26b623ba7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -1,22 +1,24 @@ /* - * This file ("BlockAtomicReconstructor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockAtomicReconstructor.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.api.lens.ILensItem; +import de.ellpeck.actuallyadditions.mod.achievement.TheAchievements; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; import de.ellpeck.actuallyadditions.mod.util.*; import net.minecraft.block.Block; import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -24,14 +26,17 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.profiler.Profiler; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -45,38 +50,45 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); public BlockAtomicReconstructor(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(10F); this.setResistance(80F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ if(this.tryToggleRedstone(world, pos, player)){ return true; } if(!world.isRemote){ TileEntityAtomicReconstructor reconstructor = (TileEntityAtomicReconstructor)world.getTileEntity(pos); if(reconstructor != null){ - ItemStack heldItem = player.getCurrentEquippedItem(); if(heldItem != null){ - if(heldItem.getItem() instanceof ILensItem && reconstructor.getStackInSlot(0) == null){ + Item item = heldItem.getItem(); + if(item instanceof ILensItem && reconstructor.getStackInSlot(0) == null){ ItemStack toPut = heldItem.copy(); toPut.stackSize = 1; reconstructor.setInventorySlotContents(0, toPut); player.inventory.decrStackSize(player.inventory.currentItem, 1); } + //Shush, don't tell anyone! + else if(item == Items.RECORD_11){ + reconstructor.counter++; + reconstructor.markDirty(); + player.addStat(TheAchievements.OBSCURED.chieve); + } } else{ - if(reconstructor.getStackInSlot(0) != null){ - player.inventory.setInventorySlotContents(player.inventory.currentItem, reconstructor.getStackInSlot(0).copy()); + ItemStack slot = reconstructor.getStackInSlot(0); + if(slot != null){ + player.inventory.setInventorySlotContents(player.inventory.currentItem, slot.copy()); reconstructor.setInventorySlotContents(0, null); } } @@ -85,6 +97,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud return true; } + @Override public TileEntity createNewTileEntity(World world, int i){ return new TileEntityAtomicReconstructor(); @@ -98,26 +111,26 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud @Override @SideOnly(Side.CLIENT) - public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){ + public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){ TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); if(tile instanceof TileEntityAtomicReconstructor){ ItemStack slot = ((TileEntityAtomicReconstructor)tile).getStackInSlot(0); String strg; if(slot == null){ - strg = StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".noLens"); + strg = StringUtil.localize("info."+ModUtil.MOD_ID+".noLens"); } else{ strg = slot.getItem().getItemStackDisplayName(slot); AssetUtil.renderStackToGui(slot, resolution.getScaledWidth()/2+15, resolution.getScaledHeight()/2-29, 1F); } - minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW+""+EnumChatFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE); + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.YELLOW+""+TextFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE); } } @Override - protected Class getItemBlock(){ - return TheItemBlock.class; + protected ItemBlockBase getItemBlock(){ + return new TheItemBlock(this); } @Override @@ -127,8 +140,8 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal(); - PosUtil.setMetadata(pos, world, rotation, 2); + int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); + world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); } @@ -150,6 +163,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud this.setMaxDamage(0); } + @Override public String getUnlocalizedName(ItemStack stack){ return this.getUnlocalizedName(); @@ -170,7 +184,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud this.toPick2 = Util.RANDOM.nextInt(NAME_FLAVOR_AMOUNTS_2)+1; } - String base = "tile."+ModUtil.MOD_ID_LOWER+"."+((BlockAtomicReconstructor)this.block).getBaseName()+".info."; + String base = "tile."+ModUtil.MOD_ID+"."+((BlockAtomicReconstructor)this.block).getBaseName()+".info."; list.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBlackLotus.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBlackLotus.java index da6fdd6d2..ffcab7678 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBlackLotus.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBlackLotus.java @@ -1,11 +1,11 @@ /* - * This file ("BlockBlackLotus.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockBlackLotus.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBookletStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBookletStand.java new file mode 100644 index 000000000..aba005c2c --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBookletStand.java @@ -0,0 +1,166 @@ +/* + * This file ("BlockBookletStand.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.booklet.entry.EntrySet; +import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; +import de.ellpeck.actuallyadditions.mod.items.InitItems; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBookletStand; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.profiler.Profiler; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public class BlockBookletStand extends BlockContainerBase implements IHudDisplay{ + + private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3); + + private static final AxisAlignedBB AABB_1 = new AxisAlignedBB(0, 3*0.0625, 0, 1, 14*0.0625, 0.0625); + private static final AxisAlignedBB AABB_2 = new AxisAlignedBB(0, 3*0.0625, 0, 0.0625, 14*0.0625, 1); + private static final AxisAlignedBB AABB_3 = new AxisAlignedBB(1-0.0625, 3*0.0625, 0, 1, 14*0.0625, 1); + private static final AxisAlignedBB AABB_4 = new AxisAlignedBB(1, 3*0.0625, 1-0.0625, 0, 14*0.0625, 1); + + public BlockBookletStand(String name){ + super(Material.WOOD, name); + this.setHarvestLevel("axe", 0); + this.setHardness(1.0F); + this.setResistance(4.0F); + this.setSoundType(SoundType.WOOD); + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + int meta = this.getMetaFromState(state); + switch(meta){ + case 0: + return AABB_4; + case 1: + return AABB_1; + case 2: + return AABB_3; + case 3: + return AABB_2; + } + return super.getBoundingBox(state, source, pos); + } + + @Override + public boolean isFullCube(IBlockState state){ + return false; + } + + @Override + public boolean isOpaqueCube(IBlockState state){ + return false; + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BOOK_STAND.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + return true; + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.RARE; + } + + @Override + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ + int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; + + if(rotation == 0){ + world.setBlockState(pos, this.getStateFromMeta(0), 2); + } + if(rotation == 1){ + world.setBlockState(pos, this.getStateFromMeta(3), 2); + } + if(rotation == 2){ + world.setBlockState(pos, this.getStateFromMeta(1), 2); + } + if(rotation == 3){ + world.setBlockState(pos, this.getStateFromMeta(2), 2); + } + + TileEntityBookletStand tile = (TileEntityBookletStand)world.getTileEntity(pos); + if(tile != null){ + if(tile.assignedPlayer == null){ + tile.assignedPlayer = player.getName(); + tile.markDirty(); + tile.sendUpdate(); + } + } + + super.onBlockPlacedBy(world, pos, state, player, stack); + } + + + @Override + public TileEntity createNewTileEntity(World world, int par2){ + return new TileEntityBookletStand(); + } + + @Override + @SideOnly(Side.CLIENT) + public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){ + TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + if(tile instanceof TileEntityBookletStand){ + EntrySet set = ((TileEntityBookletStand)tile).assignedEntry; + + String strg1; + String strg2; + if(set.entry == null){ + strg1 = "No entry saved! Save one if"; + strg2 = "you are the player who placed it!"; + } + else if(set.chapter == null){ + strg1 = set.entry.getLocalizedName(); + strg2 = "Page "+set.pageInIndex; + } + else{ + strg1 = set.chapter.getLocalizedName(); + strg2 = "Page "+set.page.getID(); + + AssetUtil.renderStackToGui(set.chapter.getDisplayItemStack() != null ? set.chapter.getDisplayItemStack() : new ItemStack(InitItems.itemBooklet), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+10, 1F); + } + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.YELLOW+""+TextFormatting.ITALIC+strg1, resolution.getScaledWidth()/2+25, resolution.getScaledHeight()/2+8, StringUtil.DECIMAL_COLOR_WHITE); + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.YELLOW+""+TextFormatting.ITALIC+strg2, resolution.getScaledWidth()/2+25, resolution.getScaledHeight()/2+18, StringUtil.DECIMAL_COLOR_WHITE); + } + } + + @Override + protected PropertyInteger getMetaProperty(){ + return META; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java index a09f346c6..7a8ee49a3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java @@ -1,11 +1,11 @@ /* - * This file ("BlockBreaker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockBreaker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,8 +15,9 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlacer; import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -25,31 +26,33 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockBreaker extends BlockContainerBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); - private boolean isPlacer; + private final boolean isPlacer; public BlockBreaker(boolean isPlacer, String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.isPlacer = isPlacer; this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ - return this.isPlacer ? new TileEntityBreaker.TileEntityPlacer() : new TileEntityBreaker(); + return this.isPlacer ? new TileEntityPlacer() : new TileEntityBreaker(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(this.tryToggleRedstone(world, pos, player)){ return true; } @@ -70,8 +73,8 @@ public class BlockBreaker extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal(); - PosUtil.setMetadata(pos, world, rotation, 2); + int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); + world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCanolaPress.java index 1487ff364..2b3634294 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCanolaPress.java @@ -1,11 +1,11 @@ /* - * This file ("BlockCanolaPress.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockCanolaPress.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,37 +14,42 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockCanolaPress extends BlockContainerBase{ public BlockCanolaPress(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityCanolaPress(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityCanolaPress press = (TileEntityCanolaPress)world.getTileEntity(pos); if(press != null){ - player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CANOLA_PRESS.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + if(this.checkFailUseItemOnTank(player, stack, press.tank)){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CANOLA_PRESS.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + } } return true; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java index 9bb60e771..213c79544 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java @@ -1,11 +1,11 @@ /* - * This file ("BlockCoalGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockCoalGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -16,17 +16,17 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -35,17 +35,16 @@ import java.util.Random; public class BlockCoalGenerator extends BlockContainerBase{ - private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1); - public BlockCoalGenerator(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); this.setTickRandomly(true); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityCoalGenerator(); @@ -53,18 +52,19 @@ public class BlockCoalGenerator extends BlockContainerBase{ @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ - int meta = PosUtil.getMetadata(pos, world); - - if(meta == 1){ - for(int i = 0; i < 5; i++){ - world.spawnParticle(ClientProxy.bulletForMyValentine ? EnumParticleTypes.HEART : EnumParticleTypes.SMOKE_NORMAL, (double)pos.getX()+0.5F, (double)pos.getY()+1.0F, (double)pos.getZ()+0.5F, 0.0D, 0.0D, 0.0D); + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityCoalGenerator){ + if(((TileEntityCoalGenerator)tile).currentBurnTime > 0){ + for(int i = 0; i < 5; i++){ + world.spawnParticle(ClientProxy.bulletForMyValentine ? EnumParticleTypes.HEART : EnumParticleTypes.SMOKE_NORMAL, (double)pos.getX()+0.5F, (double)pos.getY()+1.0F, (double)pos.getZ()+0.5F, 0.0D, 0.0D, 0.0D); + } } } } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityCoalGenerator press = (TileEntityCoalGenerator)world.getTileEntity(pos); if(press != null){ @@ -80,11 +80,6 @@ public class BlockCoalGenerator extends BlockContainerBase{ return EnumRarity.RARE; } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java index 7c49c7e23..281e67f21 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java @@ -1,11 +1,11 @@ /* - * This file ("BlockCoffeeMachine.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockCoffeeMachine.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -23,48 +23,58 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockCoffeeMachine extends BlockContainerBase{ + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0625, 0, 0.0625, 1-0.0625, 1-0.0625*2, 1-0.0625); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3); public BlockCoffeeMachine(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); - - float f = 1/16F; - this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f); + this.setSoundType(SoundType.STONE); } @Override - public boolean isFullCube(){ + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + return AABB; + } + + @Override + public boolean isFullCube(IBlockState state){ return false; } @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing f6, float f7, float f8, float f9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing f6, float f7, float f8, float f9){ if(!world.isRemote){ TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(pos); if(machine != null){ - player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + if(this.checkFailUseItemOnTank(player, stack, machine.tank)){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + } } return true; } return true; } + @Override public TileEntity createNewTileEntity(World world, int meta){ return new TileEntityCoffeeMachine(); @@ -86,16 +96,16 @@ public class BlockCoffeeMachine extends BlockContainerBase{ int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; if(rotation == 0){ - PosUtil.setMetadata(pos, world, 0, 2); + world.setBlockState(pos, this.getStateFromMeta(0), 2); } if(rotation == 1){ - PosUtil.setMetadata(pos, world, 3, 2); + world.setBlockState(pos, this.getStateFromMeta(3), 2); } if(rotation == 2){ - PosUtil.setMetadata(pos, world, 1, 2); + world.setBlockState(pos, this.getStateFromMeta(1), 2); } if(rotation == 3){ - PosUtil.setMetadata(pos, world, 2, 2); + world.setBlockState(pos, this.getStateFromMeta(2), 2); } super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java index 743dc70d8..eb5d2ce7f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java @@ -1,11 +1,11 @@ /* - * This file ("BlockColoredLamp.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockColoredLamp.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -27,9 +26,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -41,12 +40,12 @@ import java.util.Random; public class BlockColoredLamp extends BlockBase{ - public static TheColoredLampColors[] allLampTypes = TheColoredLampColors.values(); - private static final PropertyInteger META = PropertyInteger.create("meta", 0, allLampTypes.length-1); - public boolean isOn; + public static final TheColoredLampColors[] ALL_LAMP_TYPES = TheColoredLampColors.values(); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, ALL_LAMP_TYPES.length-1); + public final boolean isOn; public BlockColoredLamp(boolean isOn, String name){ - super(Material.redstoneLight, name); + super(Material.REDSTONE_LIGHT, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(0.5F); this.setResistance(3.0F); @@ -64,16 +63,15 @@ public class BlockColoredLamp extends BlockBase{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ){ //Turning On if(player.isSneaking()){ if(!world.isRemote){ - PosUtil.setBlock(pos, world, this.isOn ? InitBlocks.blockColoredLamp : InitBlocks.blockColoredLampOn, PosUtil.getMetadata(pos, world), 2); + world.setBlockState(pos, (this.isOn ? InitBlocks.blockColoredLamp : InitBlocks.blockColoredLampOn).getStateFromMeta(this.getMetaFromState(state)), 2); } return true; } - ItemStack stack = player.getCurrentEquippedItem(); if(stack != null){ //Changing Colors int[] oreIDs = OreDictionary.getOreIDs(stack); @@ -82,9 +80,9 @@ public class BlockColoredLamp extends BlockBase{ String name = OreDictionary.getOreName(oreID); TheColoredLampColors color = TheColoredLampColors.getColorFromDyeName(name); if(color != null){ - if(PosUtil.getMetadata(pos, world) != color.ordinal()){ + if(this.getMetaFromState(state) != color.ordinal()){ if(!world.isRemote){ - PosUtil.setMetadata(pos, world, color.ordinal(), 2); + world.setBlockState(pos, this.getStateFromMeta(color.ordinal()), 2); if(!player.capabilities.isCreativeMode){ player.inventory.decrStackSize(player.inventory.currentItem, 1); } @@ -106,37 +104,27 @@ public class BlockColoredLamp extends BlockBase{ @Override @SideOnly(Side.CLIENT) - public Item getItem(World world, BlockPos pos){ - return Item.getItemFromBlock(InitBlocks.blockColoredLamp); - } - - @SuppressWarnings("all") - @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allLampTypes.length; j++){ + for(int j = 0; j < ALL_LAMP_TYPES.length; j++){ list.add(new ItemStack(item, 1, j)); } } @Override - public int getLightValue(IBlockAccess world, BlockPos pos){ + public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos){ return this.isOn ? 15 : 0; } @Override - public Class getItemBlock(){ - return TheItemBlock.class; + protected ItemBlockBase getItemBlock(){ + return new TheItemBlock(this); } @Override protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[allLampTypes.length]; - for(int i = 0; i < allLampTypes.length; i++){ - String name = this.getBaseName()+allLampTypes[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + for(int i = 0; i < ALL_LAMP_TYPES.length; i++){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), META.getName()+"="+i); } - ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } @Override @@ -157,17 +145,19 @@ public class BlockColoredLamp extends BlockBase{ this.setMaxDamage(0); } + @Override public String getItemStackDisplayName(ItemStack stack){ - if(stack.getItemDamage() >= allLampTypes.length){ - return null; + if(stack.getItemDamage() >= ALL_LAMP_TYPES.length){ + return StringUtil.BUGGED_ITEM_NAME; } - return StringUtil.localize(this.getUnlocalizedName(stack)+".name")+(((BlockColoredLamp)this.block).isOn ? " ("+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".onSuffix.desc")+")" : ""); + return StringUtil.localize(this.getUnlocalizedName(stack)+".name")+(((BlockColoredLamp)this.block).isOn ? " ("+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".onSuffix.desc")+")" : ""); } + @Override public String getUnlocalizedName(ItemStack stack){ - return InitBlocks.blockColoredLamp.getUnlocalizedName()+allLampTypes[stack.getItemDamage()].name; + return InitBlocks.blockColoredLamp.getUnlocalizedName()+ALL_LAMP_TYPES[stack.getItemDamage()].name; } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java index 6023cdf34..8be3e66eb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java @@ -1,22 +1,21 @@ /* - * This file ("BlockCompost.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockCompost.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; +import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; -import de.ellpeck.actuallyadditions.mod.items.ItemFertilizer; -import de.ellpeck.actuallyadditions.mod.items.ItemMisc; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -27,7 +26,13 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.profiler.Profiler; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -36,77 +41,104 @@ import java.util.List; public class BlockCompost extends BlockContainerBase implements IHudDisplay{ + protected static final AxisAlignedBB AABB_LEGS = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.3125D, 1.0D); + protected static final AxisAlignedBB AABB_WALL_NORTH = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.125D); + protected static final AxisAlignedBB AABB_WALL_SOUTH = new AxisAlignedBB(0.0D, 0.0D, 0.875D, 1.0D, 1.0D, 1.0D); + protected static final AxisAlignedBB AABB_WALL_EAST = new AxisAlignedBB(0.875D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + protected static final AxisAlignedBB AABB_WALL_WEST = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.125D, 1.0D, 1.0D); + private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0625, 0, 0.0625, 1-0.0625, 11*0.0625, 1-0.0625); + public BlockCompost(String name){ - super(Material.wood, name); + super(Material.WOOD, name); this.setHarvestLevel("axe", 0); this.setHardness(0.5F); this.setResistance(5.0F); - this.setStepSound(soundTypeWood); - - this.setBlockBoundsForItemRender(); + this.setSoundType(SoundType.WOOD); } @Override - public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity){ - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); - super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity); - float f = 0.125F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); - super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); - super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity); - this.setBlockBounds(1.0F-f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity); - this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, 1.0F, 1.0F); - super.addCollisionBoxesToList(world, pos, state, mask, list, collidingEntity); - this.setBlockBoundsForItemRender(); + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + return AABB; } @Override - public boolean isOpaqueCube(){ + public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List collidingBoxes, Entity entityIn){ + addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_LEGS); + addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_WEST); + addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_NORTH); + addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_EAST); + addCollisionBoxToList(pos, entityBox, collidingBoxes, AABB_WALL_SOUTH); + } + + @Override + public boolean isOpaqueCube(IBlockState state){ return false; } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing f6, float f7, float f8, float f9){ - if(!world.isRemote){ - ItemStack stackPlayer = player.getCurrentEquippedItem(); - TileEntityCompost tile = (TileEntityCompost)world.getTileEntity(pos); - //Add items to be composted - if(stackPlayer != null && stackPlayer.getItem() instanceof ItemMisc && stackPlayer.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal() && (tile.slots[0] == null || (!(tile.slots[0].getItem() instanceof ItemFertilizer) && tile.slots[0].stackSize < TileEntityCompost.AMOUNT))){ - if(tile.slots[0] == null){ - tile.slots[0] = new ItemStack(stackPlayer.getItem(), 1, TheMiscItems.MASHED_FOOD.ordinal()); - } - else{ - tile.slots[0].stackSize++; - } - if(!player.capabilities.isCreativeMode){ - player.inventory.getCurrentItem().stackSize--; - } - tile.markDirty(); - } - - //Add Fertilizer to player's inventory - else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem() instanceof ItemFertilizer && stackPlayer.stackSize <= stackPlayer.getMaxStackSize()-tile.slots[0].stackSize)) && tile.slots[0].getItem() instanceof ItemFertilizer){ - if(stackPlayer == null){ - player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy()); - } - else{ - player.getCurrentEquippedItem().stackSize += tile.slots[0].stackSize; - } - tile.slots[0] = null; - tile.markDirty(); - } - } - return true; + public boolean isFullCube(IBlockState state){ + return false; } @Override - public void setBlockBoundsForItemRender(){ - float f = 1.0F/16.0F; - this.setBlockBounds(f, 0.0F, f, 1.0F-f, 1.0F, 1.0F-f); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stackPlayer, EnumFacing f6, float f7, float f8, float f9){ + if(!world.isRemote){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityCompost){ + TileEntityCompost compost = (TileEntityCompost)tile; + ItemStack slot = compost.getStackInSlot(0); + CompostRecipe recipeIn = TileEntityCompost.getRecipeForInput(slot); + if(slot == null || recipeIn != null){ + if(stackPlayer != null){ + CompostRecipe recipeHand = TileEntityCompost.getRecipeForInput(stackPlayer); + if(recipeHand != null && (recipeIn == null || recipeIn == recipeHand)){ + int maxAdd = Math.min(recipeHand.input.stackSize, stackPlayer.stackSize); + + if(slot == null){ + ItemStack stackToAdd = stackPlayer.copy(); + stackToAdd.stackSize = maxAdd; + compost.setInventorySlotContents(0, stackToAdd); + player.inventory.decrStackSize(player.inventory.currentItem, maxAdd); + return true; + } + else{ + ItemStack stackIn = slot.copy(); + if(stackIn.stackSize < recipeHand.input.stackSize){ + int sizeAdded = Math.min(maxAdd, recipeHand.input.stackSize-stackIn.stackSize); + stackIn.stackSize += sizeAdded; + compost.setInventorySlotContents(0, stackIn); + player.inventory.decrStackSize(player.inventory.currentItem, sizeAdded); + return true; + } + } + } + } + } + else{ + if(stackPlayer == null){ + player.inventory.setInventorySlotContents(player.inventory.currentItem, slot.copy()); + compost.setInventorySlotContents(0, null); + return true; + } + else if(stackPlayer.isItemEqual(slot)){ + int addedStackSize = Math.min(slot.stackSize, stackPlayer.getMaxStackSize()-stackPlayer.stackSize); + ItemStack stackToAdd = stackPlayer.copy(); + stackToAdd.stackSize += addedStackSize; + player.inventory.setInventorySlotContents(player.inventory.currentItem, stackToAdd); + compost.decrStackSize(0, addedStackSize); + return true; + + } + } + } + } + else{ + return true; + } + return false; } + @Override public TileEntity createNewTileEntity(World world, int meta){ return new TileEntityCompost(); @@ -125,7 +157,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ @Override @SideOnly(Side.CLIENT) - public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){ + public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){ TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); if(tile instanceof TileEntityCompost){ ItemStack slot = ((TileEntityCompost)tile).getStackInSlot(0); @@ -138,7 +170,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ AssetUtil.renderStackToGui(slot, resolution.getScaledWidth()/2+15, resolution.getScaledHeight()/2-29, 1F); } - minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW+""+EnumChatFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE); + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.YELLOW+""+TextFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-25, StringUtil.DECIMAL_COLOR_WHITE); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java index 99f96dc5e..f7165ced5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java @@ -1,11 +1,11 @@ /* - * This file ("BlockCrystal.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockCrystal.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -24,7 +23,6 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -32,11 +30,11 @@ import java.util.List; public class BlockCrystal extends BlockBase{ - public static final TheCrystals[] allCrystals = TheCrystals.values(); - private static final PropertyInteger META = PropertyInteger.create("meta", 0, allCrystals.length-1); + public static final TheCrystals[] ALL_CRYSTALS = TheCrystals.values(); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, ALL_CRYSTALS.length-1); public BlockCrystal(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHardness(1.5F); this.setResistance(10.0F); this.setHarvestLevel("pickaxe", 1); @@ -47,33 +45,29 @@ public class BlockCrystal extends BlockBase{ return this.getMetaFromState(state); } - @SuppressWarnings("all") + @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allCrystals.length; j++){ + for(int j = 0; j < ALL_CRYSTALS.length; j++){ list.add(new ItemStack(item, 1, j)); } } @Override - public Class getItemBlock(){ - return TheItemBlock.class; + protected ItemBlockBase getItemBlock(){ + return new TheItemBlock(this); } @Override protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[allCrystals.length]; - for(int i = 0; i < allCrystals.length; i++){ - String name = this.getBaseName()+allCrystals[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + for(int i = 0; i < ALL_CRYSTALS.length; i++){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), META.getName()+"="+i); } - ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allCrystals.length ? EnumRarity.COMMON : allCrystals[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_CRYSTALS.length ? EnumRarity.COMMON : ALL_CRYSTALS[stack.getItemDamage()].rarity; } @Override @@ -89,9 +83,10 @@ public class BlockCrystal extends BlockBase{ this.setMaxDamage(0); } + @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allCrystals.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allCrystals[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_CRYSTALS[stack.getItemDamage()].name; } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java index bbc3db8cf..9f37f45b5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java @@ -1,11 +1,11 @@ /* - * This file ("BlockDirectionalBreaker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockDirectionalBreaker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,8 +15,8 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -25,8 +25,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockDirectionalBreaker extends BlockContainerBase{ @@ -34,20 +35,21 @@ public class BlockDirectionalBreaker extends BlockContainerBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); public BlockDirectionalBreaker(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityDirectionalBreaker(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(this.tryToggleRedstone(world, pos, player)){ return true; } @@ -68,8 +70,8 @@ public class BlockDirectionalBreaker extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal(); - PosUtil.setMetadata(pos, world, rotation, 2); + int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); + world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDisplayStand.java new file mode 100644 index 000000000..85d95d5c7 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDisplayStand.java @@ -0,0 +1,88 @@ +/* + * This file ("BlockDisplayStand.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityDisplayStand; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class BlockDisplayStand extends BlockContainerBase{ + + public BlockDisplayStand(String name){ + super(Material.ROCK, name); + + this.setHarvestLevel("pickaxe", 0); + this.setHardness(1.5F); + this.setResistance(10.0F); + this.setSoundType(SoundType.STONE); + } + + @Override + public TileEntity createNewTileEntity(World worldIn, int meta){ + return new TileEntityDisplayStand(); + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ + if(!world.isRemote){ + TileEntityDisplayStand stand = (TileEntityDisplayStand)world.getTileEntity(pos); + if(stand != null){ + ItemStack display = stand.getStackInSlot(0); + if(heldItem != null){ + if(display == null){ + ItemStack toPut = heldItem.copy(); + toPut.stackSize = 1; + stand.setInventorySlotContents(0, toPut); + player.inventory.decrStackSize(player.inventory.currentItem, 1); + return true; + } + } + else{ + if(display != null){ + player.inventory.setInventorySlotContents(player.inventory.currentItem, display.copy()); + stand.setInventorySlotContents(0, null); + return true; + } + } + } + return false; + } + else{ + return true; + } + } + + @Override + public boolean isOpaqueCube(IBlockState state){ + return false; + } + + @Override + public void breakBlock(World worldIn, BlockPos pos, IBlockState state){ + this.dropInventory(worldIn, pos); + super.breakBlock(worldIn, pos, state); + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.RARE; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java index 44d0e2c50..517c1134a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java @@ -1,11 +1,11 @@ /* - * This file ("BlockDropper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockDropper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,8 +14,8 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -24,8 +24,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockDropper extends BlockContainerBase{ @@ -33,20 +34,21 @@ public class BlockDropper extends BlockContainerBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); public BlockDropper(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityDropper(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(this.tryToggleRedstone(world, pos, player)){ return true; } @@ -67,8 +69,8 @@ public class BlockDropper extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal(); - PosUtil.setMetadata(pos, world, rotation, 2); + int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); + world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockEnergizer.java index f778ebd5a..8be3a2da6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockEnergizer.java @@ -1,11 +1,11 @@ /* - * This file ("BlockEnergizer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockEnergizer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,36 +15,39 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockEnergizer extends BlockContainerBase{ - private boolean isEnergizer; + private final boolean isEnergizer; public BlockEnergizer(boolean isEnergizer, String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.isEnergizer = isEnergizer; this.setHarvestLevel("pickaxe", 0); this.setHardness(2.0F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return this.isEnergizer ? new TileEntityEnergizer() : new TileEntityEnervator(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ if(this.isEnergizer){ TileEntityEnergizer energizer = (TileEntityEnergizer)world.getTileEntity(pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFeeder.java index a65c7b701..b1e5c1765 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFeeder.java @@ -1,11 +1,11 @@ /* - * This file ("BlockFeeder.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockFeeder.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,33 +14,36 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockFeeder extends BlockContainerBase{ public BlockFeeder(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(0.5F); this.setResistance(6.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFeeder(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityFeeder feeder = (TileEntityFeeder)world.getTileEntity(pos); if(feeder != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFermentingBarrel.java index b7c5922e1..b945d1462 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFermentingBarrel.java @@ -1,11 +1,11 @@ /* - * This file ("BlockFermentingBarrel.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockFermentingBarrel.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,26 +14,29 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockFermentingBarrel extends BlockContainerBase{ public BlockFermentingBarrel(String name){ - super(Material.wood, name); + super(Material.WOOD, name); this.setHarvestLevel("axe", 0); this.setHardness(0.5F); this.setResistance(5.0F); - this.setStepSound(soundTypeWood); + this.setSoundType(SoundType.WOOD); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFermentingBarrel(); @@ -46,11 +49,13 @@ public class BlockFermentingBarrel extends BlockContainerBase{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityFermentingBarrel press = (TileEntityFermentingBarrel)world.getTileEntity(pos); if(press != null){ - player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FERMENTING_BARREL.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + if(this.checkFailUseItemOnTank(player, heldItem, press.canolaTank) && this.checkFailUseItemOnTank(player, heldItem, press.oilTank)){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FERMENTING_BARREL.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + } } return true; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFireworkBox.java index 0b53d74b7..240fac039 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFireworkBox.java @@ -1,11 +1,11 @@ /* - * This file ("BlockFireworkBox.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockFireworkBox.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -13,33 +13,36 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFireworkBox; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockFireworkBox extends BlockContainerBase{ public BlockFireworkBox(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFireworkBox(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ return this.tryToggleRedstone(world, pos, player); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java index e1edeea3b..25640345d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFishingNet.java @@ -1,46 +1,58 @@ /* - * This file ("BlockFishingNet.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockFishingNet.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFishingNet; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockFishingNet extends BlockContainerBase{ + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 0.0625, 1); + public BlockFishingNet(String name){ - super(Material.wood, name); + super(Material.WOOD, name); this.setHarvestLevel("axe", 0); this.setHardness(0.5F); this.setResistance(3.0F); - this.setStepSound(soundTypeWood); - this.setBlockBounds(0F, 0F, 0F, 1F, 1F/16F, 1F); + this.setSoundType(SoundType.WOOD); } + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + return AABB; + } + + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFishingNet(); } @Override - public boolean isFullCube(){ + public boolean isFullCube(IBlockState state){ return false; } @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java index 431e0c54d..c6152b475 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java @@ -1,11 +1,11 @@ /* - * This file ("BlockFluidCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockFluidCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,8 +15,9 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidPlacer; import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -25,39 +26,43 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockFluidCollector extends BlockContainerBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); - private boolean isPlacer; + private final boolean isPlacer; public BlockFluidCollector(boolean isPlacer, String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.isPlacer = isPlacer; this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ - return this.isPlacer ? new TileEntityFluidCollector.TileEntityFluidPlacer() : new TileEntityFluidCollector(); + return this.isPlacer ? new TileEntityFluidPlacer() : new TileEntityFluidCollector(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(this.tryToggleRedstone(world, pos, player)){ return true; } if(!world.isRemote){ TileEntityFluidCollector collector = (TileEntityFluidCollector)world.getTileEntity(pos); if(collector != null){ - player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FLUID_COLLECTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + if(this.checkFailUseItemOnTank(player, stack, collector.tank)){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FLUID_COLLECTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + } } return true; } @@ -71,8 +76,8 @@ public class BlockFluidCollector extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal(); - PosUtil.setMetadata(pos, world, rotation, 2); + int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); + world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java index 815b9fe56..f28fdb5ae 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceDouble.java @@ -1,11 +1,11 @@ /* - * This file ("BlockFurnaceDouble.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockFurnaceDouble.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -24,10 +24,11 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.EnumParticleTypes; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -40,14 +41,15 @@ public class BlockFurnaceDouble extends BlockContainerBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 7); public BlockFurnaceDouble(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); this.setTickRandomly(true); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFurnaceDouble(); @@ -55,8 +57,8 @@ public class BlockFurnaceDouble extends BlockContainerBase{ @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ - int meta = PosUtil.getMetadata(pos, world); + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){ + int meta = this.getMetaFromState(state); if(meta > 3){ float f = (float)pos.getX()+0.5F; @@ -89,7 +91,7 @@ public class BlockFurnaceDouble extends BlockContainerBase{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(pos); if(furnace != null){ @@ -101,8 +103,8 @@ public class BlockFurnaceDouble extends BlockContainerBase{ } @Override - public int getLightValue(IBlockAccess world, BlockPos pos){ - return PosUtil.getMetadata(pos, world) > 3 ? 12 : 0; + public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos){ + return this.getMetaFromState(state) > 3 ? 12 : 0; } @Override @@ -115,16 +117,16 @@ public class BlockFurnaceDouble extends BlockContainerBase{ int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; if(rotation == 0){ - PosUtil.setMetadata(pos, world, 0, 2); + world.setBlockState(pos, this.getStateFromMeta(0), 2); } if(rotation == 1){ - PosUtil.setMetadata(pos, world, 3, 2); + world.setBlockState(pos, this.getStateFromMeta(3), 2); } if(rotation == 2){ - PosUtil.setMetadata(pos, world, 1, 2); + world.setBlockState(pos, this.getStateFromMeta(1), 2); } if(rotation == 3){ - PosUtil.setMetadata(pos, world, 2, 2); + world.setBlockState(pos, this.getStateFromMeta(2), 2); } super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java index 391bf1903..587a52f97 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFurnaceSolar.java @@ -1,46 +1,58 @@ /* - * This file ("BlockFurnaceSolar.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockFurnaceSolar.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceSolar; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockFurnaceSolar extends BlockContainerBase{ + private static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 1, 6*0.0625, 1); + public BlockFurnaceSolar(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); - this.setBlockBounds(0F, 0F, 0F, 1F, 6F/16F, 1F); + this.setSoundType(SoundType.STONE); } + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + return AABB; + } + + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFurnaceSolar(); } @Override - public boolean isFullCube(){ + public boolean isFullCube(IBlockState state){ return false; } @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGeneric.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGeneric.java index a1a584a64..43582bdd6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGeneric.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGeneric.java @@ -1,16 +1,17 @@ /* - * This file ("BlockGeneric.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockGeneric.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; @@ -18,11 +19,15 @@ import net.minecraft.item.ItemStack; public class BlockGeneric extends BlockBase{ public BlockGeneric(String name){ - super(Material.rock, name); - this.setHarvestLevel("pickaxe", 0); - this.setHardness(1.5F); - this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this(name, Material.ROCK, SoundType.STONE, 1.5F, 10.0F, "pickaxe", 0); + } + + public BlockGeneric(String name, Material material, SoundType sound, float hardness, float resistance, String harvestTool, int harvestLevel){ + super(material, name); + this.setHarvestLevel(harvestTool, harvestLevel); + this.setHardness(hardness); + this.setResistance(resistance); + this.setSoundType(sound); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGiantChest.java index 0794f9d29..a2f76b152 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGiantChest.java @@ -1,21 +1,26 @@ /* - * This file ("BlockGiantChest.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockGiantChest.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChestLarge; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChestMedium; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -25,30 +30,42 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import java.util.ArrayList; +import java.util.List; public class BlockGiantChest extends BlockContainerBase{ - public BlockGiantChest(String name){ - super(Material.wood, name); + public final int type; + + public BlockGiantChest(String name, int type){ + super(Material.WOOD, name); + this.type = type; + this.setHarvestLevel("axe", 0); this.setHardness(0.5F); this.setResistance(15.0F); - this.setStepSound(soundTypeWood); + this.setSoundType(SoundType.WOOD); + } @Override public TileEntity createNewTileEntity(World world, int par2){ - return new TileEntityGiantChest(); + switch(this.type){ + case 1: return new TileEntityGiantChestMedium(); + case 2: return new TileEntityGiantChestLarge(); + default: return new TileEntityGiantChest(); + } } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityGiantChest chest = (TileEntityGiantChest)world.getTileEntity(pos); if(chest != null){ @@ -73,7 +90,10 @@ public class BlockGiantChest extends BlockContainerBase{ ItemStack[] slots = ((TileEntityGiantChest)tile).slots; for(int i = 0; i < list.tagCount(); i++){ - slots[i] = ItemStack.loadItemStackFromNBT(list.getCompoundTagAt(i)); + NBTTagCompound compound = list.getCompoundTagAt(i); + if(compound != null && compound.hasKey("id")){ + slots[i] = ItemStack.loadItemStackFromNBT(list.getCompoundTagAt(i)); + } } } } @@ -81,6 +101,7 @@ public class BlockGiantChest extends BlockContainerBase{ super.onBlockPlacedBy(world, pos, state, entity, stack); } + @Override public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ ArrayList drops = super.getDrops(world, pos, state, fortune); @@ -94,9 +115,11 @@ public class BlockGiantChest extends BlockContainerBase{ for(int i = 0; i < slots.length; i++){ //Destroy the keeper if(i != place){ + NBTTagCompound compound = new NBTTagCompound(); if(slots[i] != null){ - list.appendTag(slots[i].writeToNBT(new NBTTagCompound())); + slots[i].writeToNBT(compound); } + list.appendTag(compound); } } @@ -126,4 +149,27 @@ public class BlockGiantChest extends BlockContainerBase{ super.breakBlock(world, pos, state); } + + @Override + protected ItemBlockBase getItemBlock(){ + return new TheItemBlock(this); + } + + public static class TheItemBlock extends ItemBlockBase{ + + public TheItemBlock(Block block){ + super(block); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced){ + int type = this.block instanceof BlockGiantChest ? ((BlockGiantChest)this.block).type : -1; + if(type == 2){ + tooltip.add(TextFormatting.ITALIC+"Supersolid"); + } + else if(type == 0){ + tooltip.add(TextFormatting.ITALIC+"'Small'"); + } + } + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java index b23451304..4070549d4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGreenhouseGlass.java @@ -1,11 +1,11 @@ /* - * This file ("BlockGreenhouseGlass.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockGreenhouseGlass.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -13,14 +13,15 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGreenhouseGlass; import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -29,36 +30,37 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockGreenhouseGlass extends BlockContainerBase{ public BlockGreenhouseGlass(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(0.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } @Override - public boolean isFullCube(){ + public boolean isFullCube(IBlockState state){ return false; } @Override @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){ - IBlockState state = worldIn.getBlockState(pos); - Block block = state.getBlock(); - return worldIn.getBlockState(pos.offset(side.getOpposite())) != state || block != this && block != this && super.shouldSideBeRendered(worldIn, pos, side); + public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side){ + IBlockState otherState = world.getBlockState(pos.offset(side)); + Block block = otherState.getBlock(); + + return state != otherState || block != this && super.shouldSideBeRendered(state, world, pos, side); } @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } @Override @SideOnly(Side.CLIENT) - public EnumWorldBlockLayer getBlockLayer(){ - return EnumWorldBlockLayer.CUTOUT; + public BlockRenderLayer getBlockLayer(){ + return BlockRenderLayer.CUTOUT; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java index bf4c3571b..773b4ea58 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockGrinder.java @@ -1,11 +1,11 @@ /* - * This file ("BlockGrinder.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockGrinder.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,7 +15,8 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinderDouble; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -23,9 +24,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -39,24 +41,25 @@ public class BlockGrinder extends BlockContainerBase{ private final boolean isDouble; public BlockGrinder(boolean isDouble, String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.isDouble = isDouble; this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); this.setTickRandomly(true); } + @Override public TileEntity createNewTileEntity(World world, int par2){ - return this.isDouble ? new TileEntityGrinder.TileEntityGrinderDouble() : new TileEntityGrinder(); + return this.isDouble ? new TileEntityGrinderDouble() : new TileEntityGrinder(); } @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ - int meta = PosUtil.getMetadata(pos, world); + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){ + int meta = this.getMetaFromState(state); if(meta == 1){ for(int i = 0; i < 5; i++){ @@ -69,7 +72,7 @@ public class BlockGrinder extends BlockContainerBase{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityGrinder grinder = (TileEntityGrinder)world.getTileEntity(pos); if(grinder != null){ @@ -81,8 +84,8 @@ public class BlockGrinder extends BlockContainerBase{ } @Override - public int getLightValue(IBlockAccess world, BlockPos pos){ - return PosUtil.getMetadata(pos, world) == 1 ? 12 : 0; + public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos){ + return this.getMetaFromState(state) == 1 ? 12 : 0; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockHeatCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockHeatCollector.java index cc02ddf0f..348478f9e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockHeatCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockHeatCollector.java @@ -1,17 +1,18 @@ /* - * This file ("BlockHeatCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockHeatCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityHeatCollector; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; @@ -21,13 +22,14 @@ import net.minecraft.world.World; public class BlockHeatCollector extends BlockContainerBase{ public BlockHeatCollector(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(2.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityHeatCollector(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockInputter.java index e33c2a118..e5b13e238 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockInputter.java @@ -1,11 +1,11 @@ /* - * This file ("BlockInputter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockInputter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -16,44 +16,48 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInputter; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityInputterAdvanced; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockInputter extends BlockContainerBase{ public static final int NAME_FLAVOR_AMOUNTS = 15; - public boolean isAdvanced; + public final boolean isAdvanced; public BlockInputter(boolean isAdvanced, String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); this.setTickRandomly(true); this.isAdvanced = isAdvanced; } + @Override public TileEntity createNewTileEntity(World world, int par2){ - return this.isAdvanced ? new TileEntityInputter.TileEntityInputterAdvanced() : new TileEntityInputter(); + return this.isAdvanced ? new TileEntityInputterAdvanced() : new TileEntityInputter(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(pos); if(inputter != null){ @@ -77,8 +81,8 @@ public class BlockInputter extends BlockContainerBase{ } @Override - public Class getItemBlock(){ - return TheItemBlock.class; + protected ItemBlockBase getItemBlock(){ + return new TheItemBlock(this); } @Override @@ -86,6 +90,16 @@ public class BlockInputter extends BlockContainerBase{ return EnumRarity.EPIC; } + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block){ + if(!world.isRemote){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityInputter){ + ((TileEntityInputter)tile).initVars(); + } + } + } + public static class TheItemBlock extends ItemBlockBase{ private long lastSysTime; @@ -97,6 +111,7 @@ public class BlockInputter extends BlockContainerBase{ this.setMaxDamage(0); } + @Override public String getUnlocalizedName(ItemStack stack){ return this.getUnlocalizedName(); @@ -107,6 +122,7 @@ public class BlockInputter extends BlockContainerBase{ return damage; } + @Override public String getItemStackDisplayName(ItemStack stack){ long sysTime = System.currentTimeMillis(); @@ -116,7 +132,7 @@ public class BlockInputter extends BlockContainerBase{ this.toPick = Util.RANDOM.nextInt(NAME_FLAVOR_AMOUNTS)+1; } - return StringUtil.localize(this.getUnlocalizedName()+".name")+" ("+StringUtil.localize("tile."+ModUtil.MOD_ID_LOWER+".blockInputter.add."+this.toPick+".name")+")"; + return StringUtil.localize(this.getUnlocalizedName()+".name")+" ("+StringUtil.localize("tile."+ModUtil.MOD_ID+".blockInputter.add."+this.toPick+".name")+")"; } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemRepairer.java index 18f1baee6..0aefdaf7d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemRepairer.java @@ -1,11 +1,11 @@ /* - * This file ("BlockItemRepairer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockItemRepairer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,36 +15,38 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockItemRepairer extends BlockContainerBase{ public BlockItemRepairer(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(20.0F); this.setResistance(15.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); this.setTickRandomly(true); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityItemRepairer(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityItemRepairer repairer = (TileEntityItemRepairer)world.getTileEntity(pos); if(repairer != null){ @@ -56,8 +58,8 @@ public class BlockItemRepairer extends BlockContainerBase{ } @Override - public int getLightValue(IBlockAccess world, BlockPos pos){ - return PosUtil.getMetadata(pos, world) == 1 ? 12 : 0; + public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos){ + return this.getMetaFromState(state) == 1 ? 12 : 0; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java new file mode 100644 index 000000000..f6224fb32 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java @@ -0,0 +1,55 @@ +/* + * This file ("BlockItemViewer.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class BlockItemViewer extends BlockContainerBase{ + + public BlockItemViewer(String name){ + super(Material.ROCK, name); + this.setHarvestLevel("pickaxe", 0); + this.setHardness(1.5F); + this.setResistance(10.0F); + this.setSoundType(SoundType.STONE); + } + + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block){ + if(!world.isRemote){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityItemViewer){ + ((TileEntityItemViewer)tile).saveConnectedRelay(); + } + } + } + + @Override + public TileEntity createNewTileEntity(World worldIn, int meta){ + return new TileEntityItemViewer(); + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.RARE; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java index 73b9d2f89..3f36b7f38 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java @@ -1,28 +1,28 @@ /* - * This file ("BlockLampPowerer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockLampPowerer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockLampPowerer extends BlockBase{ @@ -30,16 +30,16 @@ public class BlockLampPowerer extends BlockBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); public BlockLampPowerer(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } @Override - public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock){ - this.updateLamp(world, pos); + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn){ + this.updateLamp(worldIn, pos); } @Override @@ -49,24 +49,27 @@ public class BlockLampPowerer extends BlockBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = BlockPistonBase.getFacingFromEntity(world, pos, player).ordinal(); - PosUtil.setMetadata(pos, world, rotation, 2); + int rotation = BlockPistonBase.getFacingFromEntity(pos, player).ordinal(); + world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); } private void updateLamp(World world, BlockPos pos){ if(!world.isRemote){ - BlockPos coords = WorldUtil.getCoordsFromSide(WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(pos, world)), pos, 0); - if(coords != null && PosUtil.getBlock(coords, world) instanceof BlockColoredLamp){ + IBlockState state = world.getBlockState(pos); + BlockPos coords = pos.offset(WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state))); + IBlockState coordsState = world.getBlockState(coords); + if(coordsState.getBlock() instanceof BlockColoredLamp){ + int meta = coordsState.getBlock().getMetaFromState(coordsState); if(world.isBlockIndirectlyGettingPowered(pos) > 0){ - if(!((BlockColoredLamp)PosUtil.getBlock(coords, world)).isOn){ - PosUtil.setBlock(coords, world, InitBlocks.blockColoredLampOn, PosUtil.getMetadata(coords, world), 2); + if(!((BlockColoredLamp)coordsState.getBlock()).isOn){ + world.setBlockState(coords, InitBlocks.blockColoredLampOn.getStateFromMeta(meta), 2); } } else{ - if(((BlockColoredLamp)PosUtil.getBlock(coords, world)).isOn){ - PosUtil.setBlock(coords, world, InitBlocks.blockColoredLamp, PosUtil.getMetadata(coords, world), 2); + if(((BlockColoredLamp)coordsState.getBlock()).isOn){ + world.setBlockState(coords, InitBlocks.blockColoredLamp.getStateFromMeta(meta), 2); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java index 2b02cccb3..0e654d4ef 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -1,92 +1,97 @@ /* - * This file ("BlockLaserRelay.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockLaserRelay.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergy; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItem; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import java.util.List; - public class BlockLaserRelay extends BlockContainerBase{ - private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); + //This took way too much fiddling around. I'm not good with numbers. + private static final float F = 1/16F; + private static final AxisAlignedBB AABB_UP = new AxisAlignedBB(2*F, 0, 2*F, 1-2*F, 1-F, 1-2*F); + private static final AxisAlignedBB AABB_DOWN = new AxisAlignedBB(2*F, F, 2*F, 1-2*F, 1, 1-2*F); + private static final AxisAlignedBB AABB_NORTH = new AxisAlignedBB(2*F, F, F, 1-2*F, 1-F, 1); + private static final AxisAlignedBB AABB_EAST = new AxisAlignedBB(0, F, 2*F, 1-F, 1-F, 1-2*F); + private static final AxisAlignedBB AABB_SOUTH = new AxisAlignedBB(2*F, F, 0, 1-2*F, 1-F, 1-F); + private static final AxisAlignedBB AABB_WEST = new AxisAlignedBB(F, F, 2*F, 1, 1-F, 1-2*F); - public BlockLaserRelay(String name){ - super(Material.rock, name); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); + private final Type type; + + public BlockLaserRelay(String name, Type type){ + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); + + this.type = type; } @Override - public boolean isFullCube(){ + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + switch(this.getMetaFromState(state)){ + case 1: + return AABB_UP; + case 2: + return AABB_NORTH; + case 3: + return AABB_SOUTH; + case 4: + return AABB_WEST; + case 5: + return AABB_EAST; + default: + return AABB_DOWN; + } + } + + @Override + public boolean isFullCube(IBlockState state){ return false; } @Override - public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ - this.setBlockBoundsBasedOnState(world, pos); - super.addCollisionBoxesToList(world, pos, state, axis, list, entity); - } - - @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } + @Override public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, int meta, EntityLivingBase base){ return this.getStateFromMeta(side.ordinal()); } - @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){ - int meta = PosUtil.getMetadata(pos, world); - - float pixel = 1F/16F; - if(meta == 0){ - this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F-3*pixel, 1F, 1F-3*pixel); - } - else if(meta == 1){ - this.setBlockBounds(3*pixel, 0F, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel); - } - else if(meta == 2){ - this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F); - } - else if(meta == 3){ - this.setBlockBounds(3*pixel, 3*pixel, 0F, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel); - } - else if(meta == 4){ - this.setBlockBounds(3*pixel, 3*pixel, 3*pixel, 1F, 1F-3*pixel, 1F-3*pixel); - } - else if(meta == 5){ - this.setBlockBounds(0F, 3*pixel, 3*pixel, 1F-3*pixel, 1F-3*pixel, 1F-3*pixel); - } - } - @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; @@ -97,8 +102,45 @@ public class BlockLaserRelay extends BlockContainerBase{ return META; } + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ + if(player.isSneaking()){ + TileEntityLaserRelay relay = (TileEntityLaserRelay)world.getTileEntity(pos); + if(relay instanceof TileEntityLaserRelayItemWhitelist){ + if(!world.isRemote){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.LASER_RELAY_ITEM_WHITELIST.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + } + return true; + } + } + return false; + } + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block){ + if(!world.isRemote){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityLaserRelay){ + ((TileEntityLaserRelay)tile).saveAllHandlersAround(); + } + } + } + @Override public TileEntity createNewTileEntity(World world, int i){ - return new TileEntityLaserRelay(); + switch(this.type){ + case ITEM: + return new TileEntityLaserRelayItem(); + case ITEM_WHITELIST: + return new TileEntityLaserRelayItemWhitelist(); + default: + return new TileEntityLaserRelayEnergy(); + } + } + + public enum Type{ + ENERGY, + ITEM, + ITEM_WHITELIST } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java index 6788bc528..ac9f4bb47 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java @@ -1,11 +1,11 @@ /* - * This file ("BlockLavaFactoryController.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockLavaFactoryController.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; @@ -22,7 +23,7 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.profiler.Profiler; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -30,13 +31,14 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockLavaFactoryController extends BlockContainerBase implements IHudDisplay{ public BlockLavaFactoryController(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(4.5F); this.setResistance(20.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityLavaFactoryController(); @@ -49,15 +51,15 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IH @Override @SideOnly(Side.CLIENT) - public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){ + public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){ TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController)minecraft.theWorld.getTileEntity(posHit.getBlockPos()); if(factory != null){ int state = factory.isMultiblock(); if(state == TileEntityLavaFactoryController.NOT_MULTI){ - StringUtil.drawSplitString(minecraft.fontRendererObj, StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".factory.notPart.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+5, 200, StringUtil.DECIMAL_COLOR_WHITE, true); + StringUtil.drawSplitString(minecraft.fontRendererObj, StringUtil.localize("tooltip."+ModUtil.MOD_ID+".factory.notPart.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+5, 200, StringUtil.DECIMAL_COLOR_WHITE, true); } else if(state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA){ - StringUtil.drawSplitString(minecraft.fontRendererObj, StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".factory.works.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+5, 200, StringUtil.DECIMAL_COLOR_WHITE, true); + StringUtil.drawSplitString(minecraft.fontRendererObj, StringUtil.localize("tooltip."+ModUtil.MOD_ID+".factory.works.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+5, 200, StringUtil.DECIMAL_COLOR_WHITE, true); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLeafGenerator.java index 66214b816..ffe2ac44d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLeafGenerator.java @@ -1,35 +1,37 @@ /* - * This file ("BlockLeafGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockLeafGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLeafGenerator; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockLeafGenerator extends BlockContainerBase{ public BlockLeafGenerator(String name){ - super(Material.iron, name); + super(Material.IRON, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(5.0F); this.setResistance(10.0F); - this.setStepSound(soundTypeMetal); + this.setSoundType(SoundType.METAL); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityLeafGenerator(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java index 8b66b8363..cfed5206d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java @@ -1,11 +1,11 @@ /* - * This file ("BlockMiner.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockMiner.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -25,9 +26,10 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.profiler.Profiler; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -35,20 +37,20 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockMiner extends BlockContainerBase implements IHudDisplay{ public BlockMiner(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(8F); this.setResistance(30F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntity tile = world.getTileEntity(pos); if(tile instanceof TileEntityMiner){ @@ -63,6 +65,7 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay{ return EnumRarity.RARE; } + @Override public TileEntity createNewTileEntity(World world, int i){ return new TileEntityMiner(); @@ -76,7 +79,7 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay{ @Override @SideOnly(Side.CLIENT) - public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){ + public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){ TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); if(tile instanceof TileEntityMiner){ String info = ((TileEntityMiner)tile).layerAt <= 0 ? "Done Mining!" : "Mining at Y = "+((TileEntityMiner)tile).layerAt+"."; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java index a9aa228cb..b535656bb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java @@ -1,11 +1,11 @@ /* - * This file ("BlockMisc.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockMisc.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -24,7 +23,6 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -32,11 +30,11 @@ import java.util.List; public class BlockMisc extends BlockBase{ - public static final TheMiscBlocks[] allMiscBlocks = TheMiscBlocks.values(); - private static final PropertyInteger META = PropertyInteger.create("meta", 0, allMiscBlocks.length-1); + public static final TheMiscBlocks[] ALL_MISC_BLOCKS = TheMiscBlocks.values(); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, ALL_MISC_BLOCKS.length-1); public BlockMisc(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHardness(1.5F); this.setResistance(10.0F); this.setHarvestLevel("pickaxe", 1); @@ -47,33 +45,29 @@ public class BlockMisc extends BlockBase{ return this.getMetaFromState(state); } - @SuppressWarnings("all") + @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allMiscBlocks.length; j++){ + for(int j = 0; j < ALL_MISC_BLOCKS.length; j++){ list.add(new ItemStack(item, 1, j)); } } @Override - public Class getItemBlock(){ - return TheItemBlock.class; + protected ItemBlockBase getItemBlock(){ + return new TheItemBlock(this); } @Override protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[allMiscBlocks.length]; - for(int i = 0; i < allMiscBlocks.length; i++){ - String name = this.getBaseName()+allMiscBlocks[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + for(int i = 0; i < ALL_MISC_BLOCKS.length; i++){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), META.getName()+"="+i); } - ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allMiscBlocks.length ? EnumRarity.COMMON : allMiscBlocks[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_MISC_BLOCKS.length ? EnumRarity.COMMON : ALL_MISC_BLOCKS[stack.getItemDamage()].rarity; } @Override @@ -89,9 +83,10 @@ public class BlockMisc extends BlockBase{ this.setMaxDamage(0); } + @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allMiscBlocks.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allMiscBlocks[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_MISC_BLOCKS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_MISC_BLOCKS[stack.getItemDamage()].name; } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java index 8b72114ef..de01e8298 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java @@ -1,11 +1,11 @@ /* - * This file ("BlockOilGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockOilGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -16,17 +16,17 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -35,17 +35,16 @@ import java.util.Random; public class BlockOilGenerator extends BlockContainerBase{ - private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1); - public BlockOilGenerator(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); this.setTickRandomly(true); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityOilGenerator(); @@ -53,20 +52,25 @@ public class BlockOilGenerator extends BlockContainerBase{ @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ - if(PosUtil.getMetadata(pos, world) == 1){ - for(int i = 0; i < 5; i++){ - world.spawnParticle(ClientProxy.bulletForMyValentine ? EnumParticleTypes.HEART : EnumParticleTypes.SMOKE_NORMAL, (double)pos.getX()+0.5F, (double)pos.getY()+1.0F, (double)pos.getZ()+0.5F, 0.0D, 0.0D, 0.0D); + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityOilGenerator){ + if(((TileEntityOilGenerator)tile).currentBurnTime > 0){ + for(int i = 0; i < 5; i++){ + world.spawnParticle(ClientProxy.bulletForMyValentine ? EnumParticleTypes.HEART : EnumParticleTypes.SMOKE_NORMAL, (double)pos.getX()+0.5F, (double)pos.getY()+1.0F, (double)pos.getZ()+0.5F, 0.0D, 0.0D, 0.0D); + } } } } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(pos); if(generator != null){ - player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.OIL_GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + if(this.checkFailUseItemOnTank(player, stack, generator.tank)){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.OIL_GENERATOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); + } } return true; } @@ -78,11 +82,6 @@ public class BlockOilGenerator extends BlockContainerBase{ return EnumRarity.RARE; } - @Override - protected PropertyInteger getMetaProperty(){ - return META; - } - @Override public void breakBlock(World world, BlockPos pos, IBlockState state){ this.dropInventory(world, pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java index d5234313e..92f036abf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java @@ -1,11 +1,11 @@ /* - * This file ("BlockPhantom.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockPhantom.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,8 +15,9 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.*; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -27,30 +28,55 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.profiler.Profiler; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class BlockPhantom extends BlockContainerBase implements IHudDisplay{ - public Type type; - public int range; + public final Type type; public BlockPhantom(Type type, String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.type = type; this.setHarvestLevel("pickaxe", 0); this.setHardness(4.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); + } - if(type == Type.FACE || type == Type.LIQUIFACE || type == Type.ENERGYFACE){ - this.range = TileEntityPhantomface.RANGE; + @Override + public boolean canProvidePower(IBlockState state){ + return this.type == Type.REDSTONEFACE; + } + + @Override + public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side){ + if(this.type == Type.REDSTONEFACE){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityPhantomRedstoneface){ + return ((TileEntityPhantomRedstoneface)tile).providesWeak[side.ordinal()]; + } } - else if(type == Type.BREAKER || type == Type.PLACER){ - this.range = TileEntityPhantomPlacer.RANGE; + return super.getWeakPower(state, world, pos, side); + } + + @Override + public int getStrongPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side){ + if(this.type == Type.REDSTONEFACE){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityPhantomRedstoneface){ + return ((TileEntityPhantomRedstoneface)tile).providesStrong[side.ordinal()]; + } } + return super.getStrongPower(state, world, pos, side); } @Override @@ -61,24 +87,27 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay{ super.breakBlock(world, pos, state); } + @Override public TileEntity createNewTileEntity(World world, int par2){ switch(this.type){ case PLACER: return new TileEntityPhantomPlacer(); case BREAKER: - return new TileEntityPhantomPlacer.TileEntityPhantomBreaker(); + return new TileEntityPhantomBreaker(); case LIQUIFACE: return new TileEntityPhantomLiquiface(); case ENERGYFACE: return new TileEntityPhantomEnergyface(); + case REDSTONEFACE: + return new TileEntityPhantomRedstoneface(); default: return new TileEntityPhantomItemface(); } } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ){ if(this.tryToggleRedstone(world, pos, player)){ return true; } @@ -98,27 +127,29 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay{ @Override @SideOnly(Side.CLIENT) - public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){ + public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){ TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); if(tile != null){ if(tile instanceof IPhantomTile){ IPhantomTile phantom = (IPhantomTile)tile; - minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.GOLD+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc")+": "+phantom.getRange(), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-40, StringUtil.DECIMAL_COLOR_WHITE); + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.GOLD+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".blockPhantomRange.desc")+": "+phantom.getRange(), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-40, StringUtil.DECIMAL_COLOR_WHITE); if(phantom.hasBoundPosition()){ - int distance = (int)new Vec3(posHit.getBlockPos()).distanceTo(new Vec3(phantom.getBoundPosition())); - Item item = PosUtil.getItemBlock(phantom.getBoundPosition(), minecraft.theWorld); - String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(PosUtil.getBlock(phantom.getBoundPosition(), minecraft.theWorld), 1, PosUtil.getMetadata(phantom.getBoundPosition(), minecraft.theWorld))); - StringUtil.drawSplitString(minecraft.fontRendererObj, StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-30, 200, StringUtil.DECIMAL_COLOR_WHITE, true); + int distance = (int)new Vec3d(posHit.getBlockPos()).distanceTo(new Vec3d(phantom.getBoundPosition())); + IBlockState state = minecraft.theWorld.getBlockState(phantom.getBoundPosition()); + Block block = state.getBlock(); + Item item = Item.getItemFromBlock(block); + String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(block, 1, block.getMetaFromState(state))); + StringUtil.drawSplitString(minecraft.fontRendererObj, StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID+".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-30, 200, StringUtil.DECIMAL_COLOR_WHITE, true); if(phantom.isBoundThingInRange()){ - StringUtil.drawSplitString(minecraft.fontRendererObj, EnumChatFormatting.DARK_GREEN+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, 200, StringUtil.DECIMAL_COLOR_WHITE, true); + StringUtil.drawSplitString(minecraft.fontRendererObj, TextFormatting.DARK_GREEN+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".phantom.connectedRange.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, 200, StringUtil.DECIMAL_COLOR_WHITE, true); } else{ - StringUtil.drawSplitString(minecraft.fontRendererObj, EnumChatFormatting.DARK_RED+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, 200, StringUtil.DECIMAL_COLOR_WHITE, true); + StringUtil.drawSplitString(minecraft.fontRendererObj, TextFormatting.DARK_RED+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".phantom.connectedNoRange.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, 200, StringUtil.DECIMAL_COLOR_WHITE, true); } } else{ - minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.RED+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, StringUtil.DECIMAL_COLOR_WHITE); + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.RED+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".phantom.notConnected.desc"), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2+25, StringUtil.DECIMAL_COLOR_WHITE); } } } @@ -129,6 +160,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay{ PLACER, BREAKER, LIQUIFACE, - ENERGYFACE + ENERGYFACE, + REDSTONEFACE } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java index eef04cd9d..e78749fae 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantomBooster.java @@ -1,43 +1,52 @@ /* - * This file ("BlockPhantomBooster.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockPhantomBooster.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomBooster; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockPhantomBooster extends BlockContainerBase{ + private static final AxisAlignedBB AABB = new AxisAlignedBB(2*0.0625, 0, 2*0.0625, 1-2*0.0625, 1, 1-2*0.0625); + public BlockPhantomBooster(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); - - float f = 1F/16F; - this.setBlockBounds(2*f, 0F, 2*f, 1-2*f, 1F, 1-2*f); + this.setSoundType(SoundType.STONE); } @Override - public boolean isFullCube(){ + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + return AABB; + } + + @Override + public boolean isFullCube(IBlockState state){ return false; } @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } @@ -46,6 +55,7 @@ public class BlockPhantomBooster extends BlockContainerBase{ return EnumRarity.EPIC; } + @Override public TileEntity createNewTileEntity(World world, int i){ return new TileEntityPhantomBooster(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java new file mode 100644 index 000000000..2985b692c --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java @@ -0,0 +1,58 @@ +/* + * This file ("BlockPlayerInterface.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlayerInterface; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class BlockPlayerInterface extends BlockContainerBase{ + + public BlockPlayerInterface(String name){ + super(Material.ROCK, name); + this.setHarvestLevel("pickaxe", 0); + this.setHardness(4.5F); + this.setResistance(10.0F); + this.setSoundType(SoundType.STONE); + } + + @Override + public TileEntity createNewTileEntity(World world, int par2){ + return new TileEntityPlayerInterface(); + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.EPIC; + } + + @Override + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ + TileEntity tile = world.getTileEntity(pos); + if(tile != null && tile instanceof TileEntityPlayerInterface){ + TileEntityPlayerInterface face = (TileEntityPlayerInterface)tile; + if(face.connectedPlayer == null){ + face.connectedPlayer = player.getUniqueID(); + face.markDirty(); + } + } + + super.onBlockPlacedBy(world, pos, state, player, stack); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockRangedCollector.java index 6d608829a..f8c58bcb4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockRangedCollector.java @@ -1,11 +1,11 @@ /* - * This file ("BlockRangedCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockRangedCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,33 +14,36 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockRangedCollector extends BlockContainerBase{ public BlockRangedCollector(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityRangedCollector(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityRangedCollector breaker = (TileEntityRangedCollector)world.getTileEntity(pos); if(breaker != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java new file mode 100644 index 000000000..8b7c110f8 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockShockSuppressor.java @@ -0,0 +1,108 @@ +/* + * This file ("BlockShockSuppressor.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityShockSuppressor; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.ExplosionEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class BlockShockSuppressor extends BlockContainerBase{ + + public BlockShockSuppressor(String name){ + super(Material.ROCK, name); + this.setHarvestLevel("pickaxe", 0); + this.setHardness(20.0F); + this.setResistance(2000.0F); + this.setSoundType(SoundType.STONE); + + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onExplosion(ExplosionEvent.Detonate event){ + World world = event.getWorld(); + if(!world.isRemote){ + List affectedBlocks = event.getAffectedBlocks(); + List affectedEntities = event.getAffectedEntities(); + + int rangeSq = TileEntityShockSuppressor.RANGE*TileEntityShockSuppressor.RANGE; + int use = TileEntityShockSuppressor.USE_PER; + + for(TileEntityShockSuppressor suppressor : TileEntityShockSuppressor.SUPPRESSORS){ + if(!suppressor.isRedstonePowered){ + BlockPos supPos = suppressor.getPos(); + + List entitiesToRemove = new ArrayList(); + List posesToRemove = new ArrayList(); + + for(BlockPos pos : affectedBlocks){ + if(pos.distanceSq(supPos) <= rangeSq){ + posesToRemove.add(pos); + } + } + for(Entity entity : affectedEntities){ + if(entity.getPositionVector().squareDistanceTo(supPos.getX(), supPos.getY(), supPos.getZ()) <= rangeSq){ + entitiesToRemove.add(entity); + } + } + + Collections.shuffle(entitiesToRemove); + Collections.shuffle(posesToRemove); + + for(BlockPos pos : posesToRemove){ + if(suppressor.storage.getEnergyStored() >= use){ + suppressor.storage.extractEnergy(use, false); + affectedBlocks.remove(pos); + } + else{ + break; + } + } + for(Entity entity : entitiesToRemove){ + if(suppressor.storage.getEnergyStored() >= use){ + suppressor.storage.extractEnergy(use, false); + affectedEntities.remove(entity); + } + else{ + break; + } + } + } + } + } + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.RARE; + } + + @Override + public TileEntity createNewTileEntity(World worldIn, int meta){ + return new TileEntityShockSuppressor(); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java index 4bc6355c8..95d1ae4a1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java @@ -1,74 +1,63 @@ /* - * This file ("BlockSlabs.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockSlabs.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; - -import java.util.List; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class BlockSlabs extends BlockBase{ + private static final AxisAlignedBB AABB_BOTTOM_HALF = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.5D, 1.0D); + private static final AxisAlignedBB AABB_TOP_HALF = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 1.0D, 1.0D, 1.0D); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1); - private Block fullBlock; - private int meta; + private final Block fullBlock; + private final int meta; public BlockSlabs(String name, Block fullBlock){ this(name, fullBlock, 0); } public BlockSlabs(String name, Block fullBlock, int meta){ - super(fullBlock.getMaterial(), name); + super(fullBlock.getMaterial(fullBlock.getDefaultState()), name); this.setHardness(1.5F); this.setResistance(10.0F); this.fullBlock = fullBlock; this.meta = meta; } - @Override + /*@Override public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ this.setBlockBoundsBasedOnState(world, pos); super.addCollisionBoxesToList(world, pos, state, axis, list, entity); } - @Override - public boolean isOpaqueCube(){ - return false; - } - - @Override - public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer){ - if(facing.ordinal() == 1){ - return this.getStateFromMeta(meta); - } - if(facing.ordinal() == 0 || hitY >= 0.5F){ - return this.getStateFromMeta(meta+1); - } - return this.getStateFromMeta(meta); - } - @Override public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){ int meta = PosUtil.getMetadata(pos, world); @@ -80,11 +69,33 @@ public class BlockSlabs extends BlockBase{ @Override public void setBlockBoundsForItemRender(){ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + }*/ + + @Override + public boolean isOpaqueCube(IBlockState state){ + return false; + } + + + @Override + public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer){ + if(facing.ordinal() == 1){ + return this.getStateFromMeta(meta); + } + if(facing.ordinal() == 0 || hitY >= 0.5F){ + return this.getStateFromMeta(meta+1); + } + return this.getStateFromMeta(meta); } @Override - public Class getItemBlock(){ - return TheItemBlock.class; + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + return state.getValue(META) == 1 ? AABB_TOP_HALF : AABB_BOTTOM_HALF; + } + + @Override + protected ItemBlockBase getItemBlock(){ + return new TheItemBlock(this); } @Override @@ -106,17 +117,68 @@ public class BlockSlabs extends BlockBase{ } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ){ - if(PosUtil.getBlock(pos, world) == this.block && ((side.ordinal() == 1 && PosUtil.getMetadata(pos, world) == 0) || (side.ordinal() == 0 && PosUtil.getMetadata(pos, world) == 1))){ - if(PosUtil.setBlock(pos, world, ((BlockSlabs)this.block).fullBlock, ((BlockSlabs)this.block).meta, 3)){ - world.playSoundEffect(pos.getX()+0.5F, pos.getY()+0.5F, pos.getZ()+0.5F, this.block.stepSound.getBreakSound(), (this.block.stepSound.getVolume()+1.0F)/2.0F, this.block.stepSound.frequency*0.8F); - stack.stackSize--; + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ + if(stack.stackSize != 0 && playerIn.canPlayerEdit(pos.offset(facing), facing, stack)){ + IBlockState state = worldIn.getBlockState(pos); + + if(state.getBlock() == this.block){ + BlockSlabs theBlock = (BlockSlabs)this.block; + if((facing == EnumFacing.UP && state.getValue(META) == 0 || facing == EnumFacing.DOWN && state.getValue(META) == 1)){ + IBlockState newState = theBlock.fullBlock.getStateFromMeta(theBlock.meta); + AxisAlignedBB bound = newState.getCollisionBoundingBox(worldIn, pos); + + if(bound != Block.NULL_AABB && worldIn.checkNoEntityCollision(bound.offset(pos)) && worldIn.setBlockState(pos, newState, 11)){ + SoundType soundtype = theBlock.fullBlock.getSoundType(); + worldIn.playSound(playerIn, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume()+1.0F)/2.0F, soundtype.getPitch()*0.8F); + --stack.stackSize; + } + + return EnumActionResult.SUCCESS; + } + } + + return this.tryPlace(playerIn, stack, worldIn, pos.offset(facing)) ? EnumActionResult.SUCCESS : super.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ); + } + else{ + return EnumActionResult.FAIL; + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack){ + IBlockState state = worldIn.getBlockState(pos); + + if(state.getBlock() == this.block){ + if((side == EnumFacing.UP && state.getValue(META) == 0 || side == EnumFacing.DOWN && state.getValue(META) == 1)){ return true; } } - return super.onItemUse(stack, player, world, pos, side, hitX, hitY, hitZ); + + return worldIn.getBlockState(pos.offset(side)).getBlock() == this.block || super.canPlaceBlockOnSide(worldIn, pos, side, player, stack); } + private boolean tryPlace(EntityPlayer player, ItemStack stack, World worldIn, BlockPos pos){ + IBlockState iblockstate = worldIn.getBlockState(pos); + + if(iblockstate.getBlock() == this.block){ + BlockSlabs theBlock = (BlockSlabs)this.block; + IBlockState newState = theBlock.fullBlock.getStateFromMeta(theBlock.meta); + AxisAlignedBB bound = newState.getCollisionBoundingBox(worldIn, pos); + + if(bound != Block.NULL_AABB && worldIn.checkNoEntityCollision(bound.offset(pos)) && worldIn.setBlockState(pos, newState, 11)){ + SoundType soundtype = theBlock.fullBlock.getSoundType(); + worldIn.playSound(player, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume()+1.0F)/2.0F, soundtype.getPitch()*0.8F); + --stack.stackSize; + } + + return true; + } + + return false; + } + + @Override public String getUnlocalizedName(ItemStack stack){ return this.getUnlocalizedName(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java index dadc6f880..1c8745557 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java @@ -1,11 +1,11 @@ /* - * This file ("BlockSmileyCloud.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockSmileyCloud.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -16,57 +16,52 @@ import de.ellpeck.actuallyadditions.mod.achievement.TheAchievements; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; -import net.minecraft.world.IBlockAccess; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; import java.util.Random; public class BlockSmileyCloud extends BlockContainerBase{ - private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, 7); public BlockSmileyCloud(String name){ - super(Material.cloth, name); + super(Material.CLOTH, name); this.setHardness(0.5F); this.setResistance(5.0F); - this.setStepSound(soundTypeCloth); + this.setSoundType(SoundType.CLOTH); this.setTickRandomly(true); } @Override - public boolean isFullCube(){ + public boolean isFullCube(IBlockState state){ return false; } @Override - public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ - this.setBlockBoundsBasedOnState(world, pos); - super.addCollisionBoxesToList(world, pos, state, axis, list, entity); - } - - @Override - public boolean isOpaqueCube(){ + public boolean isOpaqueCube(IBlockState state){ return false; } @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){ if(Util.RANDOM.nextInt(30) == 0){ for(int i = 0; i < 2; i++){ double d = Util.RANDOM.nextGaussian()*0.02D; @@ -78,36 +73,18 @@ public class BlockSmileyCloud extends BlockContainerBase{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing f6, float f7, float f8, float f9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing f6, float f7, float f8, float f9){ if(!world.isRemote){ TileEntity tile = world.getTileEntity(pos); if(tile instanceof TileEntitySmileyCloud){ player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CLOUD.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); - player.triggerAchievement(TheAchievements.NAME_SMILEY_CLOUD.ach); + player.addStat(TheAchievements.NAME_SMILEY_CLOUD.chieve); } } return true; } - @Override - public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos){ - int meta = PosUtil.getMetadata(pos, world); - float f = 0.0625F; - - if(meta == 1){ - this.setBlockBounds(0F, 0F, 0F, 1F, 1F-f*3F, 1F-f*2F); - } - if(meta == 3){ - this.setBlockBounds(0F, 0F, 0F, 1F-f*2F, 1F-f*3F, 1F); - } - if(meta == 0){ - this.setBlockBounds(0F, 0F, f*2F, 1F, 1F-f*3F, 1F); - } - if(meta == 2){ - this.setBlockBounds(f*2F, 0F, 0F, 1F, 1F-f*3F, 1F); - } - } @Override public TileEntity createNewTileEntity(World world, int meta){ @@ -130,16 +107,16 @@ public class BlockSmileyCloud extends BlockContainerBase{ int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; if(rotation == 0){ - PosUtil.setMetadata(pos, world, 0, 2); + world.setBlockState(pos, this.getStateFromMeta(0), 2); } if(rotation == 1){ - PosUtil.setMetadata(pos, world, 3, 2); + world.setBlockState(pos, this.getStateFromMeta(3), 2); } if(rotation == 2){ - PosUtil.setMetadata(pos, world, 1, 2); + world.setBlockState(pos, this.getStateFromMeta(1), 2); } if(rotation == 3){ - PosUtil.setMetadata(pos, world, 2, 2); + world.setBlockState(pos, this.getStateFromMeta(2), 2); } super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java index 18e4745fc..0d806d30a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java @@ -1,11 +1,11 @@ /* - * This file ("BlockTreasureChest.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockTreasureChest.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -14,19 +14,21 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.recipe.TreasureChestLoot; import de.ellpeck.actuallyadditions.mod.achievement.TheAchievements; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.*; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -38,17 +40,17 @@ public class BlockTreasureChest extends BlockBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3); public BlockTreasureChest(String name){ - super(Material.wood, name); + super(Material.WOOD, name); this.setHarvestLevel("axe", 0); this.setHardness(300.0F); this.setResistance(50.0F); - this.setStepSound(soundTypeWood); + this.setSoundType(SoundType.WOOD); this.setTickRandomly(true); } @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ + public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand){ for(int i = 0; i < 2; i++){ for(float f = 0; f <= 3; f += 0.5){ float particleX = rand.nextFloat(); @@ -64,13 +66,13 @@ public class BlockTreasureChest extends BlockBase{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ - world.playSoundAtEntity(player, "random.chestopen", 0.2F, Util.RANDOM.nextFloat()*0.1F+0.9F); + world.playSound(null, pos, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.2F, Util.RANDOM.nextFloat()*0.1F+0.9F); this.dropItems(world, pos); world.setBlockToAir(pos); - player.triggerAchievement(TheAchievements.OPEN_TREASURE_CHEST.ach); + player.addStat(TheAchievements.OPEN_TREASURE_CHEST.chieve); } return true; } @@ -80,16 +82,16 @@ public class BlockTreasureChest extends BlockBase{ int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; if(rotation == 0){ - PosUtil.setMetadata(pos, world, 0, 2); + world.setBlockState(pos, this.getStateFromMeta(0), 2); } if(rotation == 1){ - PosUtil.setMetadata(pos, world, 3, 2); + world.setBlockState(pos, this.getStateFromMeta(3), 2); } if(rotation == 2){ - PosUtil.setMetadata(pos, world, 1, 2); + world.setBlockState(pos, this.getStateFromMeta(1), 2); } if(rotation == 3){ - PosUtil.setMetadata(pos, world, 2, 2); + world.setBlockState(pos, this.getStateFromMeta(2), 2); } } @@ -100,7 +102,7 @@ public class BlockTreasureChest extends BlockBase{ private void dropItems(World world, BlockPos pos){ for(int i = 0; i < MathHelper.getRandomIntegerInRange(Util.RANDOM, 3, 6); i++){ - TreasureChestLoot theReturn = WeightedRandom.getRandomItem(Util.RANDOM, ActuallyAdditionsAPI.treasureChestLoot); + TreasureChestLoot theReturn = WeightedRandom.getRandomItem(Util.RANDOM, ActuallyAdditionsAPI.TREASURE_CHEST_LOOT); ItemStack itemStack = theReturn.returnItem.copy(); itemStack.stackSize = MathHelper.getRandomIntegerInRange(Util.RANDOM, theReturn.minAmount, theReturn.maxAmount); @@ -108,9 +110,6 @@ public class BlockTreasureChest extends BlockBase{ float dY = Util.RANDOM.nextFloat()*0.8F+0.1F; float dZ = Util.RANDOM.nextFloat()*0.8F+0.1F; EntityItem entityItem = new EntityItem(world, pos.getX()+dX, pos.getY()+dY, pos.getZ()+dZ, itemStack.copy()); - if(itemStack.hasTagCompound()){ - entityItem.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy()); - } float factor = 0.05F; entityItem.motionX = Util.RANDOM.nextGaussian()*factor; entityItem.motionY = Util.RANDOM.nextGaussian()*factor+0.2F; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWallAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWallAA.java new file mode 100644 index 000000000..699261da3 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWallAA.java @@ -0,0 +1,155 @@ +/* + * This file ("BlockWallAA.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockWall; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.List; + +public class BlockWallAA extends BlockBase{ + + protected static final AxisAlignedBB[] AABB_BY_INDEX = new AxisAlignedBB[]{new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.3125D, 0.0D, 0.0D, 0.6875D, 0.875D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.3125D, 1.0D, 0.875D, 0.6875D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D)}; + protected static final AxisAlignedBB[] CLIP_AABB_BY_INDEX = new AxisAlignedBB[]{AABB_BY_INDEX[0].setMaxY(1.5D), AABB_BY_INDEX[1].setMaxY(1.5D), AABB_BY_INDEX[2].setMaxY(1.5D), AABB_BY_INDEX[3].setMaxY(1.5D), AABB_BY_INDEX[4].setMaxY(1.5D), AABB_BY_INDEX[5].setMaxY(1.5D), AABB_BY_INDEX[6].setMaxY(1.5D), AABB_BY_INDEX[7].setMaxY(1.5D), AABB_BY_INDEX[8].setMaxY(1.5D), AABB_BY_INDEX[9].setMaxY(1.5D), AABB_BY_INDEX[10].setMaxY(1.5D), AABB_BY_INDEX[11].setMaxY(1.5D), AABB_BY_INDEX[12].setMaxY(1.5D), AABB_BY_INDEX[13].setMaxY(1.5D), AABB_BY_INDEX[14].setMaxY(1.5D), AABB_BY_INDEX[15].setMaxY(1.5D)}; + + private final int meta; + + public BlockWallAA(String name, Block base){ + this(name, base, 0); + } + + + public BlockWallAA(String name, Block base, int meta){ + super(base.getMaterial(base.getDefaultState()), name); + this.meta = meta; + + this.setHardness(1.5F); + this.setResistance(10F); + this.setSoundType(base.getSoundType()); + + this.setDefaultState(this.blockState.getBaseState().withProperty(BlockWall.UP, false).withProperty(BlockWall.NORTH, false).withProperty(BlockWall.EAST, false).withProperty(BlockWall.SOUTH, false).withProperty(BlockWall.WEST, false)); + } + + private static int yesThisIsCopyPastedFromBlockWallAndIHaveNoIdeaWhatThisMethodDoes(IBlockState state){ + int i = 0; + + if(state.getValue(BlockWall.NORTH)){ + i |= 1 << EnumFacing.NORTH.getHorizontalIndex(); + } + + if(state.getValue(BlockWall.EAST)){ + i |= 1 << EnumFacing.EAST.getHorizontalIndex(); + } + + if(state.getValue(BlockWall.SOUTH)){ + i |= 1 << EnumFacing.SOUTH.getHorizontalIndex(); + } + + if(state.getValue(BlockWall.WEST)){ + i |= 1 << EnumFacing.WEST.getHorizontalIndex(); + } + + return i; + } + + @Override + public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){ + boolean flag = this.canConnectTo(worldIn, pos.north()); + boolean flag1 = this.canConnectTo(worldIn, pos.east()); + boolean flag2 = this.canConnectTo(worldIn, pos.south()); + boolean flag3 = this.canConnectTo(worldIn, pos.west()); + boolean flag4 = flag && !flag1 && flag2 && !flag3 || !flag && flag1 && !flag2 && flag3; + return state.withProperty(BlockWall.UP, !flag4 || !worldIn.isAirBlock(pos.up())).withProperty(BlockWall.NORTH, flag).withProperty(BlockWall.EAST, flag1).withProperty(BlockWall.SOUTH, flag2).withProperty(BlockWall.WEST, flag3); + } + + @Override + public boolean isFullCube(IBlockState state){ + return false; + } + + @Override + public boolean isPassable(IBlockAccess worldIn, BlockPos pos){ + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side){ + return side != EnumFacing.DOWN || super.shouldSideBeRendered(blockState, blockAccess, pos, side); + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){ + state = this.getActualState(state, source, pos); + return AABB_BY_INDEX[yesThisIsCopyPastedFromBlockWallAndIHaveNoIdeaWhatThisMethodDoes(state)]; + } + + @Override + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos){ + blockState = this.getActualState(blockState, worldIn, pos); + return CLIP_AABB_BY_INDEX[yesThisIsCopyPastedFromBlockWallAndIHaveNoIdeaWhatThisMethodDoes(blockState)]; + } + + @Override + public boolean isOpaqueCube(IBlockState state){ + return false; + } + + @Override + public int damageDropped(IBlockState state){ + return this.meta; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs tab, List list){ + list.add(new ItemStack(item, 1, 0)); + } + + public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos){ + IBlockState state = worldIn.getBlockState(pos); + Block block = state.getBlock(); + return block != Blocks.BARRIER && (!(block != this && !(block instanceof BlockFenceGate)) || ((block.getMaterial(state).isOpaque() && block.isFullCube(state)) && block.getMaterial(state) != Material.GOURD)); + } + + + @Override + public IBlockState getStateFromMeta(int meta){ + return this.getDefaultState(); + } + + @Override + public int getMetaFromState(IBlockState state){ + return 0; + } + + + @Override + protected BlockStateContainer createBlockState(){ + return new BlockStateContainer(this, BlockWall.UP, BlockWall.NORTH, BlockWall.EAST, BlockWall.WEST, BlockWall.SOUTH); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java index 92dad16a1..502a0cd2e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java @@ -1,11 +1,11 @@ /* - * This file ("BlockWildPlant.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockWildPlant.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -16,10 +16,9 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBushBase; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheWildPlants; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -28,9 +27,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -40,39 +39,42 @@ import java.util.List; public class BlockWildPlant extends BlockBushBase{ - public static final TheWildPlants[] allWildPlants = TheWildPlants.values(); - private static final PropertyInteger META = PropertyInteger.create("meta", 0, allWildPlants.length-1); + public static final TheWildPlants[] ALL_WILD_PLANTS = TheWildPlants.values(); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, ALL_WILD_PLANTS.length-1); public BlockWildPlant(String name){ super(name); - this.setStepSound(soundTypeGrass); + this.setSoundType(SoundType.PLANT); } @Override public boolean canBlockStay(World world, BlockPos pos, IBlockState state){ - BlockPos offset = PosUtil.offset(pos, 0, -1, 0); - return PosUtil.getMetadata(pos, world) == TheWildPlants.RICE.ordinal() ? PosUtil.getMaterial(offset, world) == Material.water : PosUtil.getBlock(offset, world).canSustainPlant(world, offset, EnumFacing.UP, this); + BlockPos offset = pos.down(); + IBlockState offsetState = world.getBlockState(offset); + Block offsetBlock = offsetState.getBlock(); + return offsetBlock.getMetaFromState(offsetState) == TheWildPlants.RICE.ordinal() ? offsetBlock.getMaterial(offsetState) == Material.WATER : offsetBlock.canSustainPlant(world.getBlockState(offset), world, offset, EnumFacing.UP, this); + } + + + @Override + @SideOnly(Side.CLIENT) + public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player){ + int metadata = this.getMetaFromState(state); + return metadata >= ALL_WILD_PLANTS.length ? null : new ItemStack(((BlockPlant)ALL_WILD_PLANTS[metadata].wildVersionOf).seedItem); } @Override @SideOnly(Side.CLIENT) - public Item getItem(World world, BlockPos pos){ - int metadata = PosUtil.getMetadata(pos, world); - return metadata >= allWildPlants.length ? null : ((BlockPlant)allWildPlants[metadata].wildVersionOf).seedItem; - } - - @SuppressWarnings("all") - @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allWildPlants.length; j++){ + for(int j = 0; j < ALL_WILD_PLANTS.length; j++){ list.add(new ItemStack(item, 1, j)); } } @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ - int metadata = state.getBlock().getMetaFromState(state); - return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, pos, allWildPlants[metadata].wildVersionOf.getStateFromMeta(7), fortune); + int metadata = this.getMetaFromState(state); + return metadata >= ALL_WILD_PLANTS.length ? null : ALL_WILD_PLANTS[metadata].wildVersionOf.getDrops(world, pos, ALL_WILD_PLANTS[metadata].wildVersionOf.getStateFromMeta(7), fortune); } @Override @@ -81,8 +83,8 @@ public class BlockWildPlant extends BlockBushBase{ } @Override - public Class getItemBlock(){ - return TheItemBlock.class; + protected ItemBlockBase getItemBlock(){ + return new TheItemBlock(this); } @Override @@ -92,18 +94,14 @@ public class BlockWildPlant extends BlockBushBase{ @Override protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[allWildPlants.length]; - for(int i = 0; i < allWildPlants.length; i++){ - String name = this.getBaseName()+allWildPlants[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + for(int i = 0; i < ALL_WILD_PLANTS.length; i++){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), META.getName()+"="+i); } - ActuallyAdditions.proxy.addRenderVariant(Item.getItemFromBlock(this), resLocs); } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.COMMON : allWildPlants[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_WILD_PLANTS.length ? EnumRarity.COMMON : ALL_WILD_PLANTS[stack.getItemDamage()].rarity; } @Override @@ -119,9 +117,10 @@ public class BlockWildPlant extends BlockBushBase{ this.setMaxDamage(0); } + @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allWildPlants.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allWildPlants[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_WILD_PLANTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_WILD_PLANTS[stack.getItemDamage()].name; } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java index ab5dc92d0..e79c719a7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java @@ -1,11 +1,11 @@ /* - * This file ("BlockXPSolidifier.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockXPSolidifier.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -16,8 +16,8 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; @@ -27,9 +27,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; public class BlockXPSolidifier extends BlockContainerBase{ @@ -37,20 +38,21 @@ public class BlockXPSolidifier extends BlockContainerBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3); public BlockXPSolidifier(String name){ - super(Material.rock, name); + super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(2.5F); this.setResistance(10.0F); - this.setStepSound(soundTypeStone); + this.setSoundType(SoundType.STONE); } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityXPSolidifier(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(pos); if(solidifier != null){ @@ -71,16 +73,16 @@ public class BlockXPSolidifier extends BlockContainerBase{ int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; if(rotation == 0){ - PosUtil.setMetadata(pos, world, 0, 2); + world.setBlockState(pos, this.getStateFromMeta(0), 2); } if(rotation == 1){ - PosUtil.setMetadata(pos, world, 3, 2); + world.setBlockState(pos, this.getStateFromMeta(3), 2); } if(rotation == 2){ - PosUtil.setMetadata(pos, world, 1, 2); + world.setBlockState(pos, this.getStateFromMeta(1), 2); } if(rotation == 3){ - PosUtil.setMetadata(pos, world, 2, 2); + world.setBlockState(pos, this.getStateFromMeta(2), 2); } super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java index 1cce30d2f..8475604f9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java @@ -1,11 +1,11 @@ /* - * This file ("IHudDisplay.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IHudDisplay.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; @@ -15,13 +15,13 @@ import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.profiler.Profiler; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.math.RayTraceResult; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public interface IHudDisplay{ @SideOnly(Side.CLIENT) - void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution); + void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java index 4b4d7e727..f8661ff8a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java @@ -1,30 +1,31 @@ /* - * This file ("InitBlocks.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitBlocks.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockStair; -import de.ellpeck.actuallyadditions.mod.blocks.base.BlockWallAA; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.util.CompatUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; import net.minecraft.block.Block; -public class InitBlocks{ +public final class InitBlocks{ public static Block blockCompost; public static Block blockMisc; public static Block blockWildPlant; public static Block blockFeeder; public static Block blockGiantChest; + public static Block blockGiantChestMedium; + public static Block blockGiantChestLarge; public static Block blockGrinder; public static Block blockGrinderDouble; @@ -57,6 +58,8 @@ public class InitBlocks{ public static Block blockPhantomBreaker; public static Block blockPhantomLiquiface; public static Block blockPhantomEnergyface; + public static Block blockPhantomRedstoneface; + public static Block blockPlayerInterface; public static Block blockFluidPlacer; public static Block blockFluidCollector; @@ -92,6 +95,9 @@ public class InitBlocks{ public static Block blockRangedCollector; public static Block blockLaserRelay; + public static Block blockLaserRelayItem; + public static Block blockLaserRelayItemWhitelist; + public static Block blockItemViewer; public static Block blockBlackLotus; public static Block blockCrystal; @@ -111,15 +117,26 @@ public class InitBlocks{ public static Block blockPillarQuartzStair; public static Block blockPillarQuartzSlab; + public static Block blockBookletStand; + public static Block blockDisplayStand; + public static Block blockShockSuppressor; + public static void init(){ ModUtil.LOGGER.info("Initializing Blocks..."); + blockShockSuppressor = new BlockShockSuppressor("blockShockSuppressor"); + blockDisplayStand = new BlockDisplayStand("blockDisplayStand"); + blockPlayerInterface = new BlockPlayerInterface("blockPlayerInterface"); + blockBookletStand = new BlockBookletStand("blockBookletStand"); + blockItemViewer = new BlockItemViewer("blockItemViewer"); blockFireworkBox = new BlockFireworkBox("blockFireworkBox"); blockMiner = new BlockMiner("blockMiner"); blockAtomicReconstructor = new BlockAtomicReconstructor("blockAtomicReconstructor"); blockCrystal = new BlockCrystal("blockCrystal"); blockBlackLotus = new BlockBlackLotus("blockBlackLotus"); - blockLaserRelay = new BlockLaserRelay("blockLaserRelay"); + blockLaserRelay = new BlockLaserRelay("blockLaserRelay", BlockLaserRelay.Type.ENERGY); + blockLaserRelayItem = new BlockLaserRelay("blockLaserRelayItem", BlockLaserRelay.Type.ITEM); + blockLaserRelayItemWhitelist = new BlockLaserRelay("blockLaserRelayItemWhitelist", BlockLaserRelay.Type.ITEM_WHITELIST); blockRangedCollector = new BlockRangedCollector("blockRangedCollector"); blockDirectionalBreaker = new BlockDirectionalBreaker("blockDirectionalBreaker"); blockLeafGenerator = new BlockLeafGenerator("blockLeafGenerator"); @@ -145,6 +162,7 @@ public class InitBlocks{ blockPhantomPlacer = new BlockPhantom(BlockPhantom.Type.PLACER, "blockPhantomPlacer"); blockPhantomLiquiface = new BlockPhantom(BlockPhantom.Type.LIQUIFACE, "blockPhantomLiquiface"); blockPhantomEnergyface = new BlockPhantom(BlockPhantom.Type.ENERGYFACE, "blockPhantomEnergyface"); + blockPhantomRedstoneface = new BlockPhantom(BlockPhantom.Type.REDSTONEFACE, "blockPhantomRedstoneface"); blockPhantomBreaker = new BlockPhantom(BlockPhantom.Type.BREAKER, "blockPhantomBreaker"); blockCoalGenerator = new BlockCoalGenerator("blockCoalGenerator"); blockOilGenerator = new BlockOilGenerator("blockOilGenerator"); @@ -160,7 +178,9 @@ public class InitBlocks{ blockCompost = new BlockCompost("blockCompost"); blockMisc = new BlockMisc("blockMisc"); blockFeeder = new BlockFeeder("blockFeeder"); - blockGiantChest = new BlockGiantChest("blockGiantChest"); + blockGiantChest = new BlockGiantChest("blockGiantChest", 0); + blockGiantChestMedium = new BlockGiantChest("blockGiantChestMedium", 1); + blockGiantChestLarge = new BlockGiantChest("blockGiantChestLarge", 2); blockGrinder = new BlockGrinder(false, "blockGrinder"); blockGrinderDouble = new BlockGrinder(true, "blockGrinderDouble"); blockFurnaceDouble = new BlockFurnaceDouble("blockFurnaceDouble"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java index 9cefdf4b2..36a4dbf66 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java @@ -1,31 +1,28 @@ /* - * This file ("BlockBase.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockBase.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; -public class BlockBase extends Block{ +public class BlockBase extends Block implements ItemBlockBase.ICustomRarity{ - private String name; + private final String name; public BlockBase(Material material, String name){ super(material); @@ -35,14 +32,7 @@ public class BlockBase extends Block{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerBlock(this, this.getItemBlock(), this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -51,8 +41,8 @@ public class BlockBase extends Block{ return this.name; } - protected Class getItemBlock(){ - return ItemBlockBase.class; + protected ItemBlockBase getItemBlock(){ + return new ItemBlockBase(this); } public boolean shouldAddCreative(){ @@ -60,9 +50,10 @@ public class BlockBase extends Block{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.COMMON; } @@ -77,9 +68,10 @@ public class BlockBase extends Block{ return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty()); } + @Override - protected BlockState createBlockState(){ - return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); + protected BlockStateContainer createBlockState(){ + return this.getMetaProperty() == null ? super.createBlockState() : new BlockStateContainer(this, this.getMetaProperty()); } protected PropertyInteger getMetaProperty(){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java index e06ec6201..5cbbb7cac 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java @@ -1,47 +1,38 @@ /* - * This file ("BlockBushBase.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockBushBase.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.block.BlockBush; +import net.minecraft.block.SoundType; import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; -public class BlockBushBase extends BlockBush{ +public class BlockBushBase extends BlockBush implements ItemBlockBase.ICustomRarity{ - private String name; + private final String name; public BlockBushBase(String name){ this.name = name; - this.setStepSound(soundTypeGrass); + this.setSoundType(SoundType.PLANT); this.register(); } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerBlock(this, this.getItemBlock(), this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -50,8 +41,8 @@ public class BlockBushBase extends BlockBush{ return this.name; } - protected Class getItemBlock(){ - return ItemBlockBase.class; + protected ItemBlockBase getItemBlock(){ + return new ItemBlockBase(this); } public boolean shouldAddCreative(){ @@ -59,9 +50,10 @@ public class BlockBushBase extends BlockBush{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.COMMON; } @@ -76,9 +68,10 @@ public class BlockBushBase extends BlockBush{ return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty()); } + @Override - protected BlockState createBlockState(){ - return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); + protected BlockStateContainer createBlockState(){ + return this.getMetaProperty() == null ? super.createBlockState() : new BlockStateContainer(this, this.getMetaProperty()); } protected PropertyInteger getMetaProperty(){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java index abc4adbdf..8c65b55a5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java @@ -1,26 +1,26 @@ /* - * This file ("BlockContainerBase.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockContainerBase.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.tile.*; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockRedstoneTorch; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; @@ -29,21 +29,24 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagInt; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidUtil; import java.util.ArrayList; +import java.util.List; import java.util.Random; -public abstract class BlockContainerBase extends BlockContainer{ +public abstract class BlockContainerBase extends BlockContainer implements ItemBlockBase.ICustomRarity{ - private String name; + private final String name; public BlockContainerBase(Material material, String name){ super(material); @@ -53,14 +56,7 @@ public abstract class BlockContainerBase extends BlockContainer{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerBlock(this, this.getItemBlock(), this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -69,8 +65,8 @@ public abstract class BlockContainerBase extends BlockContainer{ return this.name; } - protected Class getItemBlock(){ - return ItemBlockBase.class; + protected ItemBlockBase getItemBlock(){ + return new ItemBlockBase(this); } public boolean shouldAddCreative(){ @@ -78,9 +74,10 @@ public abstract class BlockContainerBase extends BlockContainer{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.COMMON; } @@ -106,9 +103,6 @@ public abstract class BlockContainerBase extends BlockContainer{ float dY = Util.RANDOM.nextFloat()*0.8F+0.1F; float dZ = Util.RANDOM.nextFloat()*0.8F+0.1F; EntityItem entityItem = new EntityItem(world, pos.getX()+dX, pos.getY()+dY, pos.getZ()+dZ, stack.copy()); - if(stack.hasTagCompound()){ - entityItem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy()); - } float factor = 0.05F; entityItem.motionX = Util.RANDOM.nextGaussian()*factor; entityItem.motionY = Util.RANDOM.nextGaussian()*factor+0.2F; @@ -118,12 +112,13 @@ public abstract class BlockContainerBase extends BlockContainer{ } public boolean tryToggleRedstone(World world, BlockPos pos, EntityPlayer player){ - ItemStack stack = player.getCurrentEquippedItem(); + ItemStack stack = player.getHeldItemMainhand(); if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){ TileEntity tile = world.getTileEntity(pos); - if(tile instanceof IRedstoneToggle){ - if(!world.isRemote){ - ((IRedstoneToggle)tile).toggle(!((IRedstoneToggle)tile).isPulseMode()); + if(tile instanceof TileEntityBase){ + TileEntityBase base = (TileEntityBase)tile; + if(!world.isRemote && base.isRedstoneToggle()){ + base.isPulseMode = !base.isPulseMode; tile.markDirty(); if(tile instanceof TileEntityBase){ @@ -150,36 +145,44 @@ public abstract class BlockContainerBase extends BlockContainer{ public void updateTick(World world, BlockPos pos, IBlockState state, Random random){ if(!world.isRemote){ TileEntity tile = world.getTileEntity(pos); - if(tile instanceof IRedstoneToggle && ((IRedstoneToggle)tile).isPulseMode()){ - ((IRedstoneToggle)tile).activateOnPulse(); + if(tile instanceof TileEntityBase){ + TileEntityBase base = (TileEntityBase)tile; + if(base.isRedstoneToggle() && base.isPulseMode){ + base.activateOnPulse(); + } } } } @Override - public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock){ - this.updateRedstoneState(world, pos); + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn){ + this.updateRedstoneState(worldIn, pos); } public void updateRedstoneState(World world, BlockPos pos){ if(!world.isRemote){ TileEntity tile = world.getTileEntity(pos); if(tile instanceof TileEntityBase){ + TileEntityBase base = (TileEntityBase)tile; boolean powered = world.isBlockIndirectlyGettingPowered(pos) > 0; - boolean wasPowered = ((TileEntityBase)tile).isRedstonePowered; + boolean wasPowered = base.isRedstonePowered; if(powered && !wasPowered){ - if(tile instanceof IRedstoneToggle && ((IRedstoneToggle)tile).isPulseMode()){ + if(base.isRedstoneToggle() && base.isPulseMode){ world.scheduleUpdate(pos, this, this.tickRate(world)); } - ((TileEntityBase)tile).setRedstonePowered(true); + base.setRedstonePowered(true); } else if(!powered && wasPowered){ - ((TileEntityBase)tile).setRedstonePowered(false); + base.setRedstonePowered(false); } } } } + protected boolean checkFailUseItemOnTank(EntityPlayer player, ItemStack heldItem, FluidTank tank){ + return heldItem == null || !FluidUtil.interactWithFluidHandler(heldItem, tank, player); + } + @Override public void onBlockAdded(World world, BlockPos pos, IBlockState state){ this.updateRedstoneState(world, pos); @@ -187,31 +190,12 @@ public abstract class BlockContainerBase extends BlockContainer{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase entity, ItemStack stack){ - if(stack.getTagCompound() != null){ + if(stack.hasTagCompound()){ TileEntity tile = world.getTileEntity(pos); - - if(tile instanceof IEnergySaver){ - ((IEnergySaver)tile).setEnergy(stack.getTagCompound().getInteger("Energy")); - stack.getTagCompound().removeTag("Energy"); - } - - if(tile instanceof IFluidSaver){ - int amount = stack.getTagCompound().getInteger("FluidAmount"); - stack.getTagCompound().removeTag("FluidAmount"); - - if(amount > 0){ - FluidStack[] fluids = new FluidStack[amount]; - - for(int i = 0; i < amount; i++){ - NBTTagCompound compound = stack.getTagCompound().getCompoundTag("Fluid"+i); - stack.getTagCompound().removeTag("Fluid"+i); - if(compound != null){ - fluids[i] = FluidStack.loadFluidStackFromNBT(compound); - } - } - - ((IFluidSaver)tile).setFluids(fluids); - } + if(tile instanceof TileEntityBase){ + TileEntityBase base = (TileEntityBase)tile; + NBTTagCompound compound = stack.getTagCompound().getCompoundTag("Data"); + base.readSyncableNBT(compound, TileEntityBase.NBTType.SAVE_BLOCK); } } } @@ -220,16 +204,18 @@ public abstract class BlockContainerBase extends BlockContainer{ public void onBlockHarvested(World world, BlockPos pos, IBlockState state, EntityPlayer player){ if(!player.capabilities.isCreativeMode){ this.dropBlockAsItem(world, pos, state, 0); + //dirty workaround because of Forge calling Item.onBlockStartBreak() twice + world.setBlockToAir(pos); } } @Override - public boolean hasComparatorInputOverride(){ + public boolean hasComparatorInputOverride(IBlockState state){ return true; } @Override - public int getComparatorInputOverride(World world, BlockPos pos){ + public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos){ TileEntity tile = world.getTileEntity(pos); if(tile instanceof IInventory){ return Container.calcRedstoneFromInventory((IInventory)tile); @@ -237,46 +223,43 @@ public abstract class BlockContainerBase extends BlockContainer{ return 0; } + @Override - protected BlockState createBlockState(){ - return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty()); + protected BlockStateContainer createBlockState(){ + return this.getMetaProperty() == null ? super.createBlockState() : new BlockStateContainer(this, this.getMetaProperty()); } + @Override public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ ArrayList drops = new ArrayList(); TileEntity tile = world.getTileEntity(pos); - if(tile != null){ - ItemStack stack = new ItemStack(this.getItemDropped(state, Util.RANDOM, fortune), 1, this.damageDropped(state)); + if(tile instanceof TileEntityBase){ + TileEntityBase base = (TileEntityBase)tile; + NBTTagCompound data = new NBTTagCompound(); + base.writeSyncableNBT(data, TileEntityBase.NBTType.SAVE_BLOCK); - if(tile instanceof IEnergySaver){ - int energy = ((IEnergySaver)tile).getEnergy(); - if(energy > 0){ - if(stack.getTagCompound() == null){ - stack.setTagCompound(new NBTTagCompound()); + //Remove unnecessarily saved default values to avoid unstackability + List keysToRemove = new ArrayList(); + for(String key : data.getKeySet()){ + NBTBase tag = data.getTag(key); + //Remove only ints because they are the most common ones + //Add else if below here to remove more types + if(tag instanceof NBTTagInt){ + if(((NBTTagInt)tag).getInt() == 0){ + keysToRemove.add(key); } - stack.getTagCompound().setInteger("Energy", energy); } } + for(String key : keysToRemove){ + data.removeTag(key); + } - if(tile instanceof IFluidSaver){ - FluidStack[] fluids = ((IFluidSaver)tile).getFluids(); - - if(fluids != null && fluids.length > 0){ - if(stack.getTagCompound() == null){ - stack.setTagCompound(new NBTTagCompound()); - } - - stack.getTagCompound().setInteger("FluidAmount", fluids.length); - for(int i = 0; i < fluids.length; i++){ - if(fluids[i] != null && fluids[i].amount > 0){ - NBTTagCompound compound = new NBTTagCompound(); - fluids[i].writeToNBT(compound); - stack.getTagCompound().setTag("Fluid"+i, compound); - } - } - } + ItemStack stack = new ItemStack(this.getItemDropped(state, Util.RANDOM, fortune), 1, this.damageDropped(state)); + if(!data.hasNoTags()){ + stack.setTagCompound(new NBTTagCompound()); + stack.getTagCompound().setTag("Data", data); } drops.add(stack); @@ -289,8 +272,9 @@ public abstract class BlockContainerBase extends BlockContainer{ return null; } + @Override - public int getRenderType(){ - return 3; + public EnumBlockRenderType getRenderType(IBlockState state){ + return EnumBlockRenderType.MODEL; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java index d4705287f..066d960ec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockFluidFlowing.java @@ -1,32 +1,29 @@ /* - * This file ("BlockFluidFlowing.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockFluidFlowing.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.base; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.block.material.Material; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fml.common.registry.GameRegistry; -public class BlockFluidFlowing extends BlockFluidClassic{ +public class BlockFluidFlowing extends BlockFluidClassic implements ItemBlockBase.ICustomRarity{ - private String name; + private final String name; public BlockFluidFlowing(Fluid fluid, Material material, String unlocalizedName){ super(fluid, material); @@ -37,22 +34,15 @@ public class BlockFluidFlowing extends BlockFluidClassic{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerBlock(this, this.getItemBlock(), this.getBaseName(), this.shouldAddCreative()); } protected String getBaseName(){ return this.name; } - protected Class getItemBlock(){ - return ItemBlockBase.class; + protected ItemBlockBase getItemBlock(){ + return new ItemBlockBase(this); } public boolean shouldAddCreative(){ @@ -61,14 +51,15 @@ public class BlockFluidFlowing extends BlockFluidClassic{ @Override public boolean canDisplace(IBlockAccess world, BlockPos pos){ - return !PosUtil.getMaterial(pos, world).isLiquid() && super.canDisplace(world, pos); + return !world.getBlockState(pos).getMaterial().isLiquid() && super.canDisplace(world, pos); } @Override public boolean displaceIfPossible(World world, BlockPos pos){ - return !PosUtil.getMaterial(pos, world).isLiquid() && super.displaceIfPossible(world, pos); + return !world.getBlockState(pos).getMaterial().isLiquid() && super.displaceIfPossible(world, pos); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index 665a8baa6..e3597c096 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -1,18 +1,17 @@ /* - * This file ("BlockPlant.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockPlant.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.block.BlockCrops; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; @@ -20,25 +19,24 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; -import net.minecraftforge.fml.common.registry.GameRegistry; import java.util.List; import java.util.Random; -public class BlockPlant extends BlockCrops{ +public class BlockPlant extends BlockCrops implements ItemBlockBase.ICustomRarity{ + private final String name; + private final int minDropAmount; + private final int addDropAmount; public Item seedItem; - public Item returnItem; - public int returnMeta; - private String name; - private int minDropAmount; - private int addDropAmount; + private Item returnItem; + private int returnMeta; public BlockPlant(String name, int minDropAmount, int addDropAmount){ this.name = name; @@ -47,15 +45,14 @@ public class BlockPlant extends BlockCrops{ this.register(); } + public void doStuff(Item seedItem, Item returnItem, int returnMeta){ + this.seedItem = seedItem; + this.returnItem = returnItem; + this.returnMeta = returnMeta; + } + private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerBlock(this, this.getItemBlock(), this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -64,8 +61,8 @@ public class BlockPlant extends BlockCrops{ return this.name; } - protected Class getItemBlock(){ - return ItemBlockBase.class; + protected ItemBlockBase getItemBlock(){ + return new ItemBlockBase(this); } public boolean shouldAddCreative(){ @@ -73,9 +70,10 @@ public class BlockPlant extends BlockCrops{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; } @@ -91,38 +89,33 @@ public class BlockPlant extends BlockCrops{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing facing, float hitX, float hitY, float hitZ){ - if(getMetaFromState(state) >= 7){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing facing, float hitX, float hitY, float hitZ){ + if(this.getMetaFromState(state) >= 7){ if(!world.isRemote){ - List drops = getDrops(world, pos, state, 0); + List drops = this.getDrops(world, pos, state, 0); boolean deductedSeedSize = false; - for(ItemStack stack : drops){ - if(stack != null){ - if(stack.getItem() == this.seedItem && !deductedSeedSize){ - stack.stackSize--; + for(ItemStack drop : drops){ + if(drop != null){ + if(drop.getItem() == this.seedItem && !deductedSeedSize){ + drop.stackSize--; deductedSeedSize = true; } - if(stack.stackSize > 0){ - EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, stack); + if(drop.stackSize > 0){ + EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, drop); world.spawnEntityInWorld(entity); } } } - world.setBlockState(pos, getStateFromMeta(0)); + world.setBlockState(pos, this.getStateFromMeta(0)); } return true; } return false; } - @Override - public int getDamageValue(World world, BlockPos pos){ - return 0; - } - @Override public Item getSeed(){ return this.seedItem; @@ -130,7 +123,7 @@ public class BlockPlant extends BlockCrops{ @Override public int quantityDropped(IBlockState state, int fortune, Random random){ - return this.getMetaFromState(state) >= 7 ? random.nextInt(addDropAmount)+minDropAmount : super.quantityDropped(state, fortune, random); + return this.getMetaFromState(state) >= 7 ? random.nextInt(this.addDropAmount)+this.minDropAmount : super.quantityDropped(state, fortune, random); } @Override @@ -138,7 +131,6 @@ public class BlockPlant extends BlockCrops{ return this.returnItem; } - @Override public Item getItemDropped(IBlockState state, Random rand, int par3){ return this.getMetaFromState(state) >= 7 ? this.getCrop() : this.getSeed(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockStair.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockStair.java index 6b1d3f824..c8189a04d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockStair.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockStair.java @@ -1,29 +1,26 @@ /* - * This file ("BlockStair.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockStair.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockStairs; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; -public class BlockStair extends BlockStairs{ +public class BlockStair extends BlockStairs implements ItemBlockBase.ICustomRarity{ - private String name; + private final String name; public BlockStair(Block block, String name){ this(block, name, 0); @@ -38,14 +35,7 @@ public class BlockStair extends BlockStairs{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerBlock(this, this.getItemBlock(), this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerBlock(this, this.getItemBlock(), this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -54,8 +44,8 @@ public class BlockStair extends BlockStairs{ return this.name; } - protected Class getItemBlock(){ - return ItemBlockBase.class; + protected ItemBlockBase getItemBlock(){ + return new ItemBlockBase(this); } public boolean shouldAddCreative(){ @@ -63,9 +53,10 @@ public class BlockStair extends BlockStairs{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.COMMON; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockWallAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockWallAA.java deleted file mode 100644 index 3b9ef2ed9..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockWallAA.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * This file ("BlockWallAA.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.blocks.base; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFenceGate; -import net.minecraft.block.BlockWall; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.BlockState; -import net.minecraft.block.state.IBlockState; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.List; - -public class BlockWallAA extends BlockBase{ - - private int meta; - - public BlockWallAA(String name, Block base){ - this(name, base, 0); - } - - public BlockWallAA(String name, Block base, int meta){ - super(base.getMaterial(), name); - this.meta = meta; - - this.setHardness(1.5F); - this.setResistance(10F); - this.setStepSound(base.stepSound); - - this.setDefaultState(this.blockState.getBaseState().withProperty(BlockWall.UP, false).withProperty(BlockWall.NORTH, false).withProperty(BlockWall.EAST, false).withProperty(BlockWall.SOUTH, false).withProperty(BlockWall.WEST, false)); - } - - @Override - public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){ - return state.withProperty(BlockWall.UP, !worldIn.isAirBlock(pos.up())).withProperty(BlockWall.NORTH, this.canConnectTo(worldIn, pos.north())).withProperty(BlockWall.EAST, this.canConnectTo(worldIn, pos.east())).withProperty(BlockWall.SOUTH, this.canConnectTo(worldIn, pos.south())).withProperty(BlockWall.WEST, this.canConnectTo(worldIn, pos.west())); - } - - @Override - public boolean isFullCube(){ - return false; - } - - @Override - public boolean isPassable(IBlockAccess worldIn, BlockPos pos){ - return false; - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side){ - return side != EnumFacing.DOWN || super.shouldSideBeRendered(worldIn, pos, side); - } - - @Override - public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state){ - this.setBlockBoundsBasedOnState(worldIn, pos); - this.maxY = 1.5D; - return super.getCollisionBoundingBox(worldIn, pos, state); - } - - @Override - public boolean isOpaqueCube(){ - return false; - } - - @Override - public int damageDropped(IBlockState state){ - return meta; - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos){ - boolean flag = this.canConnectTo(worldIn, pos.north()); - boolean flag1 = this.canConnectTo(worldIn, pos.south()); - boolean flag2 = this.canConnectTo(worldIn, pos.west()); - boolean flag3 = this.canConnectTo(worldIn, pos.east()); - float f = 0.25F; - float f1 = 0.75F; - float f2 = 0.25F; - float f3 = 0.75F; - float f4 = 1.0F; - - if(flag){ - f2 = 0.0F; - } - if(flag1){ - f3 = 1.0F; - } - if(flag2){ - f = 0.0F; - } - if(flag3){ - f1 = 1.0F; - } - - if(flag && flag1 && !flag2 && !flag3){ - f4 = 0.8125F; - f = 0.3125F; - f1 = 0.6875F; - } - else if(!flag && !flag1 && flag2 && flag3){ - f4 = 0.8125F; - f2 = 0.3125F; - f3 = 0.6875F; - } - - this.setBlockBounds(f, 0.0F, f2, f1, f4, f3); - } - - @SuppressWarnings("unchecked") - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tab, List list){ - list.add(new ItemStack(item, 1, 0)); - } - - public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos){ - Block block = worldIn.getBlockState(pos).getBlock(); - return block != Blocks.barrier && (!(block != this && !(block instanceof BlockFenceGate)) || ((block.getMaterial().isOpaque() && block.isFullCube()) && block.getMaterial() != Material.gourd)); - } - - @Override - public IBlockState getStateFromMeta(int meta){ - return this.getDefaultState(); - } - - @Override - public int getMetaFromState(IBlockState state){ - return 0; - } - - @Override - protected BlockState createBlockState(){ - return new BlockState(this, BlockWall.UP, BlockWall.NORTH, BlockWall.EAST, BlockWall.WEST, BlockWall.SOUTH); - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/ItemBlockBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/ItemBlockBase.java index 37578bd51..c4e3eea7f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/ItemBlockBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/ItemBlockBase.java @@ -1,11 +1,11 @@ /* - * This file ("ItemBlockBase.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemBlockBase.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.base; @@ -24,6 +24,7 @@ public class ItemBlockBase extends ItemBlock{ this.setMaxDamage(0); } + @Override public String getUnlocalizedName(ItemStack stack){ return this.getUnlocalizedName(); @@ -34,31 +35,20 @@ public class ItemBlockBase extends ItemBlock{ return damage; } + @Override public EnumRarity getRarity(ItemStack stack){ - if(this.block instanceof BlockBase){ - return ((BlockBase)this.block).getRarity(stack); - } - else if(this.block instanceof BlockContainerBase){ - return ((BlockContainerBase)this.block).getRarity(stack); - } - else if(this.block instanceof BlockFluidFlowing){ - return ((BlockFluidFlowing)this.block).getRarity(stack); - } - else if(this.block instanceof BlockPlant){ - return ((BlockPlant)this.block).getRarity(stack); - } - else if(this.block instanceof BlockStair){ - return ((BlockStair)this.block).getRarity(stack); - } - else if(this.block instanceof BlockWallAA){ - return ((BlockWallAA)this.block).getRarity(stack); - } - else if(this.block instanceof BlockBushBase){ - return ((BlockBushBase)this.block).getRarity(stack); + if(this.block instanceof ICustomRarity){ + return ((ICustomRarity)this.block).getRarity(stack); } else{ return Util.FALLBACK_RARITY; } } -} + + public interface ICustomRarity{ + + EnumRarity getRarity(ItemStack stack); + + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java index 384246947..cf8e39efa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java @@ -1,17 +1,15 @@ /* - * This file ("TheColoredLampColors.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheColoredLampColors.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.metalists; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; - public enum TheColoredLampColors{ WHITE("White"), @@ -31,7 +29,7 @@ public enum TheColoredLampColors{ RED("Red"), BLACK("Black"); - public String name; + public final String name; TheColoredLampColors(String name){ this.name = name; @@ -41,8 +39,11 @@ public enum TheColoredLampColors{ if(color.substring(0, 3).equals("dye")){ String actualName = color.substring(3); for(int i = 0; i < values().length; i++){ - if(StringUtil.equalsToLowerCase(values()[i].name, actualName)){ - return values()[i]; + String aName = values()[i].name; + if(aName != null){ + if(aName.equalsIgnoreCase(actualName)){ + return values()[i]; + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheMiscBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheMiscBlocks.java index 865a60d3e..ecfad5592 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheMiscBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheMiscBlocks.java @@ -1,11 +1,11 @@ /* - * This file ("TheMiscBlocks.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheMiscBlocks.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.metalists; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheWildPlants.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheWildPlants.java index 3257d776d..28eaf04a7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheWildPlants.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheWildPlants.java @@ -1,11 +1,11 @@ /* - * This file ("TheWildPlants.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheWildPlants.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.metalists; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java new file mode 100644 index 000000000..a28362341 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java @@ -0,0 +1,63 @@ +/* + * This file ("RenderCompost.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks.render; + +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +public class RenderCompost extends TileEntitySpecialRenderer{ + + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTicks, int destroyStage){ + if(te instanceof TileEntityCompost){ + TileEntityCompost compost = (TileEntityCompost)te; + ItemStack slot = compost.getStackInSlot(0); + + if(slot != null){ + Block display = null; + int maxAmount = 0; + for(CompostRecipe aRecipe : ActuallyAdditionsAPI.COMPOST_RECIPES){ + if(slot.isItemEqual(aRecipe.input)){ + display = aRecipe.inputDisplay; + maxAmount = aRecipe.input.stackSize; + break; + } + else if(slot.isItemEqual(aRecipe.output)){ + display = aRecipe.outputDisplay; + maxAmount = aRecipe.output.stackSize; + break; + } + } + if(display != null){ + float i = (float)slot.stackSize/(float)maxAmount; + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x+0.5F, (float)y+(i/3F)+0.01F, (float)z+0.5F); + //Hehe + if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getName())){ + GlStateManager.translate(0F, 1F, 0F); + } + GlStateManager.scale(1.5F, i, 1.5F); + AssetUtil.renderBlockInWorld(display, 0); + GlStateManager.popMatrix(); + } + } + } + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderDisplayStand.java new file mode 100644 index 000000000..2cf52d223 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderDisplayStand.java @@ -0,0 +1,52 @@ +/* + * This file ("RenderDisplayStand.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.blocks.render; + +import de.ellpeck.actuallyadditions.mod.tile.TileEntityDisplayStand; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +public class RenderDisplayStand extends TileEntitySpecialRenderer{ + + @Override + public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5, int par6){ + if(!(tile instanceof TileEntityDisplayStand)){ + return; + } + + ItemStack stack = ((TileEntityDisplayStand)tile).getStackInSlot(0); + if(stack != null){ + GlStateManager.pushMatrix(); + GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F); + + double boop = Minecraft.getSystemTime()/800D; + GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.065, 0D); + GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0); + + float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F; + GlStateManager.scale(scale, scale, scale); + try{ + AssetUtil.renderItemInWorld(stack); + } + catch(Exception e){ + ModUtil.LOGGER.error("Something went wrong trying to render an item in a display stand! The item is "+stack.getItem().getRegistryName()+"!", e); + } + + GlStateManager.popMatrix(); + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderReconstructorLens.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderReconstructorLens.java index 627119a37..1d80651d3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderReconstructorLens.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderReconstructorLens.java @@ -1,25 +1,30 @@ /* - * This file ("RenderReconstructorLens.java") is part of the Actually Additions Mod for Minecraft. + * This file ("RenderReconstructorLens.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.render; +import de.ellpeck.actuallyadditions.api.lens.ILensItem; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -//TODO Fix Reconstructor Lens rendering public class RenderReconstructorLens extends TileEntitySpecialRenderer{ @Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5, int par6){ - /*if(!(tile instanceof TileEntityAtomicReconstructor)){ + if(!(tile instanceof TileEntityAtomicReconstructor)){ return; } ItemStack stack = ((TileEntityAtomicReconstructor)tile).getStackInSlot(0); @@ -29,7 +34,8 @@ public class RenderReconstructorLens extends TileEntitySpecialRenderer{ GlStateManager.translate((float)x+0.5F, (float)y-0.5F, (float)z+0.5F); GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F); - int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld()); + IBlockState state = tile.getWorld().getBlockState(tile.getPos()); + int meta = state.getBlock().getMetaFromState(state); if(meta == 0){ GlStateManager.translate(0F, -0.5F, 0F); GlStateManager.rotate(90F, 1F, 0F, 0F); @@ -61,6 +67,6 @@ public class RenderReconstructorLens extends TileEntitySpecialRenderer{ AssetUtil.renderItemInWorld(stack); GlStateManager.popMatrix(); - }*/ + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java index 36ded7504..63c42480d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java @@ -1,139 +1,74 @@ /* - * This file ("RenderSmileyCloud.java") is part of the Actually Additions Mod for Minecraft. + * This file ("RenderSmileyCloud.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.blocks.render; +import de.ellpeck.actuallyadditions.mod.misc.cloud.ISmileyCloudEasterEgg; +import de.ellpeck.actuallyadditions.mod.misc.cloud.SmileyCloudEasterEggs; +import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; +import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; -//TODO Fix Smiley Cloud public class RenderSmileyCloud extends TileEntitySpecialRenderer{ - //private static final ResourceLocation resLocValentine = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/modelPinkFluffyUnicloud.png"); - @Override public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5, int partial){ - /*if(!(tile instanceof TileEntitySmileyCloud)){ - return; - } - TileEntitySmileyCloud theCloud = (TileEntitySmileyCloud)tile; - - GlStateManager.pushMatrix(); - { - if(theCloud.flyHeight == 0){ - theCloud.flyHeight = tile.getWorld().rand.nextInt(30)+30; - } - int bobHeight = theCloud.flyHeight; - double theTime = Minecraft.getSystemTime(); - double time = theTime/50; - - if(time-bobHeight >= theCloud.lastFlyHeight){ - theCloud.lastFlyHeight = time; - } - - if(time-(bobHeight/2) >= theCloud.lastFlyHeight){ - GlStateManager.translate(0, (time-theCloud.lastFlyHeight)/300, 0); - } - else{ - GlStateManager.translate(0, -(time-theCloud.lastFlyHeight)/300+(double)bobHeight/300, 0); - } + if(tile instanceof TileEntitySmileyCloud){ + TileEntitySmileyCloud theCloud = (TileEntitySmileyCloud)tile; + GlStateManager.pushMatrix(); GlStateManager.translate((float)x+0.5F, (float)y-0.5F, (float)z+0.5F); GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F); GlStateManager.translate(0.0F, -2F, 0.0F); - GlStateManager.pushMatrix(); - { - if(theModel.doesRotate()){ - int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld()); - if(meta == 0){ - GlStateManager.rotate(180F, 0F, 1F, 0F); - } - if(meta == 1){ - GlStateManager.rotate(90F, 0F, 1F, 0F); - } - if(meta == 3){ - GlStateManager.rotate(270F, 0F, 1F, 0F); - } - } + theCloud.setStatus(ClientProxy.bulletForMyValentine || (theCloud.name != null && !theCloud.name.isEmpty() && theCloud.name.equals("Pink Fluffy Unicloud"))); - if(ClientProxy.bulletForMyValentine || (theCloud.name != null && !theCloud.name.isEmpty() && theCloud.name.equals("Pink Fluffy Unicloud"))){ - this.bindTexture(resLocValentine); - } - else{ - this.bindTexture(resLoc); - } - - theModel.render(0.0625F); - - if(theCloud.name != null && !theCloud.name.isEmpty()){ - for(ISmileyCloudEasterEgg cloud : SmileyCloudEasterEggs.cloudStuff){ - boolean canBreak = false; - for(String triggerName : cloud.getTriggerNames()){ - if(StringUtil.equalsToLowerCase(triggerName, theCloud.name)){ + if(theCloud.name != null && !theCloud.name.isEmpty()){ + easterEggs: + for(ISmileyCloudEasterEgg cloud : SmileyCloudEasterEggs.CLOUD_STUFF){ + for(String triggerName : cloud.getTriggerNames()){ + if(triggerName != null && theCloud.name != null){ + if(triggerName.equalsIgnoreCase(theCloud.name)){ + GlStateManager.pushMatrix(); + IBlockState state = theCloud.getWorld().getBlockState(theCloud.getPos()); + switch(state.getBlock().getMetaFromState(state)){ + case 1: + GlStateManager.rotate(180, 0, 1, 0); + break; + case 2: + GlStateManager.rotate(270, 0, 1, 0); + break; + case 3: + GlStateManager.rotate(90, 0, 1, 0); + break; + } cloud.renderExtra(0.0625F); - canBreak = true; - break; + GlStateManager.popMatrix(); + break easterEggs; } } - if(canBreak){ - break; - } } } } GlStateManager.popMatrix(); if(theCloud.name != null && !theCloud.name.isEmpty() && !Minecraft.getMinecraft().gameSettings.hideGUI){ - GlStateManager.pushMatrix(); - { - GlStateManager.translate(0F, 0.1F, 0F); - GlStateManager.rotate(180F, 1F, 0F, 0F); - GlStateManager.rotate(180F, 0F, 1F, 0F); - - GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); - GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); - float f = 1.6F; - float f1 = 0.016666668F*f; - GlStateManager.scale(-f1, -f1, f1); - GlStateManager.disableLighting(); - GlStateManager.translate(0.0F, 0F/f1, 0.0F); - GlStateManager.depthMask(false); - GlStateManager.enableBlend(); - GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - //TODO Fix nameplate with Smiley Cloud - Tessellator tessellator = Tessellator.getInstance(); - GlStateManager.glDisable(GlStateManager.GL_TEXTURE_2D); - tessellator.startDrawingQuads(); - int i = Minecraft.getMinecraft().fontRendererObj.getStringWidth(theCloud.name)/2; - tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); - tessellator.addVertex(-i-1, -1.0D, 0.0D); - tessellator.addVertex(-i-1, 8.0D, 0.0D); - tessellator.addVertex(i+1, 8.0D, 0.0D); - tessellator.addVertex(i+1, -1.0D, 0.0D); - tessellator.draw(); - GlStateManager.glEnable(GlStateManager.GL_TEXTURE_2D); - GlStateManager.depthMask(true); - - Minecraft.getMinecraft().fontRendererObj.drawString(theCloud.name, -Minecraft.getMinecraft().fontRendererObj.getStringWidth(theCloud.name)/2, 0, StringUtil.DECIMAL_COLOR_WHITE); - - GlStateManager.enableLighting(); - GlStateManager.disableBlend(); - GlStateManager.color(1F, 1F, 1F, 1F); - GlStateManager.scale(1F/-f1, 1F/-f1, 1F/f1); - } - GlStateManager.popMatrix(); + AssetUtil.renderNameTag(theCloud.name, x+0.5F, y+1.5F, z+0.66); } + } - GlStateManager.popMatrix(); - */ } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/model/ModelCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/model/ModelCompost.java deleted file mode 100644 index 685bbff99..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/model/ModelCompost.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This file ("ModelCompost.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.blocks.render.model; - -import net.minecraft.client.model.ModelBase; - -//TODO Fix compost rendering -public class ModelCompost extends ModelBase{ - - /*public ModelRenderer floor; - public ModelRenderer wallOne; - public ModelRenderer wallTwo; - public ModelRenderer wallThree; - public ModelRenderer wallFour; - public ModelRenderer[] innerRawList = new ModelRenderer[13]; - public ModelRenderer innerDone; - - public ModelCompost(){ - this.textureWidth = 64; - this.textureHeight = 128; - this.wallThree = new ModelRenderer(this, 0, 0); - this.wallThree.setRotationPoint(-6.0F, 8.0F, 6.0F); - this.wallThree.addBox(0.0F, 0.0F, 0.0F, 12, 15, 1, 0.0F); - this.wallFour = new ModelRenderer(this, 0, 0); - this.wallFour.setRotationPoint(-6.0F, 8.0F, -7.0F); - this.wallFour.addBox(0.0F, 0.0F, 0.0F, 12, 15, 1, 0.0F); - this.wallOne = new ModelRenderer(this, 0, 0); - this.wallOne.setRotationPoint(-7.0F, 8.0F, -7.0F); - this.wallOne.addBox(0.0F, 0.0F, 0.0F, 1, 15, 14, 0.0F); - this.wallTwo = new ModelRenderer(this, 0, 0); - this.wallTwo.setRotationPoint(6.0F, 8.0F, -7.0F); - this.wallTwo.addBox(0.0F, 0.0F, 0.0F, 1, 15, 14, 0.0F); - this.floor = new ModelRenderer(this, 0, 0); - this.floor.setRotationPoint(-7.0F, 23.0F, -7.0F); - this.floor.addBox(0.0F, 0.0F, 0.0F, 14, 1, 14, 0.0F); - - for(int i = 0; i < this.innerRawList.length; i++){ - this.innerRawList[i] = new ModelRenderer(this, 0, 29); - this.innerRawList[i].setRotationPoint(-6.0F, 10.0F, -6.0F); - this.innerRawList[i].addBox(0.0F, 12-i, 0.0F, 12, i+1, 12, 0.0F); - } - - this.innerDone = new ModelRenderer(this, 0, 54); - this.innerDone.setRotationPoint(-6.0F, 10.0F, -6.0F); - this.innerDone.addBox(0.0F, 0.0F, 0.0F, 12, 13, 12, 0.0F); - } - - @Override - public void render(float f){ - this.wallThree.render(f); - this.wallFour.render(f); - this.wallOne.render(f); - this.wallTwo.render(f); - this.floor.render(f); - } - - @Override - public void renderExtra(float f, TileEntity tile){ - //Hehe - if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getName())){ - GlStateManager.translate(0F, 1F, 0F); - } - - if(tile instanceof TileEntityCompost){ - ItemStack stack = ((TileEntityCompost)tile).getStackInSlot(0); - if(stack != null){ - if(stack.getItem() == InitItems.itemFertilizer){ - this.innerDone.render(f); - } - else{ - int heightToDisplay = stack.stackSize*13/TileEntityCompost.AMOUNT; - if(heightToDisplay > 13){ - heightToDisplay = 13; - } - - this.innerRawList[heightToDisplay-1].render(f); - } - } - } - }*/ -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java index 94558417a..12d081624 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java @@ -1,11 +1,11 @@ /* - * This file ("BookletUtils.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletUtils.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet; @@ -19,13 +19,20 @@ import de.ellpeck.actuallyadditions.mod.booklet.button.BookmarkButton; import de.ellpeck.actuallyadditions.mod.booklet.button.IndexButton; import de.ellpeck.actuallyadditions.mod.booklet.button.TexturedButton; import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryAllSearch; +import de.ellpeck.actuallyadditions.mod.booklet.entry.EntrySet; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; -import de.ellpeck.actuallyadditions.mod.util.*; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; import net.minecraft.stats.Achievement; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import java.awt.*; import java.net.URI; @@ -33,7 +40,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -public class BookletUtils{ +public final class BookletUtils{ /** * Tries to open a URL in the Browser @@ -51,7 +58,7 @@ public class BookletUtils{ public static void openBrowser(String url, String shiftUrl){ try{ if(Desktop.isDesktopSupported()){ - if(shiftUrl.equals(url) || KeyUtil.isShiftPressed()){ + if(shiftUrl.equals(url) || GuiScreen.isShiftKeyDown()){ Desktop.getDesktop().browse(new URI(shiftUrl)); } else{ @@ -68,17 +75,17 @@ public class BookletUtils{ * Draws the Title of the current chapter, current index entry or just "Actually Additions" if neither is present */ public static void drawTitle(GuiBooklet booklet){ - booklet.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); + booklet.mc.getTextureManager().bindTexture(GuiBooklet.RES_LOC); //Upper title booklet.drawTexturedModalRect(booklet.guiLeft+booklet.xSize/2-142/2, booklet.guiTop-12, 0, 240, 142, 12); //Lower title booklet.drawTexturedModalRect(booklet.guiLeft+booklet.xSize/2-142/2, booklet.guiTop+booklet.ySize, 0, 243, 142, 13); //Draw No Entry title - if(booklet.currentEntrySet.entry == null){ - String strg = EnumChatFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.manualName.1"); + if(booklet.currentEntrySet.getCurrentEntry() == null){ + String strg = TextFormatting.DARK_GREEN+StringUtil.localize(booklet.bookletName); booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+12, 0); - strg = EnumChatFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.manualName.2"); + strg = TextFormatting.DARK_GREEN+StringUtil.localize("info."+ModUtil.MOD_ID+".booklet.manualName.2"); booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+12+booklet.getFontRenderer().FONT_HEIGHT, 0); String version; @@ -92,17 +99,20 @@ public class BookletUtils{ else if(playerName.equals("KittyVanCat")){ version = "Cat's Edition"; } + else if(playerName.equals("canitzp")){ + version = "P's Edition"; + } else if(playerName.equals("Ellpeck") || Util.isDevVersion()){ version = "Dev's Edition"; } else{ - version = StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".booklet.edition")+" "+ModUtil.VERSION.substring(ModUtil.VERSION.indexOf("r")+1); + version = StringUtil.localize("info."+ModUtil.MOD_ID+".booklet.edition")+" "+ModUtil.VERSION.substring(ModUtil.VERSION.indexOf("r")+1); } - strg = EnumChatFormatting.GOLD+EnumChatFormatting.ITALIC.toString()+"-"+version+"-"; + strg = TextFormatting.GOLD+TextFormatting.ITALIC.toString()+"-"+version+"-"; booklet.getFontRenderer().drawString(strg, booklet.guiLeft+booklet.xSize/2-booklet.getFontRenderer().getStringWidth(strg)/2-3, booklet.guiTop+33, 0); } - String strg = booklet.currentEntrySet.chapter == null ? (booklet.currentEntrySet.entry == null ? StringUtil.localize("itemGroup."+ModUtil.MOD_ID_LOWER) : booklet.currentEntrySet.entry.getLocalizedName()) : booklet.currentEntrySet.chapter.getLocalizedName(); + String strg = booklet.currentEntrySet.getCurrentChapter() == null ? (booklet.currentEntrySet.getCurrentEntry() == null ? StringUtil.localize("itemGroup."+ModUtil.MOD_ID) : booklet.currentEntrySet.getCurrentEntry().getLocalizedName()) : booklet.currentEntrySet.getCurrentChapter().getLocalizedName(); booklet.drawCenteredString(booklet.getFontRenderer(), strg, booklet.guiLeft+booklet.xSize/2, booklet.guiTop-9, StringUtil.DECIMAL_COLOR_WHITE); } @@ -112,19 +122,19 @@ public class BookletUtils{ * @param pre If the hover info texts or the icon should be drawn */ public static void drawAchievementInfo(GuiBooklet booklet, boolean pre, int mouseX, int mouseY){ - if(booklet.currentEntrySet.chapter == null){ + if(booklet.currentEntrySet.getCurrentChapter() == null){ return; } ArrayList infoList = null; - for(BookletPage page : booklet.currentEntrySet.chapter.getPages()){ + for(BookletPage page : booklet.currentEntrySet.getCurrentChapter().getPages()){ if(page != null && page.getItemStacksForPage() != null){ for(ItemStack stack : page.getItemStacksForPage()){ if(stack != null){ - for(Achievement achievement : InitAchievements.achievementList){ + for(Achievement achievement : InitAchievements.ACHIEVEMENT_LIST){ if(achievement.theItemStack != null && ItemUtil.areItemsEqual(stack, achievement.theItemStack, true)){ if(pre){ - booklet.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); + booklet.mc.getTextureManager().bindTexture(GuiBooklet.RES_LOC); booklet.drawTexturedModalRect(booklet.guiLeft+booklet.xSize+1, booklet.guiTop-18, 166, 154, 22, 21); return; } @@ -132,10 +142,10 @@ public class BookletUtils{ if(mouseX >= booklet.guiLeft+booklet.xSize+1 && mouseX < booklet.guiLeft+booklet.xSize+1+22 && mouseY >= booklet.guiTop-18 && mouseY < booklet.guiTop-18+21){ if(infoList == null){ infoList = new ArrayList(); - infoList.add(EnumChatFormatting.GOLD+"Achievements related to this chapter:"); + infoList.add(TextFormatting.GOLD+"Achievements related to this chapter:"); } infoList.add("-"+StringUtil.localize(achievement.statId)); - infoList.add(EnumChatFormatting.GRAY+"("+achievement.getDescription()+")"); + infoList.add(TextFormatting.GRAY+"("+achievement.getDescription()+")"); } } } @@ -157,31 +167,30 @@ public class BookletUtils{ * -the amount of words and chars in the index (Just for teh lulz) */ public static void renderPre(GuiBooklet booklet, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - if(booklet.currentEntrySet.entry != null){ + if(booklet.currentEntrySet.getCurrentEntry() != null){ //Renders Booklet Page Number and Content - if(booklet.currentEntrySet.chapter != null && booklet.currentEntrySet.page != null){ - booklet.drawCenteredString(booklet.getFontRenderer(), booklet.currentEntrySet.page.getID()+"/"+booklet.currentEntrySet.chapter.getPages().length, booklet.guiLeft+booklet.xSize/2, booklet.guiTop+172, StringUtil.DECIMAL_COLOR_WHITE); - booklet.currentEntrySet.page.renderPre(booklet, mouseX, mouseY, ticksElapsed, mousePressed); + if(booklet.currentEntrySet.getCurrentChapter() != null && booklet.currentEntrySet.getCurrentPage() != null){ + booklet.drawCenteredString(booklet.getFontRenderer(), booklet.currentEntrySet.getCurrentPage().getID()+"/"+booklet.currentEntrySet.getCurrentChapter().getPages().length, booklet.guiLeft+booklet.xSize/2, booklet.guiTop+171, StringUtil.DECIMAL_COLOR_WHITE); + booklet.currentEntrySet.getCurrentPage().renderPre(booklet, mouseX, mouseY, ticksElapsed, mousePressed); } //Renders Chapter Page Number else{ - booklet.drawCenteredString(booklet.getFontRenderer(), booklet.currentEntrySet.pageInIndex+"/"+booklet.indexPageAmount, booklet.guiLeft+booklet.xSize/2, booklet.guiTop+172, StringUtil.DECIMAL_COLOR_WHITE); + booklet.drawCenteredString(booklet.getFontRenderer(), booklet.currentEntrySet.getPageInIndex()+"/"+booklet.indexPageAmount, booklet.guiLeft+booklet.xSize/2, booklet.guiTop+171, StringUtil.DECIMAL_COLOR_WHITE); } } //Renders the amount of words and chars the book has else{ - String wordCountString = StringUtil.localizeFormatted("booklet."+ModUtil.MOD_ID_LOWER+".amountOfWords", ClientProxy.bookletWordCount); - booklet.getFontRenderer().drawString(EnumChatFormatting.ITALIC+wordCountString, booklet.guiLeft+booklet.xSize-booklet.getFontRenderer().getStringWidth(wordCountString)-15, booklet.guiTop+booklet.ySize-18-booklet.getFontRenderer().FONT_HEIGHT, 0); + String wordCountString = StringUtil.localizeFormatted("booklet."+ModUtil.MOD_ID+".amountOfWords", ClientProxy.bookletWordCount); + booklet.getFontRenderer().drawString(TextFormatting.ITALIC+wordCountString, booklet.guiLeft+booklet.xSize-booklet.getFontRenderer().getStringWidth(wordCountString)-15, booklet.guiTop+booklet.ySize-18-booklet.getFontRenderer().FONT_HEIGHT, 0); - String charCountString = StringUtil.localizeFormatted("booklet."+ModUtil.MOD_ID_LOWER+".amountOfChars", ClientProxy.bookletCharCount); - booklet.getFontRenderer().drawString(EnumChatFormatting.ITALIC+charCountString, booklet.guiLeft+booklet.xSize-booklet.getFontRenderer().getStringWidth(charCountString)-15, booklet.guiTop+booklet.ySize-18, 0); + String charCountString = StringUtil.localizeFormatted("booklet."+ModUtil.MOD_ID+".amountOfChars", ClientProxy.bookletCharCount); + booklet.getFontRenderer().drawString(TextFormatting.ITALIC+charCountString, booklet.guiLeft+booklet.xSize-booklet.getFontRenderer().getStringWidth(charCountString)-15, booklet.guiTop+booklet.ySize-18, 0); } } /** * Draws all of the hovering texts for the buttons that need explanation in the booklet */ - @SuppressWarnings("unchecked") public static void doHoverTexts(GuiBooklet booklet, int mouseX, int mouseY){ //Update all of the buttons' hovering texts for(Object button : booklet.getButtonList()){ @@ -192,9 +201,6 @@ public class BookletUtils{ else if(button instanceof TexturedButton){ booklet.drawHoveringText(((TexturedButton)button).textList, mouseX, mouseY); } - else if(button instanceof IndexButton){ - ((IndexButton)button).drawHover(mouseX, mouseY); - } } } } @@ -202,10 +208,9 @@ public class BookletUtils{ /** * Updates the search bar, should be called when it is getting typed into */ - @SuppressWarnings("unchecked") public static void updateSearchBar(GuiBooklet booklet){ - if(booklet.currentEntrySet.entry instanceof BookletEntryAllSearch){ - BookletEntryAllSearch currentEntry = (BookletEntryAllSearch)booklet.currentEntrySet.entry; + if(booklet.currentEntrySet.getCurrentEntry() instanceof BookletEntryAllSearch){ + BookletEntryAllSearch currentEntry = (BookletEntryAllSearch)booklet.currentEntrySet.getCurrentEntry(); if(booklet.searchField.getText() != null && !booklet.searchField.getText().isEmpty()){ currentEntry.chapters.clear(); @@ -219,7 +224,7 @@ public class BookletUtils{ else{ currentEntry.setChapters((ArrayList)currentEntry.allChapters.clone()); } - openIndexEntry(booklet, booklet.currentEntrySet.entry, booklet.currentEntrySet.pageInIndex, false); + openIndexEntry(booklet, booklet.currentEntrySet.getCurrentEntry(), booklet.currentEntrySet.getPageInIndex(), false); } } @@ -228,7 +233,7 @@ public class BookletUtils{ ItemStack[] pageStacks = page.getItemStacksForPage(); if(pageStacks != null){ for(ItemStack stack : pageStacks){ - if(stack.getDisplayName().toLowerCase(Locale.ROOT).contains(text)){ + if(stack != null && stack.getDisplayName().toLowerCase(Locale.ROOT).contains(text)){ return true; } } @@ -237,7 +242,6 @@ public class BookletUtils{ return false; } - @SuppressWarnings("unchecked") public static void openIndexEntry(GuiBooklet booklet, IBookletEntry entry, int page, boolean resetTextField){ booklet.searchField.setVisible(entry instanceof BookletEntryAllSearch); booklet.searchField.setFocused(entry instanceof BookletEntryAllSearch); @@ -248,25 +252,30 @@ public class BookletUtils{ } } - booklet.currentEntrySet.page = null; - booklet.currentEntrySet.chapter = null; + if(booklet.currentEntrySet.getCurrentPage() != null){ + booklet.currentEntrySet.getCurrentPage().onClosed(booklet); + } + booklet.currentEntrySet.setPage(null); + booklet.currentEntrySet.setChapter(null); - booklet.currentEntrySet.entry = entry; + booklet.currentEntrySet.setEntry(entry); booklet.indexPageAmount = entry == null ? 1 : entry.getChapters().size()/booklet.chapterButtons.length+1; - booklet.currentEntrySet.pageInIndex = entry == null ? 1 : (booklet.indexPageAmount <= page || page <= 0 ? booklet.indexPageAmount : page); + booklet.currentEntrySet.setPageInIndex(entry == null ? 1 : (booklet.indexPageAmount <= page || page <= 0 ? booklet.indexPageAmount : page)); booklet.buttonPreviousScreen.visible = entry != null; - booklet.buttonForward.visible = booklet.currentEntrySet.pageInIndex < booklet.indexPageAmount; - booklet.buttonBackward.visible = booklet.currentEntrySet.pageInIndex > 1; + booklet.buttonForward.visible = booklet.currentEntrySet.getPageInIndex() < booklet.indexPageAmount; + booklet.buttonBackward.visible = booklet.currentEntrySet.getPageInIndex() > 1; + + booklet.buttonViewOnline.visible = false; for(int i = 0; i < booklet.chapterButtons.length; i++){ IndexButton button = (IndexButton)booklet.chapterButtons[i]; if(entry == null){ if(i >= GuiBooklet.INDEX_BUTTONS_OFFSET){ - boolean entryExists = ActuallyAdditionsAPI.bookletEntries.size() > i-GuiBooklet.INDEX_BUTTONS_OFFSET; + boolean entryExists = ActuallyAdditionsAPI.BOOKLET_ENTRIES.size() > i-GuiBooklet.INDEX_BUTTONS_OFFSET; button.visible = entryExists; if(entryExists){ - button.displayString = ActuallyAdditionsAPI.bookletEntries.get(i-GuiBooklet.INDEX_BUTTONS_OFFSET).getLocalizedNameWithFormatting(); + button.displayString = "- "+ActuallyAdditionsAPI.BOOKLET_ENTRIES.get(i-GuiBooklet.INDEX_BUTTONS_OFFSET).getLocalizedNameWithFormatting(); button.chap = null; } } @@ -275,15 +284,17 @@ public class BookletUtils{ } } else{ - boolean entryExists = entry.getChapters().size() > i+(booklet.chapterButtons.length*booklet.currentEntrySet.pageInIndex-booklet.chapterButtons.length); + boolean entryExists = entry.getChapters().size() > i+(booklet.chapterButtons.length*booklet.currentEntrySet.getPageInIndex()-booklet.chapterButtons.length); button.visible = entryExists; if(entryExists){ - IBookletChapter chap = entry.getChapters().get(i+(booklet.chapterButtons.length*booklet.currentEntrySet.pageInIndex-booklet.chapterButtons.length)); + IBookletChapter chap = entry.getChapters().get(i+(booklet.chapterButtons.length*booklet.currentEntrySet.getPageInIndex()-booklet.chapterButtons.length)); button.displayString = chap.getLocalizedNameWithFormatting(); button.chap = chap; } } } + + booklet.shouldSaveDataNextClose = true; } /** @@ -292,17 +303,17 @@ public class BookletUtils{ public static void handleChapterButtonClick(GuiBooklet booklet, GuiButton button){ int place = Util.arrayContains(booklet.chapterButtons, button); if(place >= 0){ - if(booklet.currentEntrySet.entry != null){ - if(booklet.currentEntrySet.chapter == null){ - if(place < booklet.currentEntrySet.entry.getChapters().size()){ - IBookletChapter chap = booklet.currentEntrySet.entry.getChapters().get(place+(booklet.chapterButtons.length*booklet.currentEntrySet.pageInIndex-booklet.chapterButtons.length)); + if(booklet.currentEntrySet.getCurrentEntry() != null){ + if(booklet.currentEntrySet.getCurrentChapter() == null){ + if(place < booklet.currentEntrySet.getCurrentEntry().getChapters().size()){ + IBookletChapter chap = booklet.currentEntrySet.getCurrentEntry().getChapters().get(place+(booklet.chapterButtons.length*booklet.currentEntrySet.getPageInIndex()-booklet.chapterButtons.length)); openChapter(booklet, chap, chap.getPages()[0]); } } } else{ - if(place-GuiBooklet.INDEX_BUTTONS_OFFSET < ActuallyAdditionsAPI.bookletEntries.size()){ - openIndexEntry(booklet, ActuallyAdditionsAPI.bookletEntries.get(place-GuiBooklet.INDEX_BUTTONS_OFFSET), 1, true); + if(place-GuiBooklet.INDEX_BUTTONS_OFFSET < ActuallyAdditionsAPI.BOOKLET_ENTRIES.size()){ + openIndexEntry(booklet, ActuallyAdditionsAPI.BOOKLET_ENTRIES.get(place-GuiBooklet.INDEX_BUTTONS_OFFSET), 1, true); } } } @@ -313,7 +324,7 @@ public class BookletUtils{ * Can only be done when the chapter is not null and an index entry is opened in the booklet */ public static void openChapter(GuiBooklet booklet, IBookletChapter chapter, BookletPage page){ - if(chapter == null || booklet.currentEntrySet.entry == null){ + if(chapter == null || booklet.currentEntrySet.getCurrentEntry() == null){ return; } @@ -321,16 +332,26 @@ public class BookletUtils{ booklet.searchField.setFocused(false); booklet.searchField.setText(""); - booklet.currentEntrySet.chapter = chapter; - booklet.currentEntrySet.page = page != null && doesChapterHavePage(chapter, page) ? page : chapter.getPages()[0]; + booklet.currentEntrySet.setChapter(chapter); - booklet.buttonForward.visible = getNextPage(chapter, booklet.currentEntrySet.page) != null; - booklet.buttonBackward.visible = getPrevPage(chapter, booklet.currentEntrySet.page) != null; + if(booklet.currentEntrySet.getCurrentPage() != null){ + booklet.currentEntrySet.getCurrentPage().onClosed(booklet); + } + BookletPage pageToSet = page != null && doesChapterHavePage(chapter, page) ? page : chapter.getPages()[0]; + booklet.currentEntrySet.setPage(pageToSet); + pageToSet.onOpened(booklet); + + booklet.buttonForward.visible = getNextPage(chapter, booklet.currentEntrySet.getCurrentPage()) != null; + booklet.buttonBackward.visible = getPrevPage(chapter, booklet.currentEntrySet.getCurrentPage()) != null; booklet.buttonPreviousScreen.visible = true; + booklet.buttonViewOnline.visible = true; + for(GuiButton chapterButton : booklet.chapterButtons){ chapterButton.visible = false; } + + booklet.shouldSaveDataNextClose = true; } /** @@ -377,44 +398,52 @@ public class BookletUtils{ * Called when the "next page"-button is pressed */ public static void handleNextPage(GuiBooklet booklet){ - if(booklet.currentEntrySet.entry != null){ - if(booklet.currentEntrySet.page != null){ - BookletPage page = getNextPage(booklet.currentEntrySet.chapter, booklet.currentEntrySet.page); + if(booklet.currentEntrySet.getCurrentEntry() != null){ + if(booklet.currentEntrySet.getCurrentPage() != null){ + BookletPage page = getNextPage(booklet.currentEntrySet.getCurrentChapter(), booklet.currentEntrySet.getCurrentPage()); if(page != null){ - booklet.currentEntrySet.page = page; + booklet.currentEntrySet.getCurrentPage().onClosed(booklet); + booklet.currentEntrySet.setPage(page); + page.onOpened(booklet); } - booklet.buttonForward.visible = getNextPage(booklet.currentEntrySet.chapter, booklet.currentEntrySet.page) != null; - booklet.buttonBackward.visible = getPrevPage(booklet.currentEntrySet.chapter, booklet.currentEntrySet.page) != null; + booklet.buttonForward.visible = getNextPage(booklet.currentEntrySet.getCurrentChapter(), booklet.currentEntrySet.getCurrentPage()) != null; + booklet.buttonBackward.visible = getPrevPage(booklet.currentEntrySet.getCurrentChapter(), booklet.currentEntrySet.getCurrentPage()) != null; } else{ - if(booklet.currentEntrySet.pageInIndex+1 <= booklet.indexPageAmount){ - openIndexEntry(booklet, booklet.currentEntrySet.entry, booklet.currentEntrySet.pageInIndex+1, !(booklet.currentEntrySet.entry instanceof BookletEntryAllSearch)); + if(booklet.currentEntrySet.getPageInIndex()+1 <= booklet.indexPageAmount){ + openIndexEntry(booklet, booklet.currentEntrySet.getCurrentEntry(), booklet.currentEntrySet.getPageInIndex()+1, !(booklet.currentEntrySet.getCurrentEntry() instanceof BookletEntryAllSearch)); } } } + + booklet.shouldSaveDataNextClose = true; } /** * Called when the "previous page"-button is pressed */ public static void handlePreviousPage(GuiBooklet booklet){ - if(booklet.currentEntrySet.entry != null){ - if(booklet.currentEntrySet.page != null){ - BookletPage page = getPrevPage(booklet.currentEntrySet.chapter, booklet.currentEntrySet.page); + if(booklet.currentEntrySet.getCurrentEntry() != null){ + if(booklet.currentEntrySet.getCurrentPage() != null){ + BookletPage page = getPrevPage(booklet.currentEntrySet.getCurrentChapter(), booklet.currentEntrySet.getCurrentPage()); if(page != null){ - booklet.currentEntrySet.page = page; + booklet.currentEntrySet.getCurrentPage().onClosed(booklet); + booklet.currentEntrySet.setPage(page); + page.onOpened(booklet); } - booklet.buttonForward.visible = getNextPage(booklet.currentEntrySet.chapter, booklet.currentEntrySet.page) != null; - booklet.buttonBackward.visible = getPrevPage(booklet.currentEntrySet.chapter, booklet.currentEntrySet.page) != null; + booklet.buttonForward.visible = getNextPage(booklet.currentEntrySet.getCurrentChapter(), booklet.currentEntrySet.getCurrentPage()) != null; + booklet.buttonBackward.visible = getPrevPage(booklet.currentEntrySet.getCurrentChapter(), booklet.currentEntrySet.getCurrentPage()) != null; } else{ - if(booklet.currentEntrySet.pageInIndex-1 > 0){ - openIndexEntry(booklet, booklet.currentEntrySet.entry, booklet.currentEntrySet.pageInIndex-1, !(booklet.currentEntrySet.entry instanceof BookletEntryAllSearch)); + if(booklet.currentEntrySet.getPageInIndex()-1 > 0){ + openIndexEntry(booklet, booklet.currentEntrySet.getCurrentEntry(), booklet.currentEntrySet.getPageInIndex()-1, !(booklet.currentEntrySet.getCurrentEntry() instanceof BookletEntryAllSearch)); } } } + + booklet.shouldSaveDataNextClose = true; } public static BookletPage getFirstPageForStack(ItemStack stack){ @@ -424,11 +453,57 @@ public class BookletUtils{ public static ArrayList getPagesForStack(ItemStack stack){ ArrayList possiblePages = new ArrayList(); - for(BookletPage page : ActuallyAdditionsAPI.bookletPagesWithItemStackData){ + for(BookletPage page : ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_DATA){ if(ItemUtil.contains(page.getItemStacksForPage(), stack, page.arePageStacksWildcard)){ possiblePages.add(page); } } return possiblePages; } + + public static void saveBookPage(GuiBooklet gui, NBTTagCompound compound){ + //Save Entry etc. + compound.setTag("SavedEntry", gui.currentEntrySet.writeToNBT()); + compound.setString("SearchWord", gui.searchField.getText()); + + //Save Bookmarks + NBTTagList list = new NBTTagList(); + for(int i = 0; i < gui.bookmarkButtons.length; i++){ + BookmarkButton button = (BookmarkButton)gui.bookmarkButtons[i]; + + list.appendTag(button.assignedEntry.writeToNBT()); + } + compound.setTag("Bookmarks", list); + } + + public static void openLastBookPage(GuiBooklet gui, NBTTagCompound compound){ + //Open Entry etc. + EntrySet set = EntrySet.readFromNBT(compound.getCompoundTag("SavedEntry")); + if(set != null){ + + BookletUtils.openIndexEntry(gui, set.entry, set.pageInIndex, true); + if(set.chapter != null){ + BookletUtils.openChapter(gui, set.chapter, set.page); + } + + String searchText = compound.getString("SearchWord"); + if(!searchText.isEmpty()){ + gui.searchField.setText(searchText); + BookletUtils.updateSearchBar(gui); + } + } + else{ + //If everything fails, initialize the front page + BookletUtils.openIndexEntry(gui, null, 1, true); + } + + //Load Bookmarks + NBTTagList list = compound.getTagList("Bookmarks", 10); + if(list != null){ + for(int i = 0; i < list.tagCount(); i++){ + BookmarkButton button = (BookmarkButton)gui.bookmarkButtons[i]; + button.assignedEntry = EntrySet.readFromNBT(list.getCompoundTagAt(i)); + } + } + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiAAAchievements.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiAAAchievements.java index ccbae9e75..b46478423 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiAAAchievements.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiAAAchievements.java @@ -1,11 +1,11 @@ /* - * This file ("GuiAAAchievements.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiAAAchievements.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet; @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.achievement.GuiAchievements; -import net.minecraft.stats.StatFileWriter; +import net.minecraft.stats.StatisticsManager; import net.minecraftforge.fml.relauncher.ReflectionHelper; /** @@ -22,8 +22,8 @@ import net.minecraftforge.fml.relauncher.ReflectionHelper; */ public class GuiAAAchievements extends GuiAchievements{ - public GuiAAAchievements(GuiScreen screen, StatFileWriter writer){ - super(screen, writer); + public GuiAAAchievements(GuiScreen screen, StatisticsManager statistics){ + super(screen, statistics); try{ ReflectionHelper.setPrivateValue(GuiAchievements.class, this, InitAchievements.pageNumber, 20); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java index e1e4de69d..9a04aae48 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java @@ -1,31 +1,37 @@ /* - * This file ("GuiBooklet.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiBooklet.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.internal.EntrySet; +import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.internal.IBookletGui; +import de.ellpeck.actuallyadditions.api.internal.IEntrySet; import de.ellpeck.actuallyadditions.mod.booklet.button.BookmarkButton; import de.ellpeck.actuallyadditions.mod.booklet.button.IndexButton; import de.ellpeck.actuallyadditions.mod.booklet.button.TexturedButton; import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryAllSearch; +import de.ellpeck.actuallyadditions.mod.booklet.entry.EntrySet; import de.ellpeck.actuallyadditions.mod.config.GuiConfiguration; +import de.ellpeck.actuallyadditions.mod.data.PlayerData; import de.ellpeck.actuallyadditions.mod.items.ItemBooklet; +import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; +import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; import de.ellpeck.actuallyadditions.mod.update.UpdateChecker; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentClientData; +import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.FontRenderer; @@ -33,10 +39,13 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.input.Keyboard; @@ -50,19 +59,24 @@ import java.util.List; @SideOnly(Side.CLIENT) public class GuiBooklet extends GuiScreen implements IBookletGui{ - public static final ResourceLocation resLoc = AssetUtil.getBookletGuiLocation("guiBooklet"); - public static final ResourceLocation resLocHalloween = AssetUtil.getBookletGuiLocation("guiBookletHalloween"); - public static final ResourceLocation resLocChristmas = AssetUtil.getBookletGuiLocation("guiBookletChristmas"); - public static final ResourceLocation resLocValentine = AssetUtil.getBookletGuiLocation("guiBookletValentinesDay"); + public static final ResourceLocation RES_LOC = AssetUtil.getBookletGuiLocation("guiBooklet"); + public static final ResourceLocation RES_LOC_HALLOWEEN = AssetUtil.getBookletGuiLocation("guiBookletHalloween"); + public static final ResourceLocation RES_LOC_CHRISTMAS = AssetUtil.getBookletGuiLocation("guiBookletChristmas"); + public static final ResourceLocation RES_LOC_VALENTINE = AssetUtil.getBookletGuiLocation("guiBookletValentinesDay"); public static final int CHAPTER_BUTTONS_AMOUNT = 13; public static final int INDEX_BUTTONS_OFFSET = 3; private static final int[] AND_HIS_NAME_IS = new int[]{Keyboard.KEY_C, Keyboard.KEY_E, Keyboard.KEY_N, Keyboard.KEY_A}; - public int xSize; - public int ySize; + public final int xSize; + public final int ySize; + public final IEntrySet currentEntrySet = new EntrySet(null); + public final GuiButton[] chapterButtons = new GuiButton[CHAPTER_BUTTONS_AMOUNT]; + public final GuiButton[] bookmarkButtons = new GuiButton[8]; + public final GuiScreen parentScreen; + private final boolean tryOpenMainPage; + private final boolean saveOnClose; public int guiLeft; public int guiTop; - public EntrySet currentEntrySet = new EntrySet(null); public int indexPageAmount; public GuiButton buttonForward; public GuiButton buttonBackward; @@ -73,15 +87,14 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ public GuiButton buttonAchievements; public GuiButton buttonConfig; public GuiButton buttonWebsite; - public GuiButton[] chapterButtons = new GuiButton[CHAPTER_BUTTONS_AMOUNT]; - public GuiButton[] bookmarkButtons = new GuiButton[8]; + public GuiButton buttonPatreon; + public GuiButton buttonViewOnline; public GuiTextField searchField; - public GuiScreen parentScreen; + public boolean shouldSaveDataNextClose; private int ticksElapsed; private boolean mousePressed; - private boolean tryOpenMainPage; - private boolean saveOnClose; private int hisNameIsAt; + public String bookletName; public GuiBooklet(GuiScreen parentScreen, boolean tryOpenMainPage, boolean saveOnClose){ this.xSize = 146; @@ -95,6 +108,7 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ return this.fontRendererObj; } + @Override public List getButtonList(){ return this.buttonList; } @@ -117,12 +131,12 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ //Draws the Background GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(ClientProxy.jingleAllTheWay ? resLocChristmas : (ClientProxy.pumpkinBlurPumpkinBlur ? resLocHalloween : (ClientProxy.bulletForMyValentine ? resLocValentine : resLoc))); + this.mc.getTextureManager().bindTexture(ClientProxy.jingleAllTheWay ? RES_LOC_CHRISTMAS : (ClientProxy.pumpkinBlurPumpkinBlur ? RES_LOC_HALLOWEEN : (ClientProxy.bulletForMyValentine ? RES_LOC_VALENTINE : RES_LOC))); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); //Draws the search bar - if(this.currentEntrySet.entry instanceof BookletEntryAllSearch && this.currentEntrySet.chapter == null){ - this.mc.getTextureManager().bindTexture(resLoc); + if(this.currentEntrySet.getCurrentEntry() instanceof BookletEntryAllSearch && this.currentEntrySet.getCurrentChapter() == null){ + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft+146, this.guiTop+160, 146, 80, 70, 14); } @@ -137,59 +151,63 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ //Pre-Renders the current page's content etc. BookletUtils.renderPre(this, x, y, this.ticksElapsed, this.mousePressed); - //Does vanilla drawing stuff - super.drawScreen(x, y, f); + //Buttons and search field + if(this.currentEntrySet.getCurrentPage() != null){ + this.fontRendererObj.setUnicodeFlag(false); + } + for(GuiButton button : this.buttonList){ + button.drawButton(this.mc, x, y); + } + this.fontRendererObj.setUnicodeFlag(true); + this.searchField.drawTextBox(); //Renders the current page's content - if(this.currentEntrySet.entry != null && this.currentEntrySet.chapter != null && this.currentEntrySet.page != null){ - this.currentEntrySet.page.render(this, x, y, this.ticksElapsed, this.mousePressed); + if(this.currentEntrySet.getCurrentEntry() != null && this.currentEntrySet.getCurrentChapter() != null && this.currentEntrySet.getCurrentPage() != null){ + this.currentEntrySet.getCurrentPage().render(this, x, y, this.ticksElapsed, this.mousePressed); } //Draws hovering texts for buttons this.fontRendererObj.setUnicodeFlag(false); BookletUtils.doHoverTexts(this, x, y); BookletUtils.drawAchievementInfo(this, false, x, y); - this.fontRendererObj.setUnicodeFlag(true); this.fontRendererObj.setUnicodeFlag(unicodeBefore); //Resets mouse - if(this.mousePressed){ - this.mousePressed = false; - } + this.mousePressed = false; } @Override public void keyTyped(char theChar, int key){ - if(key == Keyboard.KEY_ESCAPE){ - if(this.parentScreen != null){ - this.mc.displayGuiScreen(this.parentScreen); - } - else{ - this.mc.displayGuiScreen(null); - this.mc.setIngameFocus(); - } - } - else if(this.searchField.isFocused()){ - this.searchField.textboxKeyTyped(theChar, key); - BookletUtils.updateSearchBar(this); - } - else{ - if(AND_HIS_NAME_IS.length > this.hisNameIsAt && AND_HIS_NAME_IS[this.hisNameIsAt] == key){ - if(this.hisNameIsAt+1 >= AND_HIS_NAME_IS.length){ - Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation(ModUtil.MOD_ID_LOWER, "duhDuhDuhDuuuh"))); - ModUtil.LOGGER.info("AND HIS NAME IS JOHN CENA DUH DUH DUH DUUUH"); - this.hisNameIsAt = 0; - } - else{ - this.hisNameIsAt++; - } - } - else{ + if(!this.searchField.isFocused() && AND_HIS_NAME_IS.length > this.hisNameIsAt && AND_HIS_NAME_IS[this.hisNameIsAt] == key){ + if(this.hisNameIsAt+1 >= AND_HIS_NAME_IS.length){ + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundHandler.duhDuhDuhDuuuh, 0.5F)); + ModUtil.LOGGER.info("AND HIS NAME IS JOHN CENA DUH DUH DUH DUUUH"); this.hisNameIsAt = 0; } + else{ + this.hisNameIsAt++; + } } + else{ + this.hisNameIsAt = 0; + + if(key == Keyboard.KEY_ESCAPE || (key == this.mc.gameSettings.keyBindInventory.getKeyCode() && !this.searchField.isFocused())){ + if(this.parentScreen != null){ + this.mc.displayGuiScreen(this.parentScreen); + } + else{ + this.mc.displayGuiScreen(null); + this.mc.setIngameFocus(); + } + } + else if(this.searchField.isFocused()){ + this.searchField.textboxKeyTyped(theChar, key); + BookletUtils.updateSearchBar(this); + } + } + } @Override @@ -201,13 +219,13 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ protected void mouseClicked(int par1, int par2, int par3) throws IOException{ this.searchField.mouseClicked(par1, par2, par3); //Left mouse button - if(par3 == 0 && this.currentEntrySet.chapter != null){ + if(par3 == 0 && this.currentEntrySet.getCurrentChapter() != null){ this.mousePressed = true; } //Right mouse button else if(par3 == 1){ - if(this.currentEntrySet.chapter != null){ - BookletUtils.openIndexEntry(this, this.currentEntrySet.entry, this.currentEntrySet.pageInIndex, true); + if(this.currentEntrySet.getCurrentChapter() != null){ + BookletUtils.openIndexEntry(this, this.currentEntrySet.getCurrentEntry(), this.currentEntrySet.getPageInIndex(), true); } else{ BookletUtils.openIndexEntry(this, null, 1, true); @@ -218,16 +236,33 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ @Override public void actionPerformed(GuiButton button){ + if(this.currentEntrySet.getCurrentPage() != null){ + if(this.currentEntrySet.getCurrentPage().onActionPerformed(this, button)){ + return; + } + } + //Handles update if(button == this.buttonUpdate){ if(UpdateChecker.needsUpdateNotify){ BookletUtils.openBrowser(UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK); } } + //Handles View Online + else if(button == this.buttonViewOnline){ + IBookletChapter chapter = this.currentEntrySet.getCurrentChapter(); + if(chapter != null){ + BookletUtils.openBrowser("http://ellpeck.de/actaddmanual/#"+chapter.getUnlocalizedName()); + } + } //Handles Website else if(button == this.buttonWebsite){ BookletUtils.openBrowser("http://ellpeck.de"); } + //Handles Patreon + else if(button == this.buttonPatreon){ + BookletUtils.openBrowser("http://www.patreon.com/Ellpeck"); + } //Handles Twitter else if(button == this.buttonTwitter){ BookletUtils.openBrowser("http://twitter.com/ActAddMod"); @@ -238,11 +273,11 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ } //Handles config else if(button == this.buttonConfig){ - mc.displayGuiScreen(new GuiConfiguration(this)); + this.mc.displayGuiScreen(new GuiConfiguration(this)); } //Handles achievements else if(button == this.buttonAchievements){ - mc.displayGuiScreen(new GuiAAAchievements(this, mc.thePlayer.getStatFileWriter())); + this.mc.displayGuiScreen(new GuiAAAchievements(this, this.mc.thePlayer.getStatFileWriter())); } else if(button == this.buttonForward){ BookletUtils.handleNextPage(this); @@ -252,8 +287,8 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ } //Handles gonig from page to chapter or from chapter to index else if(button == this.buttonPreviousScreen){ - if(this.currentEntrySet.chapter != null){ - BookletUtils.openIndexEntry(this, this.currentEntrySet.entry, this.currentEntrySet.pageInIndex, true); + if(this.currentEntrySet.getCurrentChapter() != null){ + BookletUtils.openIndexEntry(this, this.currentEntrySet.getCurrentEntry(), this.currentEntrySet.getPageInIndex(), true); } else{ BookletUtils.openIndexEntry(this, null, 1, true); @@ -268,68 +303,82 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ } } - @SuppressWarnings("unchecked") @Override public void initGui(){ + int flavor = 1; + if(Util.RANDOM.nextFloat() <= 0.1){ + flavor = MathHelper.getRandomIntegerInRange(Util.RANDOM, 2, 5); + } + this.bookletName = "info."+ModUtil.MOD_ID+".booklet.manualName.1."+flavor; + this.guiLeft = (this.width-this.xSize)/2; this.guiTop = (this.height-this.ySize)/2; - this.buttonForward = new TexturedButton(0, this.guiLeft+this.xSize-26, this.guiTop+this.ySize+1, 164, 0, 18, 10, Collections.singletonList(EnumChatFormatting.GOLD+"Next Page")); + this.buttonForward = new TexturedButton(0, this.guiLeft+this.xSize-26, this.guiTop+this.ySize+1, 164, 0, 18, 10, Collections.singletonList(TextFormatting.GOLD+"Next Page")); this.buttonList.add(this.buttonForward); - this.buttonBackward = new TexturedButton(1, this.guiLeft+8, this.guiTop+this.ySize+1, 146, 0, 18, 10, Collections.singletonList(EnumChatFormatting.GOLD+"Previous Page")); + this.buttonBackward = new TexturedButton(1, this.guiLeft+8, this.guiTop+this.ySize+1, 146, 0, 18, 10, Collections.singletonList(TextFormatting.GOLD+"Previous Page")); this.buttonList.add(this.buttonBackward); - this.buttonPreviousScreen = new TexturedButton(2, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+1, 182, 0, 15, 10, Collections.singletonList(EnumChatFormatting.GOLD+"Back")); + this.buttonPreviousScreen = new TexturedButton(2, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+1, 182, 0, 15, 10, Collections.singletonList(TextFormatting.GOLD+"Back")); this.buttonList.add(this.buttonPreviousScreen); ArrayList updateHover = new ArrayList(); if(UpdateChecker.checkFailed){ - updateHover.add(IChatComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.failed")).getFormattedText()); + updateHover.add(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID+".update.failed")).getFormattedText()); } else if(UpdateChecker.needsUpdateNotify){ - updateHover.add(IChatComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.generic")).getFormattedText()); - updateHover.add(IChatComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".update.versionCompare", ModUtil.VERSION, UpdateChecker.updateVersionString)).getFormattedText()); - updateHover.add(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.buttonOptions")); + updateHover.add(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID+".update.generic")).getFormattedText()); + updateHover.add(ITextComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".update.versionCompare", ModUtil.VERSION, UpdateChecker.updateVersionString)).getFormattedText()); + updateHover.add(StringUtil.localize("info."+ModUtil.MOD_ID+".update.buttonOptions")); } this.buttonUpdate = new TexturedButton(4, this.guiLeft-11, this.guiTop-11, 245, 0, 11, 11, updateHover); - this.buttonUpdate.visible = UpdateChecker.needsUpdateNotify; + this.buttonUpdate.visible = UpdateChecker.needsUpdateNotify || UpdateChecker.checkFailed; this.buttonList.add(this.buttonUpdate); - this.buttonTwitter = new TexturedButton(5, this.guiLeft, this.guiTop, 213, 0, 8, 8, Collections.singletonList(EnumChatFormatting.GOLD+"Open @ActAddMod on Twitter in Browser")); + this.buttonTwitter = new TexturedButton(5, this.guiLeft, this.guiTop+10, 213, 0, 8, 8, Collections.singletonList(TextFormatting.GOLD+"Open @ActAddMod on Twitter in Browser")); this.buttonList.add(this.buttonTwitter); - this.buttonForum = new TexturedButton(6, this.guiLeft, this.guiTop+10, 221, 0, 8, 8, Collections.singletonList(EnumChatFormatting.GOLD+"Open Minecraft Forum Post in Browser")); + this.buttonForum = new TexturedButton(6, this.guiLeft, this.guiTop+20, 221, 0, 8, 8, Collections.singletonList(TextFormatting.GOLD+"Open Minecraft Forum Post in Browser")); this.buttonList.add(this.buttonForum); - this.buttonAchievements = new TexturedButton(7, this.guiLeft+138, this.guiTop, 205, 0, 8, 8, Collections.singletonList(EnumChatFormatting.GOLD+"Show Achievements")); + this.buttonAchievements = new TexturedButton(7, this.guiLeft+138, this.guiTop, 205, 0, 8, 8, Collections.singletonList(TextFormatting.GOLD+"Show Achievements")); this.buttonList.add(this.buttonAchievements); ArrayList websiteHover = new ArrayList(); - websiteHover.add(EnumChatFormatting.GOLD+"Open Author's Website"); + websiteHover.add(TextFormatting.GOLD+"Open Author's Website"); websiteHover.add("(There's some cool stuff there!)"); - websiteHover.add(EnumChatFormatting.GRAY+""+EnumChatFormatting.ITALIC+"Would you call this Product Placement?"); - this.buttonWebsite = new TexturedButton(-99, this.guiLeft, this.guiTop+20, 228, 0, 8, 8, websiteHover); + websiteHover.add(TextFormatting.GRAY+""+TextFormatting.ITALIC+"Would you call this Product Placement?"); + this.buttonWebsite = new TexturedButton(-99, this.guiLeft, this.guiTop+30, 229, 0, 8, 8, websiteHover); this.buttonList.add(this.buttonWebsite); + List patreonHover = new ArrayList(); + patreonHover.add("Like the mod?"); + patreonHover.add("Why don't support me on "+TextFormatting.GOLD+"Patreon"+TextFormatting.RESET+"?"); + this.buttonPatreon = new TexturedButton(-100, this.guiLeft, this.guiTop, 237, 0, 8, 8, patreonHover); + this.buttonList.add(this.buttonPatreon); + + this.buttonViewOnline = new TexturedButton(-101, this.guiLeft+146, this.guiTop+180, 245, 44, 11, 11, Collections.singletonList(TextFormatting.GOLD+"View Online")); + this.buttonList.add(this.buttonViewOnline); + ArrayList configHover = new ArrayList(); - configHover.add(EnumChatFormatting.GOLD+"Show Configuration GUI"); + configHover.add(TextFormatting.GOLD+"Show Configuration GUI"); configHover.addAll(this.fontRendererObj.listFormattedStringToWidth("It is highly recommended that you restart your game after changing anything as that prevents possible bugs occuring!", 200)); this.buttonConfig = new TexturedButton(8, this.guiLeft+138, this.guiTop+10, 197, 0, 8, 8, configHover); this.buttonList.add(this.buttonConfig); for(int i = 0; i < this.chapterButtons.length; i++){ - this.chapterButtons[i] = new IndexButton(9+i, guiLeft+15, guiTop+10+(i*12), 115, 10, "", this); + this.chapterButtons[i] = new IndexButton(9+i, this.guiLeft+15, this.guiTop+10+(i*12), 115, 10, "", this); this.buttonList.add(this.chapterButtons[i]); } for(int i = 0; i < this.bookmarkButtons.length; i++){ - int x = this.guiLeft+xSize/2-(this.bookmarkButtons.length/2*16)+(i*16); + int x = this.guiLeft+this.xSize/2-(this.bookmarkButtons.length/2*16)+(i*16); this.bookmarkButtons[i] = new BookmarkButton(this.chapterButtons[this.chapterButtons.length-1].id+1+i, x, this.guiTop+this.ySize+13, this); this.buttonList.add(this.bookmarkButtons[i]); } - this.searchField = new GuiTextField(4500, this.fontRendererObj, guiLeft+148, guiTop+162, 66, 10); + this.searchField = new GuiTextField(4500, this.fontRendererObj, this.guiLeft+148, this.guiTop+162, 66, 10); this.searchField.setMaxStringLength(30); this.searchField.setEnableBackgroundDrawing(false); this.searchField.setCanLoseFocus(false); @@ -338,14 +387,23 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ if(ItemBooklet.forcedEntry == null){ //Open last entry or introductory entry - if(this.tryOpenMainPage && !PersistentClientData.getBoolean("BookAlreadyOpened")){ - BookletUtils.openIndexEntry(this, InitBooklet.chapterIntro.entry, 1, true); - BookletUtils.openChapter(this, InitBooklet.chapterIntro, null); + PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(Minecraft.getMinecraft().thePlayer); + if(data != null){ + if(this.tryOpenMainPage && !data.theCompound.getBoolean("BookAlreadyOpened")){ + BookletUtils.openIndexEntry(this, InitBooklet.chapterIntro.entry, 1, true); + BookletUtils.openChapter(this, InitBooklet.chapterIntro, null); - PersistentClientData.setBoolean("BookAlreadyOpened", true); - } - else{ - PersistentClientData.openLastBookPage(this); + NBTTagCompound extraData = new NBTTagCompound(); + extraData.setBoolean("BookAlreadyOpened", true); + NBTTagCompound dataToSend = new NBTTagCompound(); + dataToSend.setTag("Data", extraData); + dataToSend.setInteger("WorldID", Minecraft.getMinecraft().theWorld.provider.getDimension()); + dataToSend.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(dataToSend, PacketHandler.CHANGE_PLAYER_DATA_HANDLER)); + } + else{ + BookletUtils.openLastBookPage(this, data.theCompound.getCompoundTag("BookletData")); + } } } else{ @@ -354,6 +412,8 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ BookletUtils.openChapter(this, ItemBooklet.forcedEntry.chapter, ItemBooklet.forcedEntry.page); ItemBooklet.forcedEntry = null; } + + this.shouldSaveDataNextClose = false; } @Override @@ -376,11 +436,11 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ super.updateScreen(); this.searchField.updateCursorCounter(); - if(this.currentEntrySet.entry != null && this.currentEntrySet.chapter != null && this.currentEntrySet.page != null){ - this.currentEntrySet.page.updateScreen(this.ticksElapsed); + if(this.currentEntrySet.getCurrentEntry() != null && this.currentEntrySet.getCurrentChapter() != null && this.currentEntrySet.getCurrentPage() != null){ + this.currentEntrySet.getCurrentPage().updateScreen(this.ticksElapsed); } - boolean buttonThere = UpdateChecker.needsUpdateNotify; + boolean buttonThere = UpdateChecker.needsUpdateNotify || UpdateChecker.checkFailed; this.buttonUpdate.visible = buttonThere; if(buttonThere){ if(this.ticksElapsed%8 == 0){ @@ -394,8 +454,18 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ @Override public void onGuiClosed(){ - if(this.saveOnClose){ - PersistentClientData.saveBookPage(this); + if(this.saveOnClose && this.shouldSaveDataNextClose){ + NBTTagCompound bookletData = new NBTTagCompound(); + BookletUtils.saveBookPage(this, bookletData); + + NBTTagCompound extraData = new NBTTagCompound(); + extraData.setTag("BookletData", bookletData); + + NBTTagCompound dataToSend = new NBTTagCompound(); + dataToSend.setTag("Data", extraData); + dataToSend.setInteger("WorldID", Minecraft.getMinecraft().theWorld.provider.getDimension()); + dataToSend.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(dataToSend, PacketHandler.CHANGE_PLAYER_DATA_HANDLER)); } } @@ -416,7 +486,7 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ list.set(k, stack.getRarity().rarityColor+(String)list.get(k)); } else{ - list.set(k, EnumChatFormatting.GRAY+(String)list.get(k)); + list.set(k, TextFormatting.GRAY+(String)list.get(k)); } } @@ -426,9 +496,9 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ list.add(from.getClickToSeeRecipeString()); if(mousePressed){ - BookletUtils.openIndexEntry(this, page.getChapter().getEntry(), ActuallyAdditionsAPI.bookletEntries.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true); + BookletUtils.openIndexEntry(this, page.getChapter().getEntry(), ActuallyAdditionsAPI.BOOKLET_ENTRIES.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true); BookletUtils.openChapter(this, page.getChapter(), page); - Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F)); + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F)); } } } @@ -464,7 +534,7 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ } @Override - public EntrySet getCurrentEntrySet(){ + public IEntrySet getCurrentEntrySet(){ return this.currentEntrySet; } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBookletStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBookletStand.java new file mode 100644 index 000000000..c5513f546 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBookletStand.java @@ -0,0 +1,80 @@ +/* + * This file ("GuiBookletStand.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.booklet; + +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; +import de.ellpeck.actuallyadditions.mod.network.PacketHandler; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBookletStand; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiBookletStand extends GuiBooklet{ + + private GuiButton buttonSetPage; + + private final TileEntityBookletStand theStand; + + public GuiBookletStand(TileEntityBase theStand){ + super(null, false, false); + this.theStand = (TileEntityBookletStand)theStand; + } + + @Override + public void actionPerformed(GuiButton button){ + if(button == this.buttonSetPage){ + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.theStand.getPos().getX()); + compound.setInteger("Y", this.theStand.getPos().getY()); + compound.setInteger("Z", this.theStand.getPos().getZ()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("WorldID", this.theStand.getWorld().provider.getDimension()); + compound.setTag("EntrySet", this.currentEntrySet.writeToNBT()); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.BOOKLET_STAND_BUTTON_HANDLER)); + } + super.actionPerformed(button); + } + + @Override + public void initGui(){ + super.initGui(); + + //Remove Bookmark Buttons + for(GuiButton bookmarkButton : this.bookmarkButtons){ + bookmarkButton.visible = false; + } + + this.buttonSetPage = new GuiButton(-100, this.guiLeft+this.xSize+10, this.guiTop+10, 100, 20, "Set Page"){ + @Override + public void drawButton(Minecraft mc, int x, int y){ + boolean unicodeBefore = mc.fontRendererObj.getUnicodeFlag(); + mc.fontRendererObj.setUnicodeFlag(false); + super.drawButton(mc, x, y); + mc.fontRendererObj.setUnicodeFlag(unicodeBefore); + } + }; + this.buttonList.add(this.buttonSetPage); + + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if(player != null && player.getName() != null){ + this.buttonSetPage.visible = player.getName().equalsIgnoreCase(this.theStand.assignedPlayer); + } + + //Open the pages the book was assigned + BookletUtils.openIndexEntry(this, this.theStand.assignedEntry.entry, this.theStand.assignedEntry.pageInIndex, true); + BookletUtils.openChapter(this, this.theStand.assignedEntry.chapter, this.theStand.assignedEntry.page); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index e41d6ebed..c4f02ba6e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -1,11 +1,11 @@ /* - * This file ("InitBooklet.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitBooklet.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet; @@ -25,18 +25,19 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.crafting.*; import de.ellpeck.actuallyadditions.mod.gen.OreGen; import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.lens.LensNoneRecipeHandler; +import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.tile.*; import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import java.util.ArrayList; -public class InitBooklet{ +public final class InitBooklet{ public static BookletChapter chapterIntro; @@ -58,84 +59,97 @@ public class InitBooklet{ private static void initChapters(){ //Getting Started chapterIntro = new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3)); + new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM")).setImportant(); new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, ItemCrafting.recipeBook)); - new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), new PageTextOnly(1).addTextReplacement("", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "pageAtomicReconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setPageStacksWildcard(), new PageCrafting(7, MiscCrafting.recipesCrystals).setNoText(), new PageCrafting(8, MiscCrafting.recipesCrystalBlocks).setNoText(), new PageReconstructor(9, LensNoneRecipeHandler.mainPageRecipes).setNoText()).setSpecial().setIncomplete(); + new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), new PageTextOnly(1).addTextReplacement("", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "pageAtomicReconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setPageStacksWildcard(), new PageCrafting(7, MiscCrafting.RECIPES_CRYSTALS).setNoText(), new PageCrafting(8, MiscCrafting.RECIPES_CRYSTAL_BLOCKS).setNoText(), new PageReconstructor(9, LensRecipeHandler.MAIN_PAGE_RECIPES).setNoText()).setSpecial(); new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageCrafting(1, BlockCrafting.recipeCoalGen).addTextReplacement("", TileEntityCoalGenerator.PRODUCE).setPageStacksWildcard()); new BookletChapter("craftingIngs", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeCoil).setNoText(), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced).setNoText(), new PageCrafting(4, BlockCrafting.recipeCase).setNoText(), new PageCrafting(5, BlockCrafting.recipeEnderPearlBlock).setNoText(), new PageCrafting(6, BlockCrafting.recipeEnderCase).setNoText(), new PageCrafting(7, ItemCrafting.recipeRing).setNoText(), new PageCrafting(8, ItemCrafting.recipeKnifeHandle).setNoText(), new PageCrafting(9, ItemCrafting.recipeKnifeBlade).setNoText(), new PageCrafting(10, ItemCrafting.recipeKnife).setNoText(), new PageCrafting(11, ItemCrafting.recipeDough).setNoText(), new PageCrafting(12, ItemCrafting.recipeRiceDough).setNoText(), new PageCrafting(13, BlockCrafting.recipeIronCase).setNoText()).setImportant(); - new BookletChapter("rf", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.redstone), new PageTextOnly(1)); + new BookletChapter("rf", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.REDSTONE), new PageTextOnly(1)); //Miscellaneous - new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLens).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeColorLens), new PageReconstructor(4, LensNoneRecipeHandler.recipeExplosionLens), new PageReconstructor(5, LensNoneRecipeHandler.recipeDamageLens), new PageReconstructor(6, LensNoneRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(7, LensNoneRecipeHandler.recipeLeather).setNoText(), new PageReconstructor(8, LensNoneRecipeHandler.recipeNetherWart).setNoText()).setImportant(); - new BookletChapter("miscDecorStuffsAndThings", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTestifiBucksGreenWall), new PageTextOnly(1), new PageReconstructor(2, LensNoneRecipeHandler.recipeWhiteWall).setNoText(), new PageReconstructor(3, LensNoneRecipeHandler.recipeGreenWall).setNoText()); - new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).setStack(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("", OreGen.QUARTZ_MIN).addTextReplacement("", OreGen.QUARTZ_MAX), new PageTextOnly(2).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText()); - new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setNoText().setPageStacksWildcard()).setSpecial().setIncomplete(); + new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLens).setNoText(), new PageReconstructor(3, LensRecipeHandler.recipeColorLens), new PageReconstructor(4, LensRecipeHandler.recipeExplosionLens), new PageReconstructor(5, LensRecipeHandler.recipeDamageLens), new PageReconstructor(6, LensRecipeHandler.recipeSoulSand).setNoText(), new PageReconstructor(7, LensRecipeHandler.recipeLeather).setNoText(), new PageReconstructor(8, LensRecipeHandler.recipeNetherWart).setNoText()).setImportant(); + new BookletChapter("banners", ActuallyAdditionsAPI.entryMisc, new ItemStack(Items.BANNER, 1, 15), new PageTextOnly(1)); + new BookletChapter("bookStand", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockBookletStand), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeBookStand).setNoText().setPageStacksWildcard()); + new BookletChapter("miscDecorStuffsAndThings", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTestifiBucksGreenWall), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeWhiteWall).setNoText(), new PageReconstructor(3, LensRecipeHandler.recipeGreenWall).setNoText()); + new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).setStacks(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("", OreGen.QUARTZ_MIN).addTextReplacement("", OreGen.QUARTZ_MAX), new PageTextOnly(2).setStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText()); + new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setNoText().setPageStacksWildcard()).setSpecial(); new BookletChapter("coalStuff", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeTinyCoal).setNoText(), new PageCrafting(3, ItemCrafting.recipeTinyChar).setNoText(), new PageCrafting(4, BlockCrafting.recipeBlockChar).setNoText()); ArrayList lampPages = new ArrayList(); lampPages.add(new PageTextOnly(lampPages.size()+1)); lampPages.add(new PageCrafting(lampPages.size()+1, BlockCrafting.recipePowerer).setNoText()); - for(IRecipe recipe : BlockCrafting.recipesLamps){ + for(IRecipe recipe : BlockCrafting.RECIPES_LAMPS){ lampPages.add(new PageCrafting(lampPages.size()+1, recipe).setNoText()); } new BookletChapter("lamps", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockColoredLampOn, 1, TheColoredLampColors.GREEN.ordinal()), lampPages.toArray(new BookletPage[lampPages.size()])); + new BookletChapter("enderStar", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()), new PageCrafting(1, ItemCrafting.recipeEnderStar)); + new BookletChapter("spawnerShard", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()))); - new BookletChapter("treasureChest", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTreasureChest), new PagePicture(1, "pageTreasureChest", 150).setStack(new ItemStack(InitBlocks.blockTreasureChest)), new PageTextOnly(2)).setSpecial(); - new BookletChapter("hairBalls", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemHairyBall), new PagePicture(1, "pageFurBalls", 110).setStack(new ItemStack(InitItems.itemHairyBall)), new PageTextOnly(2)).setSpecial(); - new BookletChapter("blackLotus", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockBlackLotus), new PageTextOnly(1).setStack(new ItemStack(InitBlocks.blockBlackLotus)), new PageCrafting(2, ItemCrafting.recipeBlackDye)); + new BookletChapter("treasureChest", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTreasureChest), new PagePicture(1, "pageTreasureChest", 150).setStacks(new ItemStack(InitBlocks.blockTreasureChest)), new PageTextOnly(2)).setSpecial(); + new BookletChapter("lushCaves", ActuallyAdditionsAPI.entryMisc, new ItemStack(Blocks.STONE), new PageTextOnly(1), new PagePicture(2, "pageLushCaves", 0).setNoText()); + new BookletChapter("hairBalls", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemHairyBall), new PagePicture(1, "pageFurBalls", 110).setStacks(new ItemStack(InitItems.itemHairyBall)), new PageTextOnly(2)).setSpecial(); + new BookletChapter("blackLotus", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockBlackLotus), new PageTextOnly(1).setStacks(new ItemStack(InitBlocks.blockBlackLotus)), new PageCrafting(2, ItemCrafting.recipeBlackDye)); + new BookletChapter("waterBowl", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemWaterBowl), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemWaterBowl))); //No RF Using Blocks + new BookletChapter("itemStorage", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeLaserRelayItem).setNoText().setPageStacksWildcard(), new PageCrafting(4, BlockCrafting.recipeLaserRelayItemWhitelist).setNoText().setPageStacksWildcard(), new PageCrafting(5, BlockCrafting.recipeItemInterface).setNoText()).setImportant(); new BookletChapter("breaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockBreaker), new PageCrafting(1, BlockCrafting.recipeBreaker).setPageStacksWildcard(), new PageCrafting(2, BlockCrafting.recipePlacer).setPageStacksWildcard(), new PageCrafting(3, BlockCrafting.recipeLiquidPlacer).setPageStacksWildcard(), new PageCrafting(4, BlockCrafting.recipeLiquidCollector).setPageStacksWildcard()); new BookletChapter("dropper", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockDropper), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeDropper).setNoText()); new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomLiquiface), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomface.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant(); + new BookletChapter("phantomRedstoneface", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomRedstoneface), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipePhantomRedstoneface).setNoText()); new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomBreaker), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomPlacer.RANGE), new PageCrafting(2, BlockCrafting.recipePhantomPlacer).setNoText(), new PageCrafting(3, BlockCrafting.recipePhantomBreaker).setNoText()); - new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial().setIncomplete(); - new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setSpecial().setIncomplete(); + new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial(); + new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setSpecial(); new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass)); new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText()); - new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemFertilizer)).addTextReplacement("", TileEntityCompost.AMOUNT), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.recipesMashedFood)).setIncomplete(); - new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, ItemCrafting.recipeCrateKeeper), new PageCrafting(3, ItemCrafting.recipeChestToCrateUpgrade)); + new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemFertilizer)), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.RECIPES_MASHED_FOOD)); + new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, BlockCrafting.recipeCrateMedium).setNoText(), new PageCrafting(3, BlockCrafting.recipeCrateLarge).setNoText(), new PageCrafting(4, ItemCrafting.recipeCrateKeeper), new PageCrafting(5, ItemCrafting.recipeChestToCrateUpgrade)); new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText()); //RF Using Blocks new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox), new PageTextOnly(1).addTextReplacement("", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial(); - new BookletChapter("laserRelays", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLaserRelay), new PageTextOnly(1).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE).addTextReplacement("", ConfigIntValues.LASER_RELAY_LOSS.getValue()), new PagePicture(2, "pageLaserRelay", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLaserRelay).setNoText().setPageStacksWildcard(), new PageCrafting(4, ItemCrafting.recipeLaserWrench).setNoText()).setImportant(); + new BookletChapter("laserRelays", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLaserRelay), new PageTextOnly(1).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE).addTextReplacement("", ConfigIntValues.LASER_RELAY_LOSS.getValue()), new PagePicture(2, "pageLaserRelay", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLaserRelay).setNoText().setPageStacksWildcard(), new PageCrafting(4, ItemCrafting.recipeLaserWrench)).setImportant(); new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockMiner), new PageTextOnly(1).addTextReplacement("", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); - new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).setStack(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "pageCoffeeMachine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setNoText().setPageStacksWildcard(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant(); - new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), new PageTextOnly(1).addTextReplacement("", TileEntityGrinder.getEnergyUse(false)).addTextReplacement("", TileEntityGrinder.getEnergyUse(true)), new PageCrafting(2, BlockCrafting.recipeCrusher).setNoText().setPageStacksWildcard(), new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setNoText().setPageStacksWildcard(), new PageCrusherRecipe(4, CrusherCrafting.recipeIronHorseArmor).setNoText(), new PageCrusherRecipe(5, CrusherCrafting.recipeGoldHorseArmor).setNoText(), new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText()); + new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).setStacks(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "pageCoffeeMachine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setNoText().setPageStacksWildcard(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant(); + new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), new PageTextOnly(1).addTextReplacement("", TileEntityGrinder.ENERGY_USE), new PageCrafting(2, BlockCrafting.recipeCrusher).setNoText().setPageStacksWildcard(), new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setNoText().setPageStacksWildcard(), new PageCrusherRecipe(4, CrusherCrafting.recipeIronHorseArmor).setNoText(), new PageCrusherRecipe(5, CrusherCrafting.recipeGoldHorseArmor).setNoText(), new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText()); new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFurnaceDouble), new PageCrafting(1, BlockCrafting.recipeFurnace).addTextReplacement("", TileEntityFurnaceDouble.ENERGY_USE).setPageStacksWildcard()); new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("", TileEntityLavaFactoryController.ENERGY_USE), new PagePicture(2, "pageLavaFactory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).setNoText()); new BookletChapter("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator)); new BookletChapter("repairer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("", TileEntityItemRepairer.ENERGY_USE)); new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDirectionalBreaker), new PageTextOnly(1).addTextReplacement("", TileEntityDirectionalBreaker.ENERGY_USE).addTextReplacement("", TileEntityDirectionalBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setPageStacksWildcard()); + new BookletChapter("playerInterface", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockPlayerInterface), new PageTextOnly(1).addTextReplacement("", TileEntityPlayerInterface.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipePlayerInterface).setNoText()).setSpecial(); + new BookletChapter("displayStand", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDisplayStand), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeDisplayStand).setNoText()).setSpecial(); //RF Generating Blocks new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("", TileEntityFurnaceSolar.PRODUCE), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText()); new BookletChapter("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), new PageTextOnly(1).addTextReplacement("", TileEntityHeatCollector.ENERGY_PRODUCE).addTextReplacement("", TileEntityHeatCollector.BLOCKS_NEEDED), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText()); - new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addTextReplacement("", TileEntityCanolaPress.ENERGY_USE).addTextReplacement("", TileEntityCanolaPress.PRODUCE).addTextReplacement("", TileEntityOilGenerator.ENERGY_PRODUCED), new PageCrafting(2, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(3, BlockCrafting.recipeFermentingBarrel).setNoText(), new PageCrafting(4, BlockCrafting.recipeOilGen).setNoText().setPageStacksWildcard()); + new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addTextReplacement("", TileEntityCanolaPress.ENERGY_USE).addTextReplacement("", TileEntityCanolaPress.PRODUCE).addTextReplacement("", TileEntityOilGenerator.ENERGY_PRODUCED), new PageTextOnly(2).setStacks(new ItemStack(InitItems.itemCanolaSeed), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOMASS.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOCOAL.ordinal())), new PageCrafting(3, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(4, BlockCrafting.recipeFermentingBarrel).setNoText(), new PageCrafting(4, BlockCrafting.recipeOilGen).setNoText().setPageStacksWildcard()); new BookletChapter("leafGen", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator), new PageTextOnly(1).addTextReplacement("", TileEntityLeafGenerator.ENERGY_PRODUCED).addTextReplacement("", TileEntityLeafGenerator.RANGE), new PageCrafting(2, BlockCrafting.recipeLeafGen)).setImportant(); //No RF Using Items - new BookletChapter("wings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemWingsOfTheBats), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BAT_WING.ordinal())), new PageCrafting(2, ItemCrafting.recipeWings).setNoText()).setSpecial(); + new BookletChapter("wings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemWingsOfTheBats), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BAT_WING.ordinal())), new PageCrafting(2, ItemCrafting.recipeWings).setNoText()).setSpecial(); new BookletChapter("foods", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemFoods, 1, TheFoods.HAMBURGER.ordinal()), new PageCrafting(1, FoodCrafting.recipeBacon), new PageFurnace(2, new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal())).setNoText(), new PageCrafting(3, FoodCrafting.recipeHamburger).setNoText(), new PageCrafting(4, FoodCrafting.recipeBigCookie).setNoText(), new PageCrafting(5, FoodCrafting.recipeSubSandwich).setNoText(), new PageCrafting(6, FoodCrafting.recipeFrenchFry).setNoText(), new PageCrafting(7, FoodCrafting.recipeFrenchFries).setNoText(), new PageCrafting(8, FoodCrafting.recipeFishNChips).setNoText(), new PageCrafting(9, FoodCrafting.recipeCheese).setNoText(), new PageCrafting(10, FoodCrafting.recipePumpkinStew).setNoText(), new PageCrafting(11, FoodCrafting.recipeCarrotJuice).setNoText(), new PageCrafting(12, FoodCrafting.recipeSpaghetti).setNoText(), new PageCrafting(13, FoodCrafting.recipeNoodle).setNoText(), new PageCrafting(14, FoodCrafting.recipeChocolate).setNoText(), new PageCrafting(15, FoodCrafting.recipeChocolateCake).setNoText(), new PageCrafting(16, FoodCrafting.recipeToast).setNoText(), new PageFurnace(17, new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal())).setNoText(), new PageCrafting(18, FoodCrafting.recipeChocolateToast).setNoText(), new PageCrafting(1, FoodCrafting.recipePizza).setNoText()); new BookletChapter("leafBlower", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemLeafBlowerAdvanced), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLeafBlower).setNoText(), new PageCrafting(3, ItemCrafting.recipeLeafBlowerAdvanced).setNoText()).setImportant(); ArrayList aiotPages = new ArrayList(); aiotPages.add(new PageTextOnly(aiotPages.size()+1)); - for(IRecipe recipe : ToolCrafting.recipesPaxels){ + for(IRecipe recipe : ToolCrafting.RECIPES_PAXELS){ aiotPages.add(new PageCrafting(aiotPages.size()+1, recipe).setNoText().setPageStacksWildcard()); } new BookletChapter("aiots", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.emeraldPaxel), aiotPages.toArray(new BookletPage[aiotPages.size()])).setImportant(); - new BookletChapter("jams", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemJams), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemJams, 1, Util.WILDCARD)), new PagePicture(2, "pageJamHouse", 150), new PageTextOnly(3)).setIncomplete(); + new BookletChapter("jams", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemJams), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemJams, 1, Util.WILDCARD)), new PagePicture(2, "pageJamHouse", 150), new PageTextOnly(3)); ArrayList potionRingPages = new ArrayList(); potionRingPages.add(new PageTextOnly(potionRingPages.size()+1)); - for(IRecipe recipe : ItemCrafting.recipesPotionRings){ + for(IRecipe recipe : ItemCrafting.RECIPES_POTION_RINGS){ potionRingPages.add(new PageCrafting(potionRingPages.size()+1, recipe).setNoText()); } new BookletChapter("potionRings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPotionRing), potionRingPages.toArray(new BookletPage[potionRingPages.size()])); + new BookletChapter("spawnerChanger", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemSpawnerChanger), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeSpawnerChanger).setNoText()); + new BookletChapter("itemFilter", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitItems.itemFilter), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeFilter).setNoText()).setImportant(); //RF Using Items - new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(3, ItemCrafting.recipesDrillColoring), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); + new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(3, ItemCrafting.RECIPES_DRILL_COLORING), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); new BookletChapter("staff", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemTeleStaff), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeStaff).setNoText()).setImportant(); new BookletChapter("magnetRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemMagnetRing), new PageCrafting(1, ItemCrafting.recipeMagnetRing)); new BookletChapter("growthRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemGrowthRing), new PageCrafting(1, ItemCrafting.recipeGrowthRing)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java index 8107e6119..9bee05685 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java @@ -1,35 +1,37 @@ /* - * This file ("BookmarkButton.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookmarkButton.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.button; -import de.ellpeck.actuallyadditions.api.internal.EntrySet; import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; +import de.ellpeck.actuallyadditions.mod.booklet.entry.EntrySet; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; -import de.ellpeck.actuallyadditions.mod.util.KeyUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import java.util.ArrayList; +@SideOnly(Side.CLIENT) public class BookmarkButton extends GuiButton{ + private final GuiBooklet booklet; public EntrySet assignedEntry = new EntrySet(null); - private GuiBooklet booklet; - public BookmarkButton(int id, int x, int y, GuiBooklet booklet){ super(id, x, y, 16, 16, ""); this.booklet = booklet; @@ -37,8 +39,9 @@ public class BookmarkButton extends GuiButton{ public void onPressed(){ if(this.assignedEntry.entry != null){ - if(KeyUtil.isShiftPressed()){ + if(GuiScreen.isShiftKeyDown()){ this.assignedEntry.removeEntry(); + this.booklet.shouldSaveDataNextClose = true; } else{ BookletUtils.openIndexEntry(this.booklet, this.assignedEntry.entry, this.assignedEntry.pageInIndex, true); @@ -46,8 +49,9 @@ public class BookmarkButton extends GuiButton{ } } else{ - if(this.booklet.currentEntrySet.entry != null){ - this.assignedEntry.setEntry(this.booklet.currentEntrySet.page, this.booklet.currentEntrySet.chapter, this.booklet.currentEntrySet.entry, this.booklet.currentEntrySet.pageInIndex); + if(this.booklet.currentEntrySet.getCurrentEntry() != null){ + this.assignedEntry.setEntry(this.booklet.currentEntrySet.getCurrentPage(), this.booklet.currentEntrySet.getCurrentChapter(), this.booklet.currentEntrySet.getCurrentEntry(), this.booklet.currentEntrySet.getPageInIndex()); + this.booklet.shouldSaveDataNextClose = true; } } } @@ -55,7 +59,7 @@ public class BookmarkButton extends GuiButton{ @Override public void drawButton(Minecraft minecraft, int x, int y){ if(this.visible){ - minecraft.getTextureManager().bindTexture(GuiBooklet.resLoc); + minecraft.getTextureManager().bindTexture(GuiBooklet.RES_LOC); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; int k = this.getHoverState(this.hovered); @@ -78,21 +82,20 @@ public class BookmarkButton extends GuiButton{ } } - @SuppressWarnings("unchecked") public void drawHover(int mouseX, int mouseY){ ArrayList list = new ArrayList(); if(this.assignedEntry.entry != null){ if(this.assignedEntry.chapter != null){ - list.add(EnumChatFormatting.GOLD+this.assignedEntry.chapter.getLocalizedName()+", Page "+this.assignedEntry.page.getID()); + list.add(TextFormatting.GOLD+this.assignedEntry.chapter.getLocalizedName()+", Page "+this.assignedEntry.page.getID()); } else{ - list.add(EnumChatFormatting.GOLD+this.assignedEntry.entry.getLocalizedName()+", Page "+this.assignedEntry.pageInIndex); + list.add(TextFormatting.GOLD+this.assignedEntry.entry.getLocalizedName()+", Page "+this.assignedEntry.pageInIndex); } list.add("Click to open"); - list.add(EnumChatFormatting.ITALIC+"Shift-Click to remove"); + list.add(TextFormatting.ITALIC+"Shift-Click to remove"); } else{ - list.add(EnumChatFormatting.GOLD+"None"); + list.add(TextFormatting.GOLD+"None"); list.add("Click to save current page"); } this.booklet.drawHoveringText(list, mouseX, mouseY); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/IndexButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/IndexButton.java index 8107169ab..17776e210 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/IndexButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/IndexButton.java @@ -1,30 +1,29 @@ /* - * This file ("IndexButton.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IndexButton.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.button; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; -import de.ellpeck.actuallyadditions.mod.booklet.chapter.BookletChapter; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +@SideOnly(Side.CLIENT) public class IndexButton extends GuiButton{ + private final GuiBooklet gui; public IBookletChapter chap; - private GuiBooklet gui; public IndexButton(int id, int x, int y, int width, int height, String text, GuiBooklet gui){ super(id, x, y, width, height, text); @@ -60,10 +59,4 @@ public class IndexButton extends GuiButton{ this.gui.getFontRenderer().drawString(this.displayString, this.xPosition+textOffsetX, this.yPosition+(this.height-8)/2, 0); } } - - public void drawHover(int mouseX, int mouseY){ - if(this.chap instanceof BookletChapter && ((BookletChapter)this.chap).isIncomplete){ - this.gui.drawHoveringText(this.gui.getFontRenderer().listFormattedStringToWidth(EnumChatFormatting.RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".unavailable"), 250), mouseX, mouseY); - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java index b185df808..d106deb9e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java @@ -1,11 +1,11 @@ /* - * This file ("TexturedButton.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TexturedButton.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.button; @@ -14,22 +14,23 @@ import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; +@SideOnly(Side.CLIENT) public class TexturedButton extends GuiButton{ + public final List textList = new ArrayList(); public int texturePosX; public int texturePosY; - public List textList = new ArrayList(); - public TexturedButton(int id, int x, int y, int texturePosX, int texturePosY, int width, int height){ this(id, x, y, texturePosX, texturePosY, width, height, new ArrayList()); } - @SuppressWarnings("unchecked") public TexturedButton(int id, int x, int y, int texturePosX, int texturePosY, int width, int height, List hoverTextList){ super(id, x, y, width, height, ""); this.texturePosX = texturePosX; @@ -45,7 +46,7 @@ public class TexturedButton extends GuiButton{ @Override public void drawButton(Minecraft minecraft, int x, int y){ if(this.visible){ - minecraft.getTextureManager().bindTexture(GuiBooklet.resLoc); + minecraft.getTextureManager().bindTexture(GuiBooklet.RES_LOC); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; int k = this.getHoverState(this.hovered); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java index 3eb2144af..306b8d6ab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java @@ -1,11 +1,11 @@ /* - * This file ("BookletChapter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletChapter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.chapter; @@ -17,7 +17,7 @@ import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; public class BookletChapter implements IBookletChapter{ @@ -25,9 +25,7 @@ public class BookletChapter implements IBookletChapter{ public final IBookletEntry entry; public final ItemStack displayStack; private final String unlocalizedName; - public EnumChatFormatting color; - - public boolean isIncomplete; + public TextFormatting color; public BookletChapter(String unlocalizedName, IBookletEntry entry, ItemStack displayStack, BookletPage... pages){ this.pages = pages.clone(); @@ -42,7 +40,7 @@ public class BookletChapter implements IBookletChapter{ page.setChapter(this); } - this.color = EnumChatFormatting.RESET; + this.color = TextFormatting.RESET; } @Override @@ -57,7 +55,7 @@ public class BookletChapter implements IBookletChapter{ @Override public String getLocalizedName(){ - return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".chapter."+this.unlocalizedName+".name"); + return StringUtil.localize("booklet."+ModUtil.MOD_ID+".chapter."+this.unlocalizedName+".name"); } @Override @@ -75,18 +73,11 @@ public class BookletChapter implements IBookletChapter{ return this.displayStack; } - public BookletChapter setIncomplete(){ - this.isIncomplete = true; - return this; + public void setImportant(){ + this.color = TextFormatting.DARK_GREEN; } - public BookletChapter setImportant(){ - this.color = EnumChatFormatting.DARK_GREEN; - return this; - } - - public BookletChapter setSpecial(){ - this.color = EnumChatFormatting.DARK_PURPLE; - return this; + public void setSpecial(){ + this.color = TextFormatting.DARK_PURPLE; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCoffee.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCoffee.java index 9a04df28a..a48b5464e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCoffee.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCoffee.java @@ -1,11 +1,11 @@ /* - * This file ("BookletChapterCoffee.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletChapterCoffee.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.chapter; @@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.booklet.chapter; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; +import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; import de.ellpeck.actuallyadditions.mod.booklet.page.BookletPageAA; import de.ellpeck.actuallyadditions.mod.booklet.page.PageCoffeeRecipe; import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; @@ -28,12 +28,11 @@ public class BookletChapterCoffee extends BookletChapter{ super(unlocalizedName, entry, displayStack, getPages(pages)); } - @SuppressWarnings("unchecked") private static BookletPage[] getPages(BookletPage... pages){ ArrayList allPages = new ArrayList(); allPages.addAll(Arrays.asList(pages)); - for(CoffeeIngredient ingredient : ActuallyAdditionsAPI.coffeeMachineIngredients){ + for(CoffeeIngredient ingredient : ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS){ BookletPageAA page = new PageCoffeeRecipe(allPages.size()+1, ingredient); if(!(ingredient instanceof ItemCoffee.MilkIngredient)){ page.setNoText(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCrusher.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCrusher.java index 8631d823f..8307d6262 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCrusher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCrusher.java @@ -1,11 +1,11 @@ /* - * This file ("BookletChapterCrusher.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletChapterCrusher.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.chapter; @@ -26,12 +26,11 @@ public class BookletChapterCrusher extends BookletChapter{ super(unlocalizedName, entry, displayStack, getPages(pages)); } - @SuppressWarnings("unchecked") private static BookletPage[] getPages(BookletPage... pages){ ArrayList allPages = new ArrayList(); allPages.addAll(Arrays.asList(pages)); - for(CrusherRecipe recipe : CrusherCrafting.miscRecipes){ + for(CrusherRecipe recipe : CrusherCrafting.MISC_RECIPES){ allPages.add(new PageCrusherRecipe(allPages.size()+1, recipe).setNoText()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java index 74011bbc3..a1d7902bd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java @@ -1,11 +1,11 @@ /* - * This file ("BookletEntry.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletEntry.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.entry; @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import java.util.ArrayList; import java.util.List; @@ -24,13 +24,13 @@ public class BookletEntry implements IBookletEntry{ private final String unlocalizedName; public List chapters = new ArrayList(); - private EnumChatFormatting color; + private TextFormatting color; public BookletEntry(String unlocalizedName){ this.unlocalizedName = unlocalizedName; ActuallyAdditionsAPI.addBookletEntry(this); - this.color = EnumChatFormatting.RESET; + this.color = TextFormatting.RESET; } @Override @@ -50,7 +50,7 @@ public class BookletEntry implements IBookletEntry{ @Override public String getLocalizedName(){ - return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".indexEntry."+this.unlocalizedName+".name"); + return StringUtil.localize("booklet."+ModUtil.MOD_ID+".indexEntry."+this.unlocalizedName+".name"); } @Override @@ -64,12 +64,12 @@ public class BookletEntry implements IBookletEntry{ } public BookletEntry setImportant(){ - this.color = EnumChatFormatting.DARK_GREEN; + this.color = TextFormatting.DARK_GREEN; return this; } public BookletEntry setSpecial(){ - this.color = EnumChatFormatting.DARK_PURPLE; + this.color = TextFormatting.DARK_PURPLE; return this; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntryAllSearch.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntryAllSearch.java index 52599f884..cfcd4a0e1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntryAllSearch.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntryAllSearch.java @@ -1,11 +1,11 @@ /* - * This file ("BookletEntryAllSearch.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletEntryAllSearch.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.entry; @@ -29,7 +29,6 @@ public class BookletEntryAllSearch extends BookletEntry{ this.chapters = (ArrayList)this.allChapters.clone(); } - @SuppressWarnings("unchecked") @Override public void addChapter(IBookletChapter chapter){ this.allChapters.add(chapter); diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/internal/EntrySet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/EntrySet.java similarity index 61% rename from src/main/java/de/ellpeck/actuallyadditions/api/internal/EntrySet.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/EntrySet.java index fb67d6e6f..1c47892fa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/internal/EntrySet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/EntrySet.java @@ -1,22 +1,23 @@ /* - * This file ("EntrySet.java") is part of the Actually Additions Mod for Minecraft. + * This file ("EntrySet.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ -package de.ellpeck.actuallyadditions.api.internal; +package de.ellpeck.actuallyadditions.mod.booklet.entry; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; +import de.ellpeck.actuallyadditions.api.internal.IEntrySet; import net.minecraft.nbt.NBTTagCompound; -public class EntrySet{ +public class EntrySet implements IEntrySet{ public BookletPage page; public IBookletChapter chapter; @@ -38,7 +39,7 @@ public class EntrySet{ int chapter = compound.getInteger("Chapter"); int page = compound.getInteger("Page"); - IBookletEntry currentEntry = entry == -1 ? null : ActuallyAdditionsAPI.bookletEntries.get(entry); + IBookletEntry currentEntry = entry == -1 ? null : ActuallyAdditionsAPI.BOOKLET_ENTRIES.get(entry); IBookletChapter currentChapter = chapter == -1 || entry == -1 || currentEntry.getChapters().size() <= chapter ? null : currentEntry.getChapters().get(chapter); BookletPage currentPage = chapter == -1 || currentChapter == null || currentChapter.getPages().length <= page-1 ? null : currentChapter.getPages()[page-1]; int pageInIndex = compound.getInteger("PageInIndex"); @@ -49,6 +50,7 @@ public class EntrySet{ return new EntrySet(null); } + @Override public void setEntry(BookletPage page, IBookletChapter chapter, IBookletEntry entry, int pageInIndex){ this.page = page; this.chapter = chapter; @@ -56,16 +58,58 @@ public class EntrySet{ this.pageInIndex = pageInIndex; } + @Override public void removeEntry(){ this.setEntry(null, null, null, 1); } + @Override public NBTTagCompound writeToNBT(){ NBTTagCompound compound = new NBTTagCompound(); - compound.setInteger("Entry", entry == null ? -1 : ActuallyAdditionsAPI.bookletEntries.indexOf(entry)); - compound.setInteger("Chapter", entry == null || chapter == null ? -1 : entry.getChapters().indexOf(chapter)); - compound.setInteger("Page", page == null ? -1 : page.getID()); - compound.setInteger("PageInIndex", pageInIndex); + compound.setInteger("Entry", this.entry == null ? -1 : ActuallyAdditionsAPI.BOOKLET_ENTRIES.indexOf(this.entry)); + compound.setInteger("Chapter", this.entry == null || this.chapter == null ? -1 : this.entry.getChapters().indexOf(this.chapter)); + compound.setInteger("Page", this.page == null ? -1 : this.page.getID()); + compound.setInteger("PageInIndex", this.pageInIndex); return compound; } + + @Override + public BookletPage getCurrentPage(){ + return this.page; + } + + @Override + public IBookletEntry getCurrentEntry(){ + return this.entry; + } + + @Override + public IBookletChapter getCurrentChapter(){ + return this.chapter; + } + + @Override + public int getPageInIndex(){ + return this.pageInIndex; + } + + @Override + public void setPage(BookletPage page){ + this.page = page; + } + + @Override + public void setEntry(IBookletEntry entry){ + this.entry = entry; + } + + @Override + public void setChapter(IBookletChapter chapter){ + this.chapter = chapter; + } + + @Override + public void setPageInIndex(int page){ + this.pageInIndex = page; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/BookletPageAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/BookletPageAA.java index 4eef6f123..6d32993e1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/BookletPageAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/BookletPageAA.java @@ -1,11 +1,11 @@ /* - * This file ("BookletPage.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletPageAA.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.page; @@ -17,15 +17,15 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import java.util.HashMap; import java.util.Map; public class BookletPageAA extends BookletPage{ - protected int localizationKey; - private HashMap textReplacements = new HashMap(); + protected final int localizationKey; + private final HashMap textReplacements = new HashMap(); private boolean hasNoText; public BookletPageAA(int localizationKey){ @@ -43,13 +43,13 @@ public class BookletPageAA extends BookletPage{ return null; } - String base = StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".chapter."+this.chapter.getUnlocalizedName()+".text."+this.localizationKey); - base = base.replaceAll("", EnumChatFormatting.DARK_GREEN+""); - base = base.replaceAll("", EnumChatFormatting.BLUE+""); - base = base.replaceAll("", EnumChatFormatting.BLACK+""); + String base = StringUtil.localize("booklet."+ModUtil.MOD_ID+".chapter."+this.chapter.getUnlocalizedName()+".text."+this.localizationKey); + base = base.replaceAll("", TextFormatting.DARK_GREEN+""); + base = base.replaceAll("", TextFormatting.BLUE+""); + base = base.replaceAll("", TextFormatting.BLACK+""); base = base.replaceAll("", "\n"); - base = base.replaceAll("", EnumChatFormatting.ITALIC+""); - base = base.replaceAll("", EnumChatFormatting.DARK_RED+""+EnumChatFormatting.UNDERLINE); //This is fucking important so go read it now + base = base.replaceAll("", TextFormatting.ITALIC+""); + base = base.replaceAll("", TextFormatting.DARK_RED+""+TextFormatting.UNDERLINE); //This is fucking important so go read it now for(Object o : this.textReplacements.entrySet()){ Map.Entry e = (Map.Entry)o; @@ -80,7 +80,7 @@ public class BookletPageAA extends BookletPage{ @Override public String getClickToSeeRecipeString(){ - return EnumChatFormatting.GOLD+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe"); + return TextFormatting.GOLD+StringUtil.localize("booklet."+ModUtil.MOD_ID+".clickToSeeRecipe"); } public BookletPage setNoText(){ @@ -98,7 +98,7 @@ public class BookletPageAA extends BookletPage{ } public void addToPagesWithItemStackData(){ - if(!ActuallyAdditionsAPI.bookletPagesWithItemStackData.contains(this)){ + if(!ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_DATA.contains(this)){ ItemStack[] stacks = this.getItemStacksForPage(); if(stacks != null && stacks.length > 0){ //Ensure that there is at least one ItemStack diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageButton.java new file mode 100644 index 000000000..a30b06d7f --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageButton.java @@ -0,0 +1,46 @@ +/* + * This file ("PageButton.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.booklet.page; + +import de.ellpeck.actuallyadditions.api.internal.IBookletGui; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; + +public abstract class PageButton extends PageTextOnly{ + + private GuiButton button; + + public PageButton(int id){ + super(id); + } + + @Override + public void onOpened(IBookletGui gui){ + String text = StringUtil.localize("booklet."+ModUtil.MOD_ID+".chapter."+this.chapter.getUnlocalizedName()+".page."+this.localizationKey+".button"); + int width = Minecraft.getMinecraft().fontRendererObj.getStringWidth(text); + this.button = new GuiButton(-1239, gui.getGuiLeft()+gui.getXSize()/2-width/2-8, gui.getGuiTop()+gui.getYSize()-40, width+15, 20, text); + gui.getButtonList().add(this.button); + } + + @Override + public void onClosed(IBookletGui gui){ + gui.getButtonList().remove(this.button); + } + + @Override + public boolean onActionPerformed(IBookletGui gui, GuiButton button){ + return button == this.button && this.onAction(); + } + + public abstract boolean onAction(); +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCoffeeRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCoffeeRecipe.java index a1c4fed7f..02aaaff39 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCoffeeRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCoffeeRecipe.java @@ -1,18 +1,18 @@ /* - * This file ("PageCoffeeRecipe.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PageCoffeeRecipe.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.page; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.internal.IBookletGui; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeBrewing; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; +import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; @@ -27,7 +27,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class PageCoffeeRecipe extends BookletPageAA{ - public CoffeeIngredient ingredient; + public final CoffeeIngredient ingredient; public PageCoffeeRecipe(int id, CoffeeIngredient ingredient){ super(id); @@ -37,18 +37,17 @@ public class PageCoffeeRecipe extends BookletPageAA{ @Override @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+19, gui.getGuiTop()+20, 146, 94, 99, 60); } - @SuppressWarnings("unchecked") @Override @SideOnly(Side.CLIENT) public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ String strg = "Coffee Machine Recipe"; Minecraft.getMinecraft().fontRendererObj.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRendererObj.getStringWidth(strg)/2, gui.getGuiTop()+10, 0); - String text = gui.getCurrentEntrySet().page.getText(); + String text = gui.getCurrentEntrySet().getCurrentPage().getText(); if(text != null && !text.isEmpty()){ StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false); } @@ -76,7 +75,7 @@ public class PageCoffeeRecipe extends BookletPageAA{ break; case 2: stack = new ItemStack(InitItems.itemCoffee); - CoffeeBrewing.addEffectToStack(stack, this.ingredient); + ActuallyAdditionsAPI.methodHandler.addEffectToStack(stack, this.ingredient); coordsOffsetX = 39; coordsOffsetY = 39; break; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java index 3f512c03f..59227005f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java @@ -1,11 +1,11 @@ /* - * This file ("PageCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PageCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.page; @@ -22,7 +22,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.ShapedRecipes; import net.minecraft.item.crafting.ShapelessRecipes; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.ReflectionHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -52,26 +52,25 @@ public class PageCrafting extends BookletPageAA{ @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.recipes[this.recipePos] != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+27, gui.getGuiTop()+20, 146, 20, 99, 60); } } - @SuppressWarnings("unchecked") @Override @SideOnly(Side.CLIENT) public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ IRecipe recipe = this.recipes[this.recipePos]; if(recipe == null){ - StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); + StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, TextFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); } else{ - String strg = StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+"."+(recipe instanceof ShapedRecipes ? "shapedRecipe" : (recipe instanceof ShapelessRecipes ? "shapelessRecipe" : (recipe instanceof ShapelessOreRecipe ? "shapelessOreRecipe" : "shapedOreRecipe")))); + String strg = StringUtil.localize("booklet."+ModUtil.MOD_ID+"."+(recipe instanceof ShapedRecipes ? "shapedRecipe" : (recipe instanceof ShapelessRecipes ? "shapelessRecipe" : (recipe instanceof ShapelessOreRecipe ? "shapelessOreRecipe" : "shapedOreRecipe")))); Minecraft.getMinecraft().fontRendererObj.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRendererObj.getStringWidth(strg)/2, gui.getGuiTop()+10, 0); } - String text = gui.getCurrentEntrySet().page.getText(); + String text = gui.getCurrentEntrySet().getCurrentPage().getText(); if(text != null && !text.isEmpty()){ StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+90, 115, 0, false); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java index 288d874f9..b2e9df9fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java @@ -1,11 +1,11 @@ /* - * This file ("PageCrusherRecipe.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PageCrusherRecipe.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.page; @@ -20,7 +20,7 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -29,7 +29,7 @@ import java.util.List; public class PageCrusherRecipe extends BookletPageAA{ - public CrusherRecipe recipe; + public final CrusherRecipe recipe; private int recipePos; @@ -42,35 +42,34 @@ public class PageCrusherRecipe extends BookletPageAA{ @Override @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - if(recipe != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + if(this.recipe != null){ + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 60, 180, 60, 60); } } - @SuppressWarnings("unchecked") @Override @SideOnly(Side.CLIENT) public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - if(recipe == null){ - StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); + if(this.recipe == null){ + StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, TextFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); } else{ String strg = "Crusher Recipe"; Minecraft.getMinecraft().fontRendererObj.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRendererObj.getStringWidth(strg)/2, gui.getGuiTop()+10, 0); } - String text = gui.getCurrentEntrySet().page.getText(); + String text = gui.getCurrentEntrySet().getCurrentPage().getText(); if(text != null && !text.isEmpty()){ StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false); } - if(recipe != null){ - if(recipe.outputTwoChance > 0){ - Minecraft.getMinecraft().fontRendererObj.drawString(recipe.outputTwoChance+"%", gui.getGuiLeft()+37+62, gui.getGuiTop()+20+33, 0); + if(this.recipe != null){ + if(this.recipe.outputTwoChance > 0){ + Minecraft.getMinecraft().fontRendererObj.drawString(this.recipe.outputTwoChance+"%", gui.getGuiLeft()+37+62, gui.getGuiTop()+20+33, 0); } - if(recipe.getRecipeOutputOnes() != null){ + if(this.recipe.getRecipeOutputOnes() != null){ for(int i = 0; i < 2; i++){ for(int j = 0; j < 3; j++){ ItemStack stack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java index f8cde97b0..e2c1779ac 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java @@ -1,11 +1,11 @@ /* - * This file ("PageFurnace.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PageFurnace.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.page; @@ -20,7 +20,7 @@ import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -46,25 +46,24 @@ public class PageFurnace extends BookletPageAA{ @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.input != null || this.getInputForOutput(this.result) != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 0, 180, 60, 60); } } - @SuppressWarnings("unchecked") @Override @SideOnly(Side.CLIENT) public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ ItemStack input = this.input != null ? this.input : this.getInputForOutput(this.result); if(input == null){ - StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); + StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, TextFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); } else{ String strg = "Furnace Recipe"; Minecraft.getMinecraft().fontRendererObj.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRendererObj.getStringWidth(strg)/2, gui.getGuiTop()+10, 0); } - String text = gui.getCurrentEntrySet().page.getText(); + String text = gui.getCurrentEntrySet().getCurrentPage().getText(); if(text != null && !text.isEmpty()){ StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageLinkButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageLinkButton.java new file mode 100644 index 000000000..158d6ce7f --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageLinkButton.java @@ -0,0 +1,29 @@ +/* + * This file ("PageYoutubeButton.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.booklet.page; + +import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; + +public class PageLinkButton extends PageButton{ + + private final String link; + + public PageLinkButton(int id, String link){ + super(id); + this.link = link; + } + + @Override + public boolean onAction(){ + BookletUtils.openBrowser(this.link); + return true; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PagePicture.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PagePicture.java index 5d8aa51a2..05cbe904b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PagePicture.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PagePicture.java @@ -1,11 +1,11 @@ /* - * This file ("PagePicture.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PagePicture.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.page; @@ -20,8 +20,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class PagePicture extends PageTextOnly{ - private ResourceLocation resLoc; - private int textStartY; + private final ResourceLocation resLoc; + private final int textStartY; public PagePicture(int id, String resLocName, int textStartY){ super(id); @@ -35,9 +35,9 @@ public class PagePicture extends PageTextOnly{ Minecraft.getMinecraft().getTextureManager().bindTexture(this.resLoc); gui.drawRect(gui.getGuiLeft(), gui.getGuiTop(), 0, 0, gui.getXSize(), gui.getYSize()); - String text = gui.getCurrentEntrySet().page.getText(); + String text = gui.getCurrentEntrySet().getCurrentPage().getText(); if(text != null && !text.isEmpty()){ - StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+textStartY, 115, 0, false); + StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+this.textStartY, 115, 0, false); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java index d74c04856..5dafb1c49 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java @@ -1,17 +1,17 @@ /* - * This file ("PageReconstructor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PageReconstructor.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.page; import de.ellpeck.actuallyadditions.api.internal.IBookletGui; -import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; +import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; @@ -21,7 +21,7 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -30,14 +30,14 @@ import java.util.List; public class PageReconstructor extends BookletPageAA{ - private LensNoneRecipe[] recipes; + private final LensConversionRecipe[] recipes; private int recipePos; - public PageReconstructor(int id, ArrayList recipes){ - this(id, recipes.toArray(new LensNoneRecipe[recipes.size()])); + public PageReconstructor(int id, ArrayList recipes){ + this(id, recipes.toArray(new LensConversionRecipe[recipes.size()])); } - public PageReconstructor(int id, LensNoneRecipe... recipes){ + public PageReconstructor(int id, LensConversionRecipe... recipes){ super(id); this.recipes = recipes; this.addToPagesWithItemStackData(); @@ -47,25 +47,24 @@ public class PageReconstructor extends BookletPageAA{ @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.recipes[this.recipePos] != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 188, 154, 60, 60); } } - @SuppressWarnings("unchecked") @Override @SideOnly(Side.CLIENT) public void render(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - LensNoneRecipe recipe = this.recipes[this.recipePos]; + LensConversionRecipe recipe = this.recipes[this.recipePos]; if(recipe == null){ - StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); + StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, TextFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID+".recipeDisabled"), gui.getGuiLeft()+14, gui.getGuiTop()+15, 115, 0, false); } else{ String strg = "Atomic Reconstructor"; Minecraft.getMinecraft().fontRendererObj.drawString(strg, gui.getGuiLeft()+gui.getXSize()/2-Minecraft.getMinecraft().fontRendererObj.getStringWidth(strg)/2, gui.getGuiTop()+10, 0); } - String text = gui.getCurrentEntrySet().page.getText(); + String text = gui.getCurrentEntrySet().getCurrentPage().getText(); if(text != null && !text.isEmpty()){ StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+100, 115, 0, false); } @@ -116,7 +115,7 @@ public class PageReconstructor extends BookletPageAA{ public ItemStack[] getItemStacksForPage(){ if(this.recipes != null){ ArrayList stacks = new ArrayList(); - for(LensNoneRecipe recipe : this.recipes){ + for(LensConversionRecipe recipe : this.recipes){ if(recipe != null){ stacks.addAll(recipe.getOutputs()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageTextOnly.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageTextOnly.java index 8ebdfa28c..05133f9f6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageTextOnly.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageTextOnly.java @@ -1,11 +1,11 @@ /* - * This file ("PageTextOnly.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PageTextOnly.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.booklet.page; @@ -19,14 +19,14 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class PageTextOnly extends BookletPageAA{ - private ItemStack stack; + private ItemStack[] stacks; public PageTextOnly(int id){ super(id); } - public PageTextOnly setStack(ItemStack stack){ - this.stack = stack; + public PageTextOnly setStacks(ItemStack... stacks){ + this.stacks = stacks; this.addToPagesWithItemStackData(); return this; } @@ -34,7 +34,7 @@ public class PageTextOnly extends BookletPageAA{ @Override @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - String text = gui.getCurrentEntrySet().page.getText(); + String text = gui.getCurrentEntrySet().getCurrentPage().getText(); if(text != null && !text.isEmpty()){ StringUtil.drawSplitString(Minecraft.getMinecraft().fontRendererObj, text, gui.getGuiLeft()+14, gui.getGuiTop()+9, 115, 0, false); } @@ -42,6 +42,6 @@ public class PageTextOnly extends BookletPageAA{ @Override public ItemStack[] getItemStacksForPage(){ - return this.stack == null ? new ItemStack[0] : new ItemStack[]{this.stack}; + return this.stacks == null ? new ItemStack[0] : this.stacks; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigCategories.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigCategories.java index 54c76569e..c55ac2dce 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigCategories.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigCategories.java @@ -1,18 +1,20 @@ /* - * This file ("ConfigCategories.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ConfigCategories.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.config; +import java.util.Locale; + public enum ConfigCategories{ - PERFORMANCE("PERFORMANCE", "Performance Settings"), + PERFORMANCE("Performance", "Performance Settings"), FOOD_CRAFTING("Food Crafting", "Crafting Recipes for Food Items"), BLOCKS_CRAFTING("Block Crafting", "Crafting Recipes for Blocks"), ITEMS_CRAFTING("Item Crafting", "Crafting Recipes for Items"), @@ -21,14 +23,13 @@ public enum ConfigCategories{ MOB_DROPS("Mob Drops", "Everything regarding Item drops from mobs"), WORLD_GEN("World Gen", "Everything regarding World Generation"), POTION_RING_CRAFTING("Ring Crafting", "Crafting Recipes for Rings"), - FLUIDS("Fluids", "Everything regarding fluids"), OTHER("Other", "Everything else"); public final String name; public final String comment; ConfigCategories(String name, String comment){ - this.name = name; + this.name = name.toLowerCase(Locale.ROOT); this.comment = comment; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java index 36608a319..070f7552b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java @@ -1,65 +1,41 @@ /* - * This file ("ConfigValues.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ConfigValues.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.config; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; +import de.ellpeck.actuallyadditions.mod.config.values.*; import net.minecraftforge.common.config.Configuration; -public class ConfigValues{ - - public static ConfigCrafting[] craftingConfig = ConfigCrafting.values(); - public static ConfigIntValues[] intConfig = ConfigIntValues.values(); - public static ConfigBoolValues[] boolConfig = ConfigBoolValues.values(); - - public static String[] crusherRecipeExceptions; - public static String[] mashedFoodCraftingExceptions; - - public static String[] paxelExtraMiningWhitelist; - public static String[] drillExtraminingWhitelist; - - public static int[] oreGenDimensionBlacklist; - public static int[] plantDimensionBlacklist; - - public static String[] minerExtraWhitelist; - public static String[] minerBlacklist; - - public static boolean lessSound; - public static boolean lessParticles; - public static boolean lessBlockBreakingEffects; +public final class ConfigValues{ public static void defineConfigValues(Configuration config){ - for(ConfigCrafting currConf : craftingConfig){ + for(ConfigCrafting currConf : ConfigCrafting.values()){ currConf.currentValue = config.get(currConf.category, currConf.name, currConf.defaultValue, "If the Recipe for the "+currConf.name+" is Enabled").getBoolean(); } - for(ConfigIntValues currConf : intConfig){ + + for(ConfigIntValues currConf : ConfigIntValues.values()){ currConf.currentValue = config.get(currConf.category, currConf.name, currConf.defaultValue, currConf.desc, currConf.min, currConf.max).getInt(); } - for(ConfigBoolValues currConf : boolConfig){ + + for(ConfigBoolValues currConf : ConfigBoolValues.values()){ currConf.currentValue = config.get(currConf.category, currConf.name, currConf.defaultValue, currConf.desc).getBoolean(); } - crusherRecipeExceptions = config.get(ConfigCategories.OTHER.name, "Crusher Recipe Exceptions", new String[]{"ingotBrick", "ingotBrickNether"}, "The Ingots, Dusts and Ores blacklisted from being auto-registered to be crushed by the Crusher. This list uses OreDictionary Names of the Inputs only.").getStringList(); - mashedFoodCraftingExceptions = config.get(ConfigCategories.ITEMS_CRAFTING.name, "Mashed Food Crafting Exceptions", new String[]{"ActuallyAdditions:itemCoffee"}, "The ItemFood, IGrowable and IPlantable Items that can not be used to craft Mashed Food. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList(); - paxelExtraMiningWhitelist = config.get(ConfigCategories.TOOL_VALUES.name, "AIOT Extra Whitelist", new String[]{"TConstruct:GravelOre"}, "By default, the AIOT can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList(); - drillExtraminingWhitelist = config.get(ConfigCategories.TOOL_VALUES.name, "Drill Extra Whitelist", new String[]{"TConstruct:GravelOre"}, "By default, the Drill can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command.").getStringList(); - oreGenDimensionBlacklist = config.get(ConfigCategories.WORLD_GEN.name, "OreGen Dimension Blacklist", new int[0], "The IDs of the dimensions that Actually Additions OreGen (Black Quartz for example) is banned in").getIntList(); - plantDimensionBlacklist = config.get(ConfigCategories.WORLD_GEN.name, "Plant Blacklist", new int[0], "The IDs of the dimensions that Actually Additions Plants (Rice for example) are banned in").getIntList(); - minerExtraWhitelist = config.get(ConfigCategories.MACHINE_VALUES.name, "Vertical Digger Extra Whitelist", new String[0], "By default, the Vertical Digger mines everything that starts with 'ore' in the OreDictionary. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option only applies if the miner is in Ores Only Mode.").getStringList(); - minerBlacklist = config.get(ConfigCategories.MACHINE_VALUES.name, "Vertical Digger Blacklist", new String[0], "By default, the Vertical Digger mines everything that starts with 'ore' in the OreDictionary. If there is one that it can mine, but shouldn't be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option will apply in both modes.").getStringList(); + for(ConfigIntListValues currConf : ConfigIntListValues.values()){ + currConf.currentValue = config.get(currConf.category, currConf.name, currConf.defaultValue, currConf.desc).getIntList(); + } + + for(ConfigStringListValues currConf : ConfigStringListValues.values()){ + currConf.currentValue = config.get(currConf.category, currConf.name, currConf.defaultValue, currConf.desc).getStringList(); + } - lessSound = config.get(ConfigCategories.PERFORMANCE.name, "Less Sound", false, "If blocks in Actually Additions should have less sounds").getBoolean(); - lessParticles = config.get(ConfigCategories.PERFORMANCE.name, "Less Particles", false, "If blocks in Actually Additions should have less particles").getBoolean(); - lessBlockBreakingEffects = config.get(ConfigCategories.PERFORMANCE.name, "Less Block Breaking Effects", false, "If there should not be a sound effect and particles when a block is being destroyed by a breaker or similar").getBoolean(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigurationHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigurationHandler.java index d05064a5f..2a7ee7047 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigurationHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigurationHandler.java @@ -1,17 +1,18 @@ /* - * This file ("ConfigurationHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ConfigurationHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.config; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.client.event.ConfigChangedEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -20,22 +21,20 @@ import java.io.File; public class ConfigurationHandler{ - public static final String ISSUES_WARNING = " [THIS COULD CAUSE ISSUES, CHANGE AT YOUR OWN RISK!]"; - public static Configuration config; public ConfigurationHandler(File configFile){ ModUtil.LOGGER.info("Grabbing Configurations..."); - Util.registerEvent(this); + MinecraftForge.EVENT_BUS.register(this); - if(config == null){ - config = new Configuration(configFile, true); - loadConfig(); - } + config = new Configuration(configFile); + config.load(); + + redefineConfigs(); } - private static void loadConfig(){ + private static void redefineConfigs(){ ConfigValues.defineConfigValues(config); if(config.hasChanged()){ @@ -45,8 +44,8 @@ public class ConfigurationHandler{ @SubscribeEvent public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event){ - if(event.modID.equalsIgnoreCase(ModUtil.MOD_ID)){ - loadConfig(); + if(event.getModID().equalsIgnoreCase(ModUtil.MOD_ID)){ + redefineConfigs(); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/GuiConfiguration.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/GuiConfiguration.java index 4e90478b4..bc523e7b6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/GuiConfiguration.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/GuiConfiguration.java @@ -1,11 +1,11 @@ /* - * This file ("GuiConfiguration.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiConfiguration.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.config; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/GuiFactory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/GuiFactory.java index ec8280c6a..d9730cb23 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/GuiFactory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/GuiFactory.java @@ -1,11 +1,11 @@ /* - * This file ("GuiFactory.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiFactory.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.config; @@ -16,7 +16,6 @@ import net.minecraftforge.fml.client.IModGuiFactory; import java.util.Set; -@SuppressWarnings("unused") public class GuiFactory implements IModGuiFactory{ @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java index 2c1f343e2..f0f2f6798 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigBoolValues.java @@ -1,17 +1,16 @@ /* - * This file ("ConfigBoolValues.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ConfigBoolValues.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.config.values; import de.ellpeck.actuallyadditions.mod.config.ConfigCategories; -import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler; public enum ConfigBoolValues{ @@ -21,7 +20,7 @@ public enum ConfigBoolValues{ GENERATE_QUARTZ("Black Quartz", ConfigCategories.WORLD_GEN, true, "If the Black Quartz generates in the world"), DO_UPDATE_CHECK("Do Update Check", ConfigCategories.OTHER, true, "If Actually Additions should check for an Update on joining a World"), - UPDATE_CHECK_VERSION_SPECIFIC("Version Specific Update Checker", ConfigCategories.OTHER, false, "If Actually Additions' Update Check should only search for updates for the Minecraft Version you currently have"), + UPDATE_CHECK_VERSION_SPECIFIC("Version Specific Update Checker", ConfigCategories.OTHER, true, "If Actually Additions' Update Check should only search for updates for the Minecraft Version you currently have"), DO_CAT_DROPS("Do Cat Drops", ConfigCategories.OTHER, true, "If Cats drop Hairy Balls on Occasion"), @@ -39,11 +38,6 @@ public enum ConfigBoolValues{ DO_SPIDER_DROPS("Spider Cobweb Drop", ConfigCategories.MOB_DROPS, true, "If Cobwebs should sometimes drop from Spiders"), DO_BAT_DROPS("Bat Wing Drop", ConfigCategories.MOB_DROPS, true, "If Wings should sometimes drop from Bats"), - PREVENT_OIL_OVERRIDE("Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Oil Fluids from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), - PREVENT_CANOLA_OVERRIDE("Canola Oil Fluid Override", ConfigCategories.FLUIDS, false, "If not registering Canola Oil Fluids from Actually Additions if other Canola Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), - PREVENT_OIL_BLOCK_OVERRIDE("Oil Block Override", ConfigCategories.FLUIDS, false, "If not registering Oil Blocks from Actually Additions if other Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), - PREVENT_CANOLA_BLOCK_OVERRIDE("Canola Oil Block Override", ConfigCategories.FLUIDS, false, "If not registering Canola Oil Blocks from Actually Additions if other Canola Oil is already registered should be prevented"+ConfigurationHandler.ISSUES_WARNING), - CTRL_EXTRA_INFO("Advanced Info", ConfigCategories.OTHER, true, "Show Advanced Item Info when holding Control on every Item"), CTRL_INFO_FOR_EXTRA_INFO("Advanced Info Tooltips", ConfigCategories.OTHER, true, "Show the 'Press Control for more Info'-Text on Item Tooltips"), @@ -52,7 +46,16 @@ public enum ConfigBoolValues{ ENABLE_SEASONAL("Seasonal Mode", ConfigCategories.OTHER, true, "If Seasonal Mode is enabled"), - DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot spawn in Dungeons"); + DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot spawn in Dungeons"), + GEN_LUSH_CAVES("Generate Lush Caves", ConfigCategories.WORLD_GEN, true, "Should caves with trees and grass randomly generate underground"), + + BOOKLET_TEXT_TO_FILE("Booklet Text to File", ConfigCategories.OTHER, false, "Should the entire text of the booklet be put into a new file in the Minecraft Folder on startup or resource reload. This is for debug purposes only and shouldn't really ever be needed."), + + WATER_BOWL("Water Bowl", ConfigCategories.OTHER, true, "If right-clicking a bowl on water should create a water bowl"), + + LESS_SOUND("Less Sound", ConfigCategories.PERFORMANCE, false, "If blocks in Actually Additions should have less sounds"), + LESS_PARTICLES("Less Particles", ConfigCategories.PERFORMANCE, false, "If blocks in Actually Additions should have less particles"), + LESS_BLOCK_BREAKING_EFFECTS("Less Block Breaking Effects", ConfigCategories.PERFORMANCE, false, "If there should not be a sound effect and particles when a block is being destroyed by a breaker or similar"); public final String name; public final String category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java index 8c6e3cf21..e10f087b1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java @@ -1,11 +1,11 @@ /* - * This file ("ConfigCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ConfigCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.config.values; @@ -61,6 +61,7 @@ public enum ConfigCrafting{ KNIFE("Knife", ConfigCategories.ITEMS_CRAFTING), STICK_CRAFTER("Crafting Table On A Stick", ConfigCategories.ITEMS_CRAFTING), MASHED_FOOD("Mashed Food", ConfigCategories.ITEMS_CRAFTING), + RARMOR_RECONSTRUCTOR_MODULE("Rarmor Reconstructor Module", ConfigCategories.ITEMS_CRAFTING), RING_SPEED("Speed Ring", ConfigCategories.POTION_RING_CRAFTING), RING_HASTE("Haste Ring", ConfigCategories.POTION_RING_CRAFTING), @@ -96,8 +97,10 @@ public enum ConfigCrafting{ OIL_GENERATOR("Oil Generator", ConfigCategories.BLOCKS_CRAFTING), PHANTOMFACE("Phantomface", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_CONNECTOR("Phantom Connector", ConfigCategories.ITEMS_CRAFTING), + PLAYER_INTERFACE("Player Interface", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_ENERGYFACE("Phantom Energyface", ConfigCategories.BLOCKS_CRAFTING), + PHANTOM_REDSTONEFACE("Phantom Redstoneface", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_LIQUIFACE("Phantom Liquiface", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_PLACER("Phantom Placer", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_BREAKER("Phantom Breaker", ConfigCategories.BLOCKS_CRAFTING), @@ -146,6 +149,8 @@ public enum ConfigCrafting{ DIRECTIONAL_BREAKER("Long-Range Breaker", ConfigCategories.BLOCKS_CRAFTING), RANGED_COLLECTOR("Ranged Collector", ConfigCategories.BLOCKS_CRAFTING), LASER_RELAY("Laser Relay", ConfigCategories.BLOCKS_CRAFTING), + LASER_RELAY_ITEM("Item Laser Relay", ConfigCategories.BLOCKS_CRAFTING), + LASER_RELAY_ITEM_WHITELIST("Advanced Item Laser Relay", ConfigCategories.BLOCKS_CRAFTING), LASER_WRENCH("Laser Wrench", ConfigCategories.ITEMS_CRAFTING), CHEST_TO_CRATE_UPGRADE("Chest To Crate Upgrade", ConfigCategories.ITEMS_CRAFTING), @@ -153,7 +158,12 @@ public enum ConfigCrafting{ DRILL_CORE("Drill Core", ConfigCategories.ITEMS_CRAFTING), ATOMIC_RECONSTRUCTOR("Atomic Reconstructor", ConfigCategories.BLOCKS_CRAFTING), MINER("Miner", ConfigCategories.BLOCKS_CRAFTING), - FIREWORK_BOX("Firework Box", ConfigCategories.BLOCKS_CRAFTING); + FIREWORK_BOX("Firework Box", ConfigCategories.BLOCKS_CRAFTING), + ENDER_STAR("Ender Star", ConfigCategories.ITEMS_CRAFTING), + SPAWNER_CHANGER("Spawner Changer", ConfigCategories.ITEMS_CRAFTING), + ITEM_INTERFACE("Item Interface", ConfigCategories.BLOCKS_CRAFTING), + DISPLAY_STAND("Display Stand", ConfigCategories.BLOCKS_CRAFTING), + FILTER("Item Filter", ConfigCategories.ITEMS_CRAFTING); public final String name; public final String category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntListValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntListValues.java new file mode 100644 index 000000000..e1f7b8a66 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntListValues.java @@ -0,0 +1,38 @@ +/* + * This file ("ConfigIntListValues.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.config.values; + +import de.ellpeck.actuallyadditions.mod.config.ConfigCategories; + +public enum ConfigIntListValues{ + + ORE_GEN_DIMENSION_BLACKLIST("OreGen Dimension Blacklist", ConfigCategories.WORLD_GEN, new int[0], "The IDs of the dimensions that Actually Additions OreGen (Black Quartz for example) is banned in. This also applies for other world gen like lush caves."), + PLANT_DIMENSION_BLACKLIST("Plant Blacklist", ConfigCategories.WORLD_GEN, new int[0], "The IDs of the dimensions that Actually Additions Plants (Rice for example) are banned in"); + + public final String name; + public final String category; + public final int[] defaultValue; + public final String desc; + + public int[] currentValue; + + ConfigIntListValues(String name, ConfigCategories category, int[] defaultValue, String desc){ + this.name = name; + this.category = category.name; + this.defaultValue = defaultValue; + this.desc = desc; + } + + public int[] getValue(){ + return this.currentValue; + } + +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java index 59344495d..bcf79233a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigIntValues.java @@ -1,11 +1,11 @@ /* - * This file ("ConfigIntValues.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ConfigIntValues.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.config.values; @@ -21,6 +21,7 @@ public enum ConfigIntValues{ FLAX_AMOUNT("Flax: Amount", ConfigCategories.WORLD_GEN, 8, 1, 50, "The Amount of Flax generating"), COFFEE_AMOUNT("Coffee: Amount", ConfigCategories.WORLD_GEN, 6, 1, 50, "The Amount of Coffee generating"), BLACK_LOTUS_AMOUNT("Black Lotus: Amount", ConfigCategories.WORLD_GEN, 14, 1, 50, "The Amount of Black Lotus generating"), + LUSH_CAVE_CHANCE("Lush Caves: Chance", ConfigCategories.WORLD_GEN, 20, 1, 100, "The chance for lush caves to generate. The lower the number, the likelier."), LASER_RELAY_LOSS("Laser Relay: Loss", ConfigCategories.MACHINE_VALUES, 5, 0, 80, "The Energy Loss of the Laser Relay per Transfer in Percent"), LASER_RELAY_MAX_TRANSFER("Laser Relay: Max Transfer", ConfigCategories.MACHINE_VALUES, 10000, 100, 1000000, "The max amount of RF a Laser Relay can receive and try to transfer (if it's given 100 RF and can only transfer 50, it will only accept 50, it won't waste any power!)"), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigStringListValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigStringListValues.java new file mode 100644 index 000000000..74fc57ea8 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigStringListValues.java @@ -0,0 +1,44 @@ +/* + * This file ("ConfigStringListValues.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.config.values; + +import de.ellpeck.actuallyadditions.mod.config.ConfigCategories; + +public enum ConfigStringListValues{ + + CRUSHER_RECIPE_EXCEPTIONS("Crusher Recipe Exceptions", ConfigCategories.OTHER, new String[]{"ingotBrick", "ingotBrickNether"}, "The Ingots, Dusts and Ores blacklisted from being auto-registered to be crushed by the Crusher. This list uses OreDictionary Names of the Inputs only."), + MASHED_FOOD_CRAFTING_EXCEPTIONS("Mashed Food Crafting Exceptions", ConfigCategories.ITEMS_CRAFTING, new String[]{"ActuallyAdditions:itemCoffee"}, "The ItemFood, IGrowable and IPlantable Items that can not be used to craft Mashed Food. These are the actual registered Item Names, the ones you use, for example, when using the /give Command."), + PAXEL_EXTRA_MINING_WHITELIST("AIOT Extra Whitelist", ConfigCategories.TOOL_VALUES, new String[]{"TConstruct:GravelOre"}, "By default, the AIOT can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command."), + DRILL_EXTRA_MINING_WHITELIST("Drill Extra Whitelist", ConfigCategories.TOOL_VALUES, new String[]{"TConstruct:GravelOre"}, "By default, the Drill can mine certain blocks. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command."), + MINER_EXTRA_WHITELIST("Vertical Digger Extra Whitelist", ConfigCategories.MACHINE_VALUES, new String[0], "By default, the Vertical Digger mines everything that starts with 'ore' in the OreDictionary. If there is one that it can't mine, but should be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option only applies if the miner is in Ores Only Mode."), + MINER_BLACKLIST("Vertical Digger Blacklist", ConfigCategories.MACHINE_VALUES, new String[0], "By default, the Vertical Digger mines everything that starts with 'ore' in the OreDictionary. If there is one that it can mine, but shouldn't be able to, put its REGISTRY NAME here. These are the actual registered Item Names, the ones you use, for example, when using the /give Command. This Config Option will apply in both modes."), + REPAIRER_EXTRA_WHITELIST("Item Repairer Extra Whitelist", ConfigCategories.MACHINE_VALUES, new String[]{"tconstruct:pickaxe", "tconstruct:shovel", "tconstruct:hatchet", "tconstruct:mattock", "tconstruct:broadsword", "tconstruct:longsword", "tconstruct:frypan", "tconstruct:battlesign", "tconstruct:hammer", "tconstruct:excavator", "tconstruct:lumberaxe", "tconstruct:cleaver"}, "By default, the Item Repairer only repairs items which are repairable in an anvil. Add an item's REGISTRY NAME here if you want it to be repairable."), + SPAWNER_CHANGER_BLACKLIST("Spawner Changer Blacklist", ConfigCategories.OTHER, new String[]{"VillagerGolem"}, "By default, the Spawner Changer allows every living entity to be put into a spawner. If there is one that shouldn't be able to, put its MAPPING NAME here."); + + public final String name; + public final String category; + public final String[] defaultValue; + public final String desc; + + public String[] currentValue; + + ConfigStringListValues(String name, ConfigCategories category, String[] defaultValue, String desc){ + this.name = name; + this.category = category.name; + this.defaultValue = defaultValue; + this.desc = desc; + } + + public String[] getValue(){ + return this.currentValue; + } + +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java index 1f5fcde97..8b918ca82 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java @@ -1,11 +1,11 @@ /* - * This file ("BlockCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BlockCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.crafting; @@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -26,8 +27,9 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -public class BlockCrafting{ +public final class BlockCrafting{ + public static final IRecipe[] RECIPES_LAMPS = new IRecipe[BlockColoredLamp.ALL_LAMP_TYPES.length]; public static IRecipe recipeSmileyCloud; public static IRecipe recipePhantomface; public static IRecipe recipeLiquiface; @@ -68,9 +70,10 @@ public class BlockCrafting{ public static IRecipe recipeFeeder; public static IRecipe recipeCompost; public static IRecipe recipeCrate; + public static IRecipe recipeCrateMedium; + public static IRecipe recipeCrateLarge; public static IRecipe recipeFermentingBarrel; public static IRecipe recipeCanolaPress; - public static IRecipe[] recipesLamps = new IRecipe[BlockColoredLamp.allLampTypes.length]; public static IRecipe recipePowerer; public static IRecipe recipeLeafGen; public static IRecipe recipeDirectionalBreaker; @@ -80,17 +83,38 @@ public class BlockCrafting{ public static IRecipe recipeAtomicReconstructor; public static IRecipe recipeMiner; public static IRecipe recipeFireworkBox; + public static IRecipe recipePhantomRedstoneface; + public static IRecipe recipeLaserRelayItem; + public static IRecipe recipeLaserRelayItemWhitelist; + public static IRecipe recipeItemInterface; + public static IRecipe recipeBookStand; + public static IRecipe recipePlayerInterface; + public static IRecipe recipeDisplayStand; public static void init(){ + //Book Stand + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockBookletStand), new ItemStack(InitItems.itemBooklet), "plankWood")); + recipeBookStand = RecipeUtil.lastIRecipe(); + //Firework Box if(ConfigCrafting.FIREWORK_BOX.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFireworkBox), "GGG", "SSS", "CCC", - 'G', new ItemStack(Items.gunpowder), - 'S', new ItemStack(Items.stick), + 'G', new ItemStack(Items.GUNPOWDER), + 'S', new ItemStack(Items.STICK), 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()))); - recipeFireworkBox = Util.GetRecipes.lastIRecipe(); + recipeFireworkBox = RecipeUtil.lastIRecipe(); + } + + //Display Stand + if(ConfigCrafting.DISPLAY_STAND.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockDisplayStand), + " R ", "EEE", "GGG", + 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), + 'E', new ItemStack(InitBlocks.blockTestifiBucksGreenWall), + 'G', new ItemStack(InitBlocks.blockTestifiBucksWhiteWall))); + recipeDisplayStand = RecipeUtil.lastIRecipe(); } //Miner @@ -101,7 +125,7 @@ public class BlockCrafting{ 'I', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'C', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 'D', new ItemStack(InitItems.itemDrill, 1, Util.WILDCARD))); - recipeMiner = Util.GetRecipes.lastIRecipe(); + recipeMiner = RecipeUtil.lastIRecipe(); } //Quartz @@ -166,29 +190,58 @@ public class BlockCrafting{ 'R', "dustRedstone", 'I', "ingotIron", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()))); - recipeAtomicReconstructor = Util.GetRecipes.lastIRecipe(); + recipeAtomicReconstructor = RecipeUtil.lastIRecipe(); } //Laser Relay if(ConfigCrafting.LASER_RELAY.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLaserRelay, 2), "OBO", "RCR", "OBO", - 'B', new ItemStack(Blocks.redstone_block), - 'O', new ItemStack(Blocks.obsidian), + 'B', new ItemStack(Blocks.REDSTONE_BLOCK), + 'O', new ItemStack(Blocks.OBSIDIAN), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeLaserRelay = Util.GetRecipes.lastIRecipe(); + recipeLaserRelay = RecipeUtil.lastIRecipe(); + } + + //Item Laser Relay + if(ConfigCrafting.LASER_RELAY_ITEM.isEnabled()){ + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockLaserRelayItem), + new ItemStack(InitBlocks.blockLaserRelay), + new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); + recipeLaserRelayItem = RecipeUtil.lastIRecipe(); + } + + //Whitelist Item Laser Relay + if(ConfigCrafting.LASER_RELAY_ITEM_WHITELIST.isEnabled()){ + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), + new ItemStack(InitBlocks.blockLaserRelayItem), + new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), + new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), + new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()))); + recipeLaserRelayItemWhitelist = RecipeUtil.lastIRecipe(); + } + + //Item Interface + if(ConfigCrafting.ITEM_INTERFACE.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockItemViewer), + "OBO", "RCR", "OBO", + 'B', new ItemStack(Items.REDSTONE), + 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), + 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), + 'C', new ItemStack(Blocks.CHEST))); + recipeItemInterface = RecipeUtil.lastIRecipe(); } //Ranged Collector if(ConfigCrafting.RANGED_COLLECTOR.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockRangedCollector), " A ", "EHE", " C ", - 'E', new ItemStack(Items.ender_pearl), - 'H', new ItemStack(Blocks.hopper), + 'E', new ItemStack(Items.ENDER_PEARL), + 'H', new ItemStack(Blocks.HOPPER), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'A', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()))); - recipeRangedCollector = Util.GetRecipes.lastIRecipe(); + recipeRangedCollector = RecipeUtil.lastIRecipe(); } //Directional Breaker @@ -197,16 +250,16 @@ public class BlockCrafting{ "BBB", " C ", 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 'B', new ItemStack(InitBlocks.blockBreaker))); - recipeDirectionalBreaker = Util.GetRecipes.lastIRecipe(); + recipeDirectionalBreaker = RecipeUtil.lastIRecipe(); } //Smiley Cloud if(ConfigCrafting.CLOUD.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockSmileyCloud), " W ", "WXW", " W ", - 'W', new ItemStack(Blocks.wool, 1, Util.WILDCARD), + 'W', new ItemStack(Blocks.WOOL, 1, Util.WILDCARD), 'X', new ItemStack(InitItems.itemSolidifiedExperience))); - recipeSmileyCloud = Util.GetRecipes.lastIRecipe(); + recipeSmileyCloud = RecipeUtil.lastIRecipe(); } //Compost @@ -215,7 +268,7 @@ public class BlockCrafting{ "W W", "W W", "WCW", 'W', "plankWood", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()))); - recipeCompost = Util.GetRecipes.lastIRecipe(); + recipeCompost = RecipeUtil.lastIRecipe(); } //XP Solidifier @@ -225,15 +278,15 @@ public class BlockCrafting{ 'X', new ItemStack(InitItems.itemSolidifiedExperience), 'D', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeSolidifier = Util.GetRecipes.lastIRecipe(); + recipeSolidifier = RecipeUtil.lastIRecipe(); } //Charcoal Block GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.CHARCOAL_BLOCK.ordinal()), "CCC", "CCC", "CCC", - 'C', new ItemStack(Items.coal, 1, 1)); - recipeBlockChar = Util.GetRecipes.lastIRecipe(); - GameRegistry.addShapelessRecipe(new ItemStack(Items.coal, 9, 1), + 'C', new ItemStack(Items.COAL, 1, 1)); + recipeBlockChar = RecipeUtil.lastIRecipe(); + GameRegistry.addShapelessRecipe(new ItemStack(Items.COAL, 9, 1), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.CHARCOAL_BLOCK.ordinal())); //Wood Casing @@ -243,7 +296,7 @@ public class BlockCrafting{ 'W', "plankWood", 'R', "logWood", 'S', "stickWood")); - recipeCase = Util.GetRecipes.lastIRecipe(); + recipeCase = RecipeUtil.lastIRecipe(); } //Iron Casing @@ -253,17 +306,17 @@ public class BlockCrafting{ 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 'W', "ingotIron", 'S', "stickWood")); - recipeIronCase = Util.GetRecipes.lastIRecipe(); + recipeIronCase = RecipeUtil.lastIRecipe(); } //Ender Casing if(ConfigCrafting.ENDER_CASING.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()), "WSW", "SRS", "WSW", - 'W', new ItemStack(Items.ender_pearl), + 'W', new ItemStack(Items.ENDER_PEARL), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()))); - recipeEnderCase = Util.GetRecipes.lastIRecipe(); + recipeEnderCase = RecipeUtil.lastIRecipe(); } //Phantom Booster @@ -273,7 +326,7 @@ public class BlockCrafting{ 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()))); - recipePhantomBooster = Util.GetRecipes.lastIRecipe(); + recipePhantomBooster = RecipeUtil.lastIRecipe(); } //Coffee Machine @@ -284,7 +337,7 @@ public class BlockCrafting{ 'C', InitItems.itemCoffeeBean, 'S', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'A', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()))); - recipeCoffeeMachine = Util.GetRecipes.lastIRecipe(); + recipeCoffeeMachine = RecipeUtil.lastIRecipe(); } //Energizer @@ -294,7 +347,7 @@ public class BlockCrafting{ 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()))); - recipeEnergizer = Util.GetRecipes.lastIRecipe(); + recipeEnergizer = RecipeUtil.lastIRecipe(); } //Enervator @@ -304,7 +357,7 @@ public class BlockCrafting{ 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()))); - recipeEnervator = Util.GetRecipes.lastIRecipe(); + recipeEnervator = RecipeUtil.lastIRecipe(); } //Lava Factory @@ -314,8 +367,8 @@ public class BlockCrafting{ 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), - 'L', Items.lava_bucket)); - recipeLavaFactory = Util.GetRecipes.lastIRecipe(); + 'L', Items.LAVA_BUCKET)); + recipeLavaFactory = RecipeUtil.lastIRecipe(); } //Casing @@ -324,7 +377,7 @@ public class BlockCrafting{ "ICI", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()))); - recipeCasing = Util.GetRecipes.lastIRecipe(); + recipeCasing = RecipeUtil.lastIRecipe(); } //Canola Press @@ -335,7 +388,7 @@ public class BlockCrafting{ 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal()))); - recipeCanolaPress = Util.GetRecipes.lastIRecipe(); + recipeCanolaPress = RecipeUtil.lastIRecipe(); } //Fermenting Barrel @@ -346,7 +399,7 @@ public class BlockCrafting{ 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal()))); - recipeFermentingBarrel = Util.GetRecipes.lastIRecipe(); + recipeFermentingBarrel = RecipeUtil.lastIRecipe(); } //Phantomface @@ -354,10 +407,21 @@ public class BlockCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockPhantomface), " C ", "EBE", " S ", 'E', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), - 'C', Blocks.chest, + 'C', Blocks.CHEST, 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()))); - recipePhantomface = Util.GetRecipes.lastIRecipe(); + recipePhantomface = RecipeUtil.lastIRecipe(); + } + + //Player Interface + if(ConfigCrafting.PLAYER_INTERFACE.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockPlayerInterface), + "BCB", "EBE", "BSB", + 'E', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), + 'C', new ItemStack(Items.SKULL, 1, 1), + 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), + 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()))); + recipePlayerInterface = RecipeUtil.lastIRecipe(); } //Phantom Placer @@ -365,7 +429,7 @@ public class BlockCrafting{ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockPhantomPlacer), InitBlocks.blockPlacer, InitBlocks.blockPhantomface)); - recipePhantomPlacer = Util.GetRecipes.lastIRecipe(); + recipePhantomPlacer = RecipeUtil.lastIRecipe(); } //Phantom Breaker @@ -373,7 +437,7 @@ public class BlockCrafting{ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockPhantomBreaker), InitBlocks.blockBreaker, InitBlocks.blockPhantomface)); - recipePhantomBreaker = Util.GetRecipes.lastIRecipe(); + recipePhantomBreaker = RecipeUtil.lastIRecipe(); } //Phantom Energyface @@ -382,34 +446,44 @@ public class BlockCrafting{ " R ", "RFR", " R ", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'F', InitBlocks.blockPhantomface)); - recipeEnergyface = Util.GetRecipes.lastIRecipe(); + recipeEnergyface = RecipeUtil.lastIRecipe(); + } + + //Phantom Redstoneface + if(ConfigCrafting.PHANTOM_REDSTONEFACE.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockPhantomRedstoneface), + "SRS", "RFR", "SRS", + 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), + 'S', new ItemStack(Items.REDSTONE), + 'F', InitBlocks.blockPhantomface)); + recipePhantomRedstoneface = RecipeUtil.lastIRecipe(); } //Phantom Liquiface if(ConfigCrafting.PHANTOM_LIQUIFACE.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockPhantomLiquiface), "RFR", - 'R', Items.bucket, + 'R', Items.BUCKET, 'F', InitBlocks.blockPhantomface)); - recipeLiquiface = Util.GetRecipes.lastIRecipe(); + recipeLiquiface = RecipeUtil.lastIRecipe(); } //Liquid Placer if(ConfigCrafting.LIQUID_PLACER.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFluidPlacer), "RFR", - 'R', Items.bucket, + 'R', Items.BUCKET, 'F', InitBlocks.blockPlacer)); - recipeLiquidPlacer = Util.GetRecipes.lastIRecipe(); + recipeLiquidPlacer = RecipeUtil.lastIRecipe(); } //Liquid Breaker if(ConfigCrafting.LIQUID_BREAKER.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFluidCollector), "RFR", - 'R', Items.bucket, + 'R', Items.BUCKET, 'F', InitBlocks.blockBreaker)); - recipeLiquidCollector = Util.GetRecipes.lastIRecipe(); + recipeLiquidCollector = RecipeUtil.lastIRecipe(); } //Oil Generator @@ -419,7 +493,7 @@ public class BlockCrafting{ 'C', "cobblestone", 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'B', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal()))); - recipeOilGen = Util.GetRecipes.lastIRecipe(); + recipeOilGen = RecipeUtil.lastIRecipe(); } //Coal Generator @@ -428,8 +502,8 @@ public class BlockCrafting{ "CRC", "CBC", "CRC", 'C', "cobblestone", 'B', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), - 'R', new ItemStack(Items.coal, 1, Util.WILDCARD))); - recipeCoalGen = Util.GetRecipes.lastIRecipe(); + 'R', new ItemStack(Items.COAL, 1, Util.WILDCARD))); + recipeCoalGen = RecipeUtil.lastIRecipe(); } //Leaf Generator @@ -441,30 +515,30 @@ public class BlockCrafting{ 'E', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'L', "treeLeaves", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeLeafGen = Util.GetRecipes.lastIRecipe(); + recipeLeafGen = RecipeUtil.lastIRecipe(); } //Enderpearl Block GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()), "EE", "EE", - 'E', Items.ender_pearl)); - recipeEnderPearlBlock = Util.GetRecipes.lastIRecipe(); - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.ender_pearl, 4), + 'E', Items.ENDER_PEARL)); + recipeEnderPearlBlock = RecipeUtil.lastIRecipe(); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.ENDER_PEARL, 4), new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()))); //Quartz Block GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), "QQ", "QQ", 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()))); - recipeQuartzBlock = Util.GetRecipes.lastIRecipe(); + recipeQuartzBlock = RecipeUtil.lastIRecipe(); //Fishing Net if(ConfigCrafting.FISHING_NET.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFishingNet), "SSS", "SDS", "SSS", 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), - 'S', Items.string)); - recipeFisher = Util.GetRecipes.lastIRecipe(); + 'S', Items.STRING)); + recipeFisher = RecipeUtil.lastIRecipe(); } //Repairer @@ -475,7 +549,7 @@ public class BlockCrafting{ 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()))); - recipeRepairer = Util.GetRecipes.lastIRecipe(); + recipeRepairer = RecipeUtil.lastIRecipe(); } //Solar Panel @@ -486,8 +560,8 @@ public class BlockCrafting{ 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), - 'B', new ItemStack(Blocks.iron_bars))); - recipeSolar = Util.GetRecipes.lastIRecipe(); + 'B', new ItemStack(Blocks.IRON_BARS))); + recipeSolar = RecipeUtil.lastIRecipe(); } //Heat Collector @@ -495,25 +569,25 @@ public class BlockCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockHeatCollector), "BRB", "CDC", "BQB", 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), - 'R', new ItemStack(Items.repeater), + 'R', new ItemStack(Items.REPEATER), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), - 'L', new ItemStack(Items.lava_bucket), + 'L', new ItemStack(Items.LAVA_BUCKET), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), - 'B', new ItemStack(Blocks.iron_bars))); - recipeHeatCollector = Util.GetRecipes.lastIRecipe(); + 'B', new ItemStack(Blocks.IRON_BARS))); + recipeHeatCollector = RecipeUtil.lastIRecipe(); } //Quartz Pillar GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()), "Q", "Q", 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()))); - recipeQuartzPillar = Util.GetRecipes.lastIRecipe(); + recipeQuartzPillar = RecipeUtil.lastIRecipe(); //Chiseled Quartz GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 2, TheMiscBlocks.QUARTZ_CHISELED.ordinal()), "Q", "Q", 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()))); - recipeQuartzChiseled = Util.GetRecipes.lastIRecipe(); + recipeQuartzChiseled = RecipeUtil.lastIRecipe(); //Inputter if(ConfigCrafting.INPUTTER.isEnabled()){ @@ -522,14 +596,14 @@ public class BlockCrafting{ 'W', "plankWood", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'H', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()))); - recipeESD = Util.GetRecipes.lastIRecipe(); + recipeESD = RecipeUtil.lastIRecipe(); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockInputterAdvanced), InitBlocks.blockInputter, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()))); - recipeAdvancedESD = Util.GetRecipes.lastIRecipe(); + recipeAdvancedESD = RecipeUtil.lastIRecipe(); } //Crusher @@ -540,9 +614,9 @@ public class BlockCrafting{ 'C', "cobblestone", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), - 'P', new ItemStack(Blocks.piston), - 'F', new ItemStack(Items.flint))); - recipeCrusher = Util.GetRecipes.lastIRecipe(); + 'P', new ItemStack(Blocks.PISTON), + 'F', new ItemStack(Items.FLINT))); + recipeCrusher = RecipeUtil.lastIRecipe(); } //Double Crusher @@ -553,8 +627,8 @@ public class BlockCrafting{ 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'R', InitBlocks.blockGrinder, 'F', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), - 'P', new ItemStack(Blocks.piston))); - recipeDoubleCrusher = Util.GetRecipes.lastIRecipe(); + 'P', new ItemStack(Blocks.PISTON))); + recipeDoubleCrusher = RecipeUtil.lastIRecipe(); } //Double Furnace @@ -563,10 +637,10 @@ public class BlockCrafting{ "PDC", "RFR", "CDP", 'C', "cobblestone", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), - 'R', new ItemStack(Blocks.furnace), + 'R', new ItemStack(Blocks.FURNACE), 'F', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()))); - recipeFurnace = Util.GetRecipes.lastIRecipe(); + recipeFurnace = RecipeUtil.lastIRecipe(); } //Feeder @@ -575,19 +649,33 @@ public class BlockCrafting{ "WCW", "DHD", "WCW", 'W', "plankWood", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), - 'C', new ItemStack(Items.golden_carrot), + 'C', new ItemStack(Items.GOLDEN_CARROT), 'H', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()))); - recipeFeeder = Util.GetRecipes.lastIRecipe(); + recipeFeeder = RecipeUtil.lastIRecipe(); } //Giant Chest if(ConfigCrafting.GIANT_CHEST.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGiantChest), "CWC", "WDW", "CWC", - 'C', new ItemStack(Blocks.chest), + 'C', new ItemStack(Blocks.CHEST), 'D', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), 'W', "plankWood")); - recipeCrate = Util.GetRecipes.lastIRecipe(); + recipeCrate = RecipeUtil.lastIRecipe(); + + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGiantChestMedium), + "CWC", "WDW", "CWC", + 'C', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), + 'D', new ItemStack(InitBlocks.blockGiantChest), + 'W', "plankWood")); + recipeCrateMedium = RecipeUtil.lastIRecipe(); + + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGiantChestLarge), + "CWC", "WDW", "CWC", + 'C', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), + 'D', new ItemStack(InitBlocks.blockGiantChestMedium), + 'W', "plankWood")); + recipeCrateLarge = RecipeUtil.lastIRecipe(); } //Greenhouse Glass @@ -597,7 +685,7 @@ public class BlockCrafting{ 'G', "blockGlass", 'D', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()), 'S', "treeSapling")); - recipeGlass = Util.GetRecipes.lastIRecipe(); + recipeGlass = RecipeUtil.lastIRecipe(); } //Placer @@ -607,7 +695,7 @@ public class BlockCrafting{ 'C', "cobblestone", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()))); - recipePlacer = Util.GetRecipes.lastIRecipe(); + recipePlacer = RecipeUtil.lastIRecipe(); } //Breaker @@ -617,7 +705,7 @@ public class BlockCrafting{ 'C', "cobblestone", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'P', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()))); - recipeBreaker = Util.GetRecipes.lastIRecipe(); + recipeBreaker = RecipeUtil.lastIRecipe(); } //Dropper @@ -626,27 +714,27 @@ public class BlockCrafting{ "CBC", "CDR", "CBC", 'B', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'C', "cobblestone", - 'D', Blocks.dropper, + 'D', Blocks.DROPPER, 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeDropper = Util.GetRecipes.lastIRecipe(); + recipeDropper = RecipeUtil.lastIRecipe(); } if(ConfigCrafting.LAMPS.isEnabled()){ - for(int i = 0; i < BlockColoredLamp.allLampTypes.length; i++){ + for(int i = 0; i < BlockColoredLamp.ALL_LAMP_TYPES.length; i++){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockColoredLamp, 6, i), "GCG", "DQD", "GCG", 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'G', "glowstone", - 'D', "dye"+BlockColoredLamp.allLampTypes[i].name, + 'D', "dye"+BlockColoredLamp.ALL_LAMP_TYPES[i].name, 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()))); - recipesLamps[i] = Util.GetRecipes.lastIRecipe(); + RECIPES_LAMPS[i] = RecipeUtil.lastIRecipe(); } GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLampPowerer, 4), "XXX", "XLX", "XXX", 'X', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'L', new ItemStack(InitBlocks.blockColoredLamp, 1, Util.WILDCARD))); - recipePowerer = Util.GetRecipes.lastIRecipe(); + recipePowerer = RecipeUtil.lastIRecipe(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java index 91c307a7e..2ed31929c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java @@ -1,11 +1,11 @@ /* - * This file ("CrusherCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CrusherCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.crafting; @@ -17,56 +17,56 @@ import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; +import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import java.util.ArrayList; -public class CrusherCrafting{ +public final class CrusherCrafting{ + public static final ArrayList MISC_RECIPES = new ArrayList(); public static CrusherRecipe recipeIronHorseArmor; public static CrusherRecipe recipeGoldHorseArmor; public static CrusherRecipe recipeDiamondHorseArmor; - public static ArrayList miscRecipes = new ArrayList(); public static void init(){ ModUtil.LOGGER.info("Initializing Crusher Recipes..."); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.bone), new ItemStack(Items.dye, 6, 15)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.reeds), new ItemStack(Items.sugar, 3)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.BONE), new ItemStack(Items.DYE, 6, 15)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.REEDS), new ItemStack(Items.SUGAR, 3)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.yellow_flower), new ItemStack(Items.dye, 3, 11)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 0), new ItemStack(Items.dye, 3, 1)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 1), new ItemStack(Items.dye, 3, 12)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 2), new ItemStack(Items.dye, 3, 13)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 3), new ItemStack(Items.dye, 3, 7)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 4), new ItemStack(Items.dye, 3, 1)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 5), new ItemStack(Items.dye, 3, 14)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 6), new ItemStack(Items.dye, 3, 7)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 7), new ItemStack(Items.dye, 3, 9)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.red_flower, 1, 8), new ItemStack(Items.dye, 3, 7)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.double_plant, 1, 0), new ItemStack(Items.dye, 4, 11)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.double_plant, 1, 1), new ItemStack(Items.dye, 4, 13)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.double_plant, 1, 4), new ItemStack(Items.dye, 4, 1)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.double_plant, 1, 5), new ItemStack(Items.dye, 4, 9)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.YELLOW_FLOWER), new ItemStack(Items.DYE, 3, 11)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 0), new ItemStack(Items.DYE, 3, 1)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 1), new ItemStack(Items.DYE, 3, 12)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 2), new ItemStack(Items.DYE, 3, 13)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 3), new ItemStack(Items.DYE, 3, 7)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 4), new ItemStack(Items.DYE, 3, 1)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 5), new ItemStack(Items.DYE, 3, 14)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 6), new ItemStack(Items.DYE, 3, 7)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 7), new ItemStack(Items.DYE, 3, 9)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 8), new ItemStack(Items.DYE, 3, 7)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 0), new ItemStack(Items.DYE, 4, 11)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 1), new ItemStack(Items.DYE, 4, 13)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 4), new ItemStack(Items.DYE, 4, 1)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 5), new ItemStack(Items.DYE, 4, 9)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe("oreRedstone", "dustRedstone", 10); ActuallyAdditionsAPI.addCrusherRecipe("oreLapis", "gemLapis", 12); @@ -75,35 +75,35 @@ public class CrusherCrafting{ ActuallyAdditionsAPI.addCrusherRecipe("blockCoal", "coal", 9); ActuallyAdditionsAPI.addCrusherRecipe("oreQuartz", "gemQuartz", 3); ActuallyAdditionsAPI.addCrusherRecipe("cobblestone", "sand", 1); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint), new ItemStack(Items.flint), 50); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT), new ItemStack(Items.FLINT), 50); ActuallyAdditionsAPI.addCrusherRecipe("stone", "cobblestone", 1); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.SUGAR, 2)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.glowstone), new ItemStack(Items.glowstone_dust, 4)); - miscRecipes.add(Util.GetRecipes.lastCrusherRecipe()); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GLOWSTONE), new ItemStack(Items.GLOWSTONE_DUST, 4)); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe("oreNickel", "dustNickel", 2, "dustPlatinum", 1, 15); ActuallyAdditionsAPI.addCrusherRecipe("oreIron", "dustIron", 2, "dustGold", 1, 20); if(ConfigCrafting.HORSE_ARMORS.isEnabled()){ - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.iron_horse_armor), "dustIron", 8); - recipeIronHorseArmor = Util.GetRecipes.lastCrusherRecipe(); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.IRON_HORSE_ARMOR), "dustIron", 8); + recipeIronHorseArmor = RecipeUtil.lastCrusherRecipe(); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.golden_horse_armor), "dustGold", 8); - recipeGoldHorseArmor = Util.GetRecipes.lastCrusherRecipe(); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.GOLDEN_HORSE_ARMOR), "dustGold", 8); + recipeGoldHorseArmor = RecipeUtil.lastCrusherRecipe(); - ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.diamond_horse_armor), "dustDiamond", 8); - recipeDiamondHorseArmor = Util.GetRecipes.lastCrusherRecipe(); + ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.DIAMOND_HORSE_ARMOR), "dustDiamond", 8); + recipeDiamondHorseArmor = RecipeUtil.lastCrusherRecipe(); } - CrusherRecipeRegistry.searchCases.add(new CrusherRecipeRegistry.SearchCase("oreNether", 6)); - CrusherRecipeRegistry.searchCases.add(new CrusherRecipeRegistry.SearchCase("orePoor", 4, "nugget")); - CrusherRecipeRegistry.searchCases.add(new CrusherRecipeRegistry.SearchCase("denseore", 8)); - CrusherRecipeRegistry.searchCases.add(new CrusherRecipeRegistry.SearchCase("gem", 1)); - CrusherRecipeRegistry.searchCases.add(new CrusherRecipeRegistry.SearchCase("ingot", 1)); - CrusherRecipeRegistry.searchCases.add(new CrusherRecipeRegistry.SearchCase("ore", 2)); + CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("oreNether", 6)); + CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("orePoor", 4, "nugget")); + CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("denseore", 8)); + CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("gem", 1)); + CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("ingot", 1)); + CrusherRecipeRegistry.SEARCH_CASES.add(new CrusherRecipeRegistry.SearchCase("ore", 2)); CrusherRecipeRegistry.registerFinally(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java index d2cb5a0b0..cbb4d4f10 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java @@ -1,11 +1,11 @@ /* - * This file ("FoodCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("FoodCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.crafting; @@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -23,7 +24,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -public class FoodCrafting{ +public final class FoodCrafting{ public static IRecipe recipePizza; public static IRecipe recipeHamburger; @@ -56,8 +57,8 @@ public class FoodCrafting{ //Bacon if(ConfigCrafting.BACON.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.BACON.ordinal()), - knifeStack.copy(), new ItemStack(Items.cooked_porkchop))); - recipeBacon = Util.GetRecipes.lastIRecipe(); + knifeStack.copy(), new ItemStack(Items.COOKED_PORKCHOP))); + recipeBacon = RecipeUtil.lastIRecipe(); } //Baguette @@ -71,12 +72,12 @@ public class FoodCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal()), "HKH", "MCF", " D ", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), - 'M', new ItemStack(Blocks.brown_mushroom), + 'M', new ItemStack(Blocks.BROWN_MUSHROOM), 'C', "cropCarrot", - 'F', new ItemStack(Items.cooked_fish, 1, Util.WILDCARD), + 'F', new ItemStack(Items.COOKED_FISH, 1, Util.WILDCARD), 'K', knifeStack.copy(), 'H', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()))); - recipePizza = Util.GetRecipes.lastIRecipe(); + recipePizza = RecipeUtil.lastIRecipe(); } //Hamburger @@ -86,8 +87,8 @@ public class FoodCrafting{ 'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()), 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), 'K', knifeStack.copy(), - 'B', new ItemStack(Items.cooked_beef))); - recipeHamburger = Util.GetRecipes.lastIRecipe(); + 'B', new ItemStack(Items.COOKED_BEEF))); + recipeHamburger = RecipeUtil.lastIRecipe(); } //Big Cookie @@ -95,28 +96,28 @@ public class FoodCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.BIG_COOKIE.ordinal()), "DCD", "CDC", "DCD", 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), - 'C', new ItemStack(Items.dye, 1, 3))); - recipeBigCookie = Util.GetRecipes.lastIRecipe(); + 'C', new ItemStack(Items.DYE, 1, 3))); + recipeBigCookie = RecipeUtil.lastIRecipe(); } //Sub Sandwich if(ConfigCrafting.SUB.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SUBMARINE_SANDWICH.ordinal()), "KCP", "FB ", "PCP", - 'P', new ItemStack(Items.paper), + 'P', new ItemStack(Items.PAPER), 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), - 'F', new ItemStack(Items.cooked_fish, 1, Util.WILDCARD), + 'F', new ItemStack(Items.COOKED_BEEF, 1, Util.WILDCARD), 'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()), 'K', knifeStack.copy())); - recipeSubSandwich = Util.GetRecipes.lastIRecipe(); + recipeSubSandwich = RecipeUtil.lastIRecipe(); } //French Fry if(ConfigCrafting.FRENCH_FRY.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.FRENCH_FRY.ordinal()), - new ItemStack(Items.baked_potato), + new ItemStack(Items.BAKED_POTATO), knifeStack.copy())); - recipeFrenchFry = Util.GetRecipes.lastIRecipe(); + recipeFrenchFry = RecipeUtil.lastIRecipe(); } //French Fries @@ -125,40 +126,40 @@ public class FoodCrafting{ "FFF", " P ", 'P', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), 'F', new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal()))); - recipeFrenchFries = Util.GetRecipes.lastIRecipe(); + recipeFrenchFries = RecipeUtil.lastIRecipe(); } //Fish N Chips if(ConfigCrafting.FISH_N_CHIPS.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FISH_N_CHIPS.ordinal()), "FIF", " P ", - 'I', new ItemStack(Items.cooked_fish, 1, Util.WILDCARD), + 'I', new ItemStack(Items.COOKED_FISH, 1, Util.WILDCARD), 'P', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), 'F', new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal()))); - recipeFishNChips = Util.GetRecipes.lastIRecipe(); + recipeFishNChips = RecipeUtil.lastIRecipe(); } //Cheese if(ConfigCrafting.CHEESE.isEnabled()){ GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), - new ItemStack(Items.milk_bucket)); - recipeCheese = Util.GetRecipes.lastIRecipe(); + new ItemStack(Items.MILK_BUCKET)); + recipeCheese = RecipeUtil.lastIRecipe(); } //Pumpkin Stew if(ConfigCrafting.PUMPKIN_STEW.isEnabled()){ GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.PUMPKIN_STEW.ordinal()), "P", "B", - 'P', new ItemStack(Blocks.pumpkin), - 'B', new ItemStack(Items.bowl)); - recipePumpkinStew = Util.GetRecipes.lastIRecipe(); + 'P', new ItemStack(Blocks.PUMPKIN), + 'B', new ItemStack(Items.BOWL)); + recipePumpkinStew = RecipeUtil.lastIRecipe(); } //Carrot Juice if(ConfigCrafting.CARROT_JUICE.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()), - new ItemStack(Items.glass_bottle), "cropCarrot", knifeStack.copy())); - recipeCarrotJuice = Util.GetRecipes.lastIRecipe(); + new ItemStack(Items.GLASS_BOTTLE), "cropCarrot", knifeStack.copy())); + recipeCarrotJuice = RecipeUtil.lastIRecipe(); } //Spaghetti @@ -166,49 +167,49 @@ public class FoodCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SPAGHETTI.ordinal()), "NNN", " B ", 'N', new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), - 'B', new ItemStack(Items.bowl))); - recipeSpaghetti = Util.GetRecipes.lastIRecipe(); + 'B', new ItemStack(Items.BOWL))); + recipeSpaghetti = RecipeUtil.lastIRecipe(); } //Noodle if(ConfigCrafting.NOODLE.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), "cropWheat", knifeStack.copy())); - recipeNoodle = Util.GetRecipes.lastIRecipe(); + recipeNoodle = RecipeUtil.lastIRecipe(); } //Chocolate if(ConfigCrafting.CHOCOLATE.isEnabled()){ GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 3, TheFoods.CHOCOLATE.ordinal()), "C C", "CMC", "C C", - 'C', new ItemStack(Items.dye, 1, 3), - 'M', new ItemStack(Items.milk_bucket)); - recipeChocolate = Util.GetRecipes.lastIRecipe(); + 'C', new ItemStack(Items.DYE, 1, 3), + 'M', new ItemStack(Items.MILK_BUCKET)); + recipeChocolate = RecipeUtil.lastIRecipe(); } //Chocolate Cake if(ConfigCrafting.CHOCOLATE_CAKE.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE_CAKE.ordinal()), "MMM", "CCC", "EDS", - 'M', new ItemStack(Items.milk_bucket), - 'E', new ItemStack(Items.egg), + 'M', new ItemStack(Items.MILK_BUCKET), + 'E', new ItemStack(Items.EGG), 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), - 'S', new ItemStack(Items.sugar), - 'C', new ItemStack(Items.dye, 1, 3))); - recipeChocolateCake = Util.GetRecipes.lastIRecipe(); + 'S', new ItemStack(Items.SUGAR), + 'C', new ItemStack(Items.DYE, 1, 3))); + recipeChocolateCake = RecipeUtil.lastIRecipe(); } //Toast if(ConfigCrafting.TOAST.isEnabled()){ GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.TOAST.ordinal()), - new ItemStack(Items.bread)); - recipeToast = Util.GetRecipes.lastIRecipe(); + new ItemStack(Items.BREAD)); + recipeToast = RecipeUtil.lastIRecipe(); } //Chocolate Toast if(ConfigCrafting.CHOCOLATE_TOAST.isEnabled()){ GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE_TOAST.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE.ordinal())); - recipeChocolateToast = Util.GetRecipes.lastIRecipe(); + recipeChocolateToast = RecipeUtil.lastIRecipe(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java index 3a7c57cf9..557820a78 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java @@ -1,18 +1,23 @@ /* - * This file ("InitCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.crafting; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.mod.items.InitItems; +import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; -public class InitCrafting{ +public final class InitCrafting{ public static void init(){ ModUtil.LOGGER.info("Initializing Crafting Recipes..."); @@ -22,6 +27,9 @@ public class InitCrafting{ MiscCrafting.init(); FoodCrafting.init(); ToolCrafting.init(); + + ActuallyAdditionsAPI.addCompostRecipe(new ItemStack(InitItems.itemMisc, 10, TheMiscItems.MASHED_FOOD.ordinal()), Blocks.LEAVES, new ItemStack(InitItems.itemFertilizer, 10), Blocks.DIRT); + ActuallyAdditionsAPI.addCompostRecipe(new ItemStack(InitItems.itemCanolaSeed, 20), Blocks.DIRT, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOMASS.ordinal()), Blocks.SOUL_SAND); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java index 29b70ebd4..2ad63e56a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java @@ -1,11 +1,11 @@ /* - * This file ("ItemCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.crafting; @@ -13,10 +13,11 @@ package de.ellpeck.actuallyadditions.mod.crafting; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.*; +import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.IGrowable; import net.minecraft.init.Blocks; @@ -33,17 +34,18 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; import java.util.ArrayList; -public class ItemCrafting{ +public final class ItemCrafting{ + public static final ArrayList RECIPES_MASHED_FOOD = new ArrayList(); + public static final ArrayList RECIPES_DRILL_COLORING = new ArrayList(); + public static final ArrayList RECIPES_POTION_RINGS = new ArrayList(); public static IRecipe recipePhantomConnector; public static IRecipe recipeCoil; public static IRecipe recipeCoilAdvanced; public static IRecipe recipeBook; public static IRecipe recipeTinyCoal; public static IRecipe recipeTinyChar; - public static ArrayList recipesMashedFood = new ArrayList(); public static IRecipe recipeDrill; - public static ArrayList recipesDrillColoring = new ArrayList(); public static IRecipe recipeDrillSpeedI; public static IRecipe recipeDrillSpeedII; public static IRecipe recipeDrillSpeedIII; @@ -72,13 +74,15 @@ public class ItemCrafting{ public static IRecipe recipeRiceDough; public static IRecipe recipeLeafBlower; public static IRecipe recipeLeafBlowerAdvanced; - public static ArrayList recipesPotionRings = new ArrayList(); public static IRecipe recipeChestToCrateUpgrade; public static IRecipe recipeLaserWrench; public static IRecipe recipeDrillCore; public static IRecipe recipeBlackDye; public static IRecipe recipeLens; public static IRecipe recipeCrateKeeper; + public static IRecipe recipeEnderStar; + public static IRecipe recipeSpawnerChanger; + public static IRecipe recipeFilter; public static void init(){ @@ -87,27 +91,37 @@ public class ItemCrafting{ "GGG", "GBG", "GGG", 'G', "blockGlass", 'B', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()))); - recipeLens = Util.GetRecipes.lastIRecipe(); + recipeLens = RecipeUtil.lastIRecipe(); //Black Dye GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.BLACK_DYE.ordinal()), new ItemStack(InitBlocks.blockBlackLotus))); - recipeBlackDye = Util.GetRecipes.lastIRecipe(); + recipeBlackDye = RecipeUtil.lastIRecipe(); //Booklet - GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemBooklet), new ItemStack(InitItems.itemCanolaSeed), new ItemStack(Items.paper))); - recipeBook = Util.GetRecipes.lastIRecipe(); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemBooklet), new ItemStack(InitItems.itemCanolaSeed), new ItemStack(Items.PAPER))); + recipeBook = RecipeUtil.lastIRecipe(); //Clearing NBT Storage GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemLaserWrench), new ItemStack(InitItems.itemLaserWrench)); GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPhantomConnector), new ItemStack(InitItems.itemPhantomConnector)); + GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemSpawnerChanger), new ItemStack(InitItems.itemSpawnerChanger)); //Chest To Crate Upgrade if(ConfigCrafting.CHEST_TO_CRATE_UPGRADE.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemChestToCrateUpgrade), - "CWC", "WWW", "CWC", - 'C', new ItemStack(Blocks.chest), + " W ", "WCW", " W ", + 'C', new ItemStack(InitBlocks.blockGiantChest), 'W', "plankWood")); - recipeChestToCrateUpgrade = Util.GetRecipes.lastIRecipe(); + recipeChestToCrateUpgrade = RecipeUtil.lastIRecipe(); + } + + //Filter + if(ConfigCrafting.FILTER.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFilter), + "III", "IQI", "III", + 'I', new ItemStack(Blocks.IRON_BARS), + 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()))); + recipeFilter = RecipeUtil.lastIRecipe(); } //Crate Keeper @@ -117,7 +131,17 @@ public class ItemCrafting{ 'I', "ingotIron", 'W', "plankWood", 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()))); - recipeCrateKeeper = Util.GetRecipes.lastIRecipe(); + recipeCrateKeeper = RecipeUtil.lastIRecipe(); + } + + //Spawner Changer + if(ConfigCrafting.SPAWNER_CHANGER.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemSpawnerChanger), + "MSM", "SDS", "MSM", + 'M', new ItemStack(Items.MAGMA_CREAM), + 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), + 'D', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()))); + recipeSpawnerChanger = RecipeUtil.lastIRecipe(); } //Laser Wrench @@ -126,33 +150,33 @@ public class ItemCrafting{ "C ", " S ", " S", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()))); - recipeLaserWrench = Util.GetRecipes.lastIRecipe(); + recipeLaserWrench = RecipeUtil.lastIRecipe(); } //Rice Stuff if(ConfigCrafting.RICE_GADGETS.isEnabled()){ - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.paper, 3), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.PAPER, 3), "R ", " R ", " R", 'R', new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()))); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()), " R ", "RBR", " R ", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()), - 'B', Items.water_bucket)); + 'B', Items.WATER_BUCKET)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 4, TheMiscItems.RICE_SLIME.ordinal()), " R ", "RBR", " R ", 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RICE_DOUGH.ordinal()), - 'B', new ItemStack(Items.potionitem))); + 'B', new ItemStack(Items.POTIONITEM))); } //Leaf Blower if(ConfigCrafting.LEAF_BLOWER.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlower), " F", "IP", "IC", - 'F', new ItemStack(Items.flint), + 'F', new ItemStack(Items.FLINT), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), - 'P', new ItemStack(Blocks.piston), + 'P', new ItemStack(Blocks.PISTON), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeLeafBlower = Util.GetRecipes.lastIRecipe(); + recipeLeafBlower = RecipeUtil.lastIRecipe(); } //Drill @@ -164,12 +188,12 @@ public class ItemCrafting{ 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()))); - recipeDrill = Util.GetRecipes.lastIRecipe(); + recipeDrill = RecipeUtil.lastIRecipe(); for(int i = 0; i < 16; i++){ if(i != TheColoredLampColors.LIGHT_BLUE.ordinal()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemDrill, 1, i), lightBlueDrill.copy(), "dye"+TheColoredLampColors.values()[i].name)); - recipesDrillColoring.add(Util.GetRecipes.lastIRecipe()); + RECIPES_DRILL_COLORING.add(RecipeUtil.lastIRecipe()); } } } @@ -181,7 +205,7 @@ public class ItemCrafting{ 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()))); - recipeDrillCore = Util.GetRecipes.lastIRecipe(); + recipeDrillCore = RecipeUtil.lastIRecipe(); } //Tele Staff @@ -192,7 +216,7 @@ public class ItemCrafting{ 'E', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()), 'S', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()), 'B', new ItemStack(InitItems.itemBattery, 1, Util.WILDCARD))); - recipeStaff = Util.GetRecipes.lastIRecipe(); + recipeStaff = RecipeUtil.lastIRecipe(); } //Drill Speed @@ -200,40 +224,40 @@ public class ItemCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeed), "ISI", "SRS", "ISI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), - 'S', Items.sugar, + 'S', Items.SUGAR, 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()))); - recipeDrillSpeedI = Util.GetRecipes.lastIRecipe(); + recipeDrillSpeedI = RecipeUtil.lastIRecipe(); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeedII), "ISI", "SCS", "ISI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), - 'S', Items.sugar, - 'C', Items.cake)); - recipeDrillSpeedII = Util.GetRecipes.lastIRecipe(); + 'S', Items.SUGAR, + 'C', Items.CAKE)); + recipeDrillSpeedII = RecipeUtil.lastIRecipe(); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeSpeedIII), "ISI", "SFS", "ISI", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), - 'S', Items.sugar, + 'S', Items.SUGAR, 'F', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()))); - recipeDrillSpeedIII = Util.GetRecipes.lastIRecipe(); + recipeDrillSpeedIII = RecipeUtil.lastIRecipe(); } //Drill Fortune if(ConfigCrafting.DRILL_FORTUNE.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeFortune), "ISI", "SRS", "ISI", - 'I', Blocks.glowstone, - 'S', Items.redstone, + 'I', Blocks.GLOWSTONE, + 'S', Items.REDSTONE, 'R', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()))); - recipeDrillFortuneI = Util.GetRecipes.lastIRecipe(); + recipeDrillFortuneI = RecipeUtil.lastIRecipe(); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeFortuneII), "ISI", "SRS", "ISI", - 'I', Blocks.glowstone, + 'I', Blocks.GLOWSTONE, 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()))); - recipeDrillFortuneII = Util.GetRecipes.lastIRecipe(); + recipeDrillFortuneII = RecipeUtil.lastIRecipe(); } //Drill Size @@ -243,14 +267,14 @@ public class ItemCrafting{ 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()))); - recipeDrillThree = Util.GetRecipes.lastIRecipe(); + recipeDrillThree = RecipeUtil.lastIRecipe(); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeFiveByFive), "DID", "ICI", "DID", 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeDrillFive = Util.GetRecipes.lastIRecipe(); + recipeDrillFive = RecipeUtil.lastIRecipe(); } //Drill Silk Touch @@ -260,7 +284,7 @@ public class ItemCrafting{ 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), 'S', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeDrillSilk = Util.GetRecipes.lastIRecipe(); + recipeDrillSilk = RecipeUtil.lastIRecipe(); } //Drill Placing @@ -268,10 +292,10 @@ public class ItemCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrillUpgradeBlockPlacing), "CEC", "RAR", "CEC", 'C', "cobblestone", - 'E', Items.paper, + 'E', Items.PAPER, 'A', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()))); - recipeDrillPlacing = Util.GetRecipes.lastIRecipe(); + recipeDrillPlacing = RecipeUtil.lastIRecipe(); } //Battery @@ -281,7 +305,7 @@ public class ItemCrafting{ 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeBattery = Util.GetRecipes.lastIRecipe(); + recipeBattery = RecipeUtil.lastIRecipe(); } //Double Battery @@ -291,7 +315,7 @@ public class ItemCrafting{ 'R', new ItemStack(InitItems.itemBattery), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeBatteryDouble = Util.GetRecipes.lastIRecipe(); + recipeBatteryDouble = RecipeUtil.lastIRecipe(); } //Magnet Ring @@ -300,29 +324,29 @@ public class ItemCrafting{ "RIB", "IOI", "BIR", 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), - 'B', new ItemStack(Items.dye, 1, 4), + 'B', new ItemStack(Items.DYE, 1, 4), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()))); - recipeMagnetRing = Util.GetRecipes.lastIRecipe(); + recipeMagnetRing = RecipeUtil.lastIRecipe(); } //Growth Ring if(ConfigCrafting.GROWTH_RING.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemGrowthRing), "SIS", "IOI", "SIS", - 'S', new ItemStack(Items.wheat_seeds), + 'S', new ItemStack(Items.WHEAT_SEEDS), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()))); - recipeGrowthRing = Util.GetRecipes.lastIRecipe(); + recipeGrowthRing = RecipeUtil.lastIRecipe(); } //Water Ring if(ConfigCrafting.WATER_RING.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemWaterRemovalRing), "BIB", "IOI", "BIB", - 'B', new ItemStack(Items.water_bucket), + 'B', new ItemStack(Items.WATER_BUCKET), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 'O', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()))); - recipeWaterRing = Util.GetRecipes.lastIRecipe(); + recipeWaterRing = RecipeUtil.lastIRecipe(); } //Triple Battery @@ -332,7 +356,7 @@ public class ItemCrafting{ 'R', new ItemStack(InitItems.itemBatteryDouble), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeBatteryTriple = Util.GetRecipes.lastIRecipe(); + recipeBatteryTriple = RecipeUtil.lastIRecipe(); } //Quadruple Battery @@ -342,7 +366,7 @@ public class ItemCrafting{ 'R', new ItemStack(InitItems.itemBatteryTriple), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeBatteryQuadruple = Util.GetRecipes.lastIRecipe(); + recipeBatteryQuadruple = RecipeUtil.lastIRecipe(); } //Quintuple Battery @@ -352,7 +376,7 @@ public class ItemCrafting{ 'R', new ItemStack(InitItems.itemBatteryQuadruple), 'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeBatteryQuintuple = Util.GetRecipes.lastIRecipe(); + recipeBatteryQuintuple = RecipeUtil.lastIRecipe(); } //Bat Wings @@ -361,15 +385,15 @@ public class ItemCrafting{ "WNW", "WDW", "WNW", 'W', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BAT_WING.ordinal()), 'N', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), - 'D', new ItemStack(Items.nether_star))); - recipeWings = Util.GetRecipes.lastIRecipe(); + 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()))); + recipeWings = RecipeUtil.lastIRecipe(); } //Quartz if(ConfigCrafting.QUARTZ.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), - new ItemStack(Items.coal), - new ItemStack(Items.quartz))); + new ItemStack(Items.COAL), + new ItemStack(Items.QUARTZ))); } //Coil @@ -378,7 +402,7 @@ public class ItemCrafting{ " R ", "RIR", " R ", 'I', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()))); - recipeCoil = Util.GetRecipes.lastIRecipe(); + recipeCoil = RecipeUtil.lastIRecipe(); } //Cup @@ -387,13 +411,13 @@ public class ItemCrafting{ "S S", "SCS", "SSS", 'S', "stone", 'C', InitItems.itemCoffeeBean)); - recipeCup = Util.GetRecipes.lastIRecipe(); + recipeCup = RecipeUtil.lastIRecipe(); } //Resonant Rice - if(ConfigCrafting.RESONANT_RICE.isEnabled() && !OreDictionary.getOres("nuggetEnderium").isEmpty()){ + if(ConfigCrafting.RESONANT_RICE.isEnabled() && !OreDictionary.getOres("nuggetEnderium", false).isEmpty()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemResonantRice), - new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.gunpowder)); + new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), "nuggetEnderium", Items.GUNPOWDER)); } //Advanced Coil @@ -402,28 +426,28 @@ public class ItemCrafting{ " G ", "GCG", " G ", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), 'G', "ingotGold")); - recipeCoilAdvanced = Util.GetRecipes.lastIRecipe(); + recipeCoilAdvanced = RecipeUtil.lastIRecipe(); } //Advanced Leaf Blower if(ConfigCrafting.LEAF_BLOWER_ADVANCED.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced), " F", "DP", "DC", - 'F', new ItemStack(Items.flint), + 'F', new ItemStack(Items.FLINT), 'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), - 'P', new ItemStack(Blocks.piston), + 'P', new ItemStack(Blocks.PISTON), 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); - recipeLeafBlowerAdvanced = Util.GetRecipes.lastIRecipe(); + recipeLeafBlowerAdvanced = RecipeUtil.lastIRecipe(); } //Phantom Connector if(ConfigCrafting.PHANTOM_CONNECTOR.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemPhantomConnector), "YE", "EY", "S ", - 'Y', Items.ender_eye, - 'E', Items.ender_pearl, + 'Y', Items.ENDER_EYE, + 'E', Items.ENDER_PEARL, 'S', "stickWood")); - recipePhantomConnector = Util.GetRecipes.lastIRecipe(); + recipePhantomConnector = RecipeUtil.lastIRecipe(); } //Quartz @@ -435,23 +459,23 @@ public class ItemCrafting{ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemKnife), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal()))); - recipeKnife = Util.GetRecipes.lastIRecipe(); + recipeKnife = RecipeUtil.lastIRecipe(); } //Crafter on a Stick if(ConfigCrafting.STICK_CRAFTER.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemCrafterOnAStick), - new ItemStack(Blocks.crafting_table), - new ItemStack(Items.sign))); + new ItemStack(Blocks.CRAFTING_TABLE), + new ItemStack(Items.SIGN))); } //Tiny Coal GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_COAL.ordinal()), - new ItemStack(Items.coal)); - recipeTinyCoal = Util.GetRecipes.lastIRecipe(); + new ItemStack(Items.COAL)); + recipeTinyCoal = RecipeUtil.lastIRecipe(); GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.TINY_CHAR.ordinal()), - new ItemStack(Items.coal, 1, 1)); - recipeTinyChar = Util.GetRecipes.lastIRecipe(); + new ItemStack(Items.COAL, 1, 1)); + recipeTinyChar = RecipeUtil.lastIRecipe(); //Rice Seeds GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemRiceSeed), @@ -466,21 +490,21 @@ public class ItemCrafting{ //Ingots from Dusts GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal()), - new ItemStack(Items.iron_ingot), 1F); + new ItemStack(Items.IRON_INGOT), 1F); GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.GOLD.ordinal()), - new ItemStack(Items.gold_ingot), 1F); + new ItemStack(Items.GOLD_INGOT), 1F); GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.DIAMOND.ordinal()), - new ItemStack(Items.diamond), 1F); + new ItemStack(Items.DIAMOND), 1F); GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.EMERALD.ordinal()), - new ItemStack(Items.emerald), 1F); + new ItemStack(Items.EMERALD), 1F); GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.LAPIS.ordinal()), - new ItemStack(Items.dye, 1, 4), 1F); + new ItemStack(Items.DYE, 1, 4), 1F); GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ_BLACK.ordinal()), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 1F); GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ.ordinal()), - new ItemStack(Items.quartz), 1F); + new ItemStack(Items.QUARTZ), 1F); GameRegistry.addSmelting(new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()), - new ItemStack(Items.coal), 1F); + new ItemStack(Items.COAL), 1F); } @@ -490,7 +514,7 @@ public class ItemCrafting{ 'G', "ingotGold", 'I', "ingotIron", 'D', "dustGlowstone")); - recipeRing = Util.GetRecipes.lastIRecipe(); + recipeRing = RecipeUtil.lastIRecipe(); if(ConfigCrafting.RING_SPEED.isEnabled()){ addRingRecipeWithStack(ThePotionRings.SPEED.craftingItem, ThePotionRings.SPEED.ordinal()); @@ -525,20 +549,20 @@ public class ItemCrafting{ } public static void addRingRecipeWithStack(ItemStack mainStack, int meta){ - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, meta), mainStack, mainStack, mainStack, mainStack, new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), new ItemStack(Items.nether_wart), new ItemStack(Items.potionitem), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); - recipesPotionRings.add(Util.GetRecipes.lastIRecipe()); - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, meta), new ItemStack(InitItems.itemPotionRing, 1, meta), new ItemStack(Items.nether_star), new ItemStack(Items.nether_star)); - recipesPotionRings.add(Util.GetRecipes.lastIRecipe()); + GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, meta), mainStack, mainStack, mainStack, mainStack, new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), new ItemStack(Items.NETHER_WART), new ItemStack(Items.POTIONITEM), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); + RECIPES_POTION_RINGS.add(RecipeUtil.lastIRecipe()); + GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, meta), new ItemStack(InitItems.itemPotionRing, 1, meta), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal())); + RECIPES_POTION_RINGS.add(RecipeUtil.lastIRecipe()); } public static void initMashedFoodRecipes(){ if(ConfigCrafting.MASHED_FOOD.isEnabled()){ - for(Item item : Item.itemRegistry){ + for(Item item : Item.REGISTRY){ if(item instanceof ItemFood || item instanceof IPlantable || item instanceof IGrowable){ if(!isBlacklisted(item)){ ItemStack ingredient = new ItemStack(item, 1, Util.WILDCARD); GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.MASHED_FOOD.ordinal()), ingredient, ingredient, ingredient, ingredient, new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD)); - recipesMashedFood.add(Util.GetRecipes.lastIRecipe()); + RECIPES_MASHED_FOOD.add(RecipeUtil.lastIRecipe()); } } } @@ -546,8 +570,8 @@ public class ItemCrafting{ } private static boolean isBlacklisted(Item item){ - for(String except : ConfigValues.mashedFoodCraftingExceptions){ - if(item.getRegistryName().equals(except)){ + for(String except : ConfigStringListValues.MASHED_FOOD_CRAFTING_EXCEPTIONS.getValue()){ + if(item.getRegistryName().toString().equals(except)){ return true; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java index 9618d86cd..6e93843d7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java @@ -1,11 +1,11 @@ /* - * This file ("MiscCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("MiscCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.crafting; @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.Util; +import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; @@ -24,50 +24,54 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -public class MiscCrafting{ +public final class MiscCrafting{ - public static IRecipe[] recipesCrystals = new IRecipe[TheCrystals.values().length]; - public static IRecipe[] recipesCrystalBlocks = new IRecipe[TheCrystals.values().length]; + public static final IRecipe[] RECIPES_CRYSTALS = new IRecipe[TheCrystals.values().length]; + public static final IRecipe[] RECIPES_CRYSTAL_BLOCKS = new IRecipe[TheCrystals.values().length]; public static void init(){ + //Bio Coal + GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOMASS.ordinal()), + new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOCOAL.ordinal()), 1.0F); + //Crystals for(int i = 0; i < TheCrystals.values().length; i++){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockCrystal, 1, i), "XXX", "XXX", "XXX", 'X', new ItemStack(InitItems.itemCrystal, 1, i))); - recipesCrystalBlocks[i] = Util.GetRecipes.lastIRecipe(); + RECIPES_CRYSTAL_BLOCKS[i] = RecipeUtil.lastIRecipe(); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemCrystal, 9, i), new ItemStack(InitBlocks.blockCrystal, 1, i))); - recipesCrystals[i] = Util.GetRecipes.lastIRecipe(); + RECIPES_CRYSTALS[i] = RecipeUtil.lastIRecipe(); } //Dough if(ConfigCrafting.DOUGH.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.DOUGH.ordinal()), "cropWheat", "cropWheat")); - ItemCrafting.recipeDough = Util.GetRecipes.lastIRecipe(); + ItemCrafting.recipeDough = RecipeUtil.lastIRecipe(); } //Rice Dough if(ConfigCrafting.RICE_DOUGH.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.RICE_DOUGH.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()))); - ItemCrafting.recipeRiceDough = Util.GetRecipes.lastIRecipe(); + ItemCrafting.recipeRiceDough = RecipeUtil.lastIRecipe(); } //Paper Cone if(ConfigCrafting.PAPER_CONE.isEnabled()){ GameRegistry.addRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), "P P", " P ", - 'P', new ItemStack(Items.paper)); + 'P', new ItemStack(Items.PAPER)); } //Knife Handle if(ConfigCrafting.KNIFE_HANDLE.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal()), "stickWood", - new ItemStack(Items.leather))); - ItemCrafting.recipeKnifeHandle = Util.GetRecipes.lastIRecipe(); + new ItemStack(Items.LEATHER))); + ItemCrafting.recipeKnifeHandle = RecipeUtil.lastIRecipe(); } //Knife Blade @@ -75,8 +79,17 @@ public class MiscCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), "K", "K", "F", 'K', "ingotIron", - 'F', new ItemStack(Items.flint))); - ItemCrafting.recipeKnifeBlade = Util.GetRecipes.lastIRecipe(); + 'F', new ItemStack(Items.FLINT))); + ItemCrafting.recipeKnifeBlade = RecipeUtil.lastIRecipe(); + } + + //Ender Star + if(ConfigCrafting.ENDER_STAR.isEnabled()){ + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()), + new ItemStack(Items.NETHER_STAR), + new ItemStack(Items.DRAGON_BREATH), + new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()))); + ItemCrafting.recipeEnderStar = RecipeUtil.lastIRecipe(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java index 03649ffc4..d0974ae16 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java @@ -1,11 +1,11 @@ /* - * This file ("ToolCrafting.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ToolCrafting.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.crafting; @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.Util; +import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -26,14 +26,14 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; import java.util.ArrayList; -public class ToolCrafting{ +public final class ToolCrafting{ - public static ArrayList recipesPaxels = new ArrayList(); + public static final ArrayList RECIPES_PAXELS = new ArrayList(); public static void init(){ if(ConfigCrafting.TOOL_EMERALD.isEnabled()){ - addToolAndArmorRecipes(new ItemStack(Items.emerald), InitItems.itemPickaxeEmerald, InitItems.itemSwordEmerald, InitItems.itemAxeEmerald, InitItems.itemShovelEmerald, InitItems.itemHoeEmerald, InitItems.itemHelmEmerald, InitItems.itemChestEmerald, InitItems.itemPantsEmerald, InitItems.itemBootsEmerald); + addToolAndArmorRecipes(new ItemStack(Items.EMERALD), InitItems.itemPickaxeEmerald, InitItems.itemSwordEmerald, InitItems.itemAxeEmerald, InitItems.itemShovelEmerald, InitItems.itemHoeEmerald, InitItems.itemHelmEmerald, InitItems.itemChestEmerald, InitItems.itemPantsEmerald, InitItems.itemBootsEmerald); } if(ConfigCrafting.TOOL_QUARTZ.isEnabled()){ @@ -41,7 +41,7 @@ public class ToolCrafting{ } if(ConfigCrafting.TOOL_OBSIDIAN.isEnabled()){ - addToolAndArmorRecipes(new ItemStack(Blocks.obsidian), InitItems.itemPickaxeObsidian, InitItems.itemSwordObsidian, InitItems.itemAxeObsidian, InitItems.itemShovelObsidian, InitItems.itemHoeObsidian, InitItems.itemHelmObsidian, InitItems.itemChestObsidian, InitItems.itemPantsObsidian, InitItems.itemBootsObsidian); + addToolAndArmorRecipes(new ItemStack(Blocks.OBSIDIAN), InitItems.itemPickaxeObsidian, InitItems.itemSwordObsidian, InitItems.itemAxeObsidian, InitItems.itemShovelObsidian, InitItems.itemHoeObsidian, InitItems.itemHelmObsidian, InitItems.itemChestObsidian, InitItems.itemPantsObsidian, InitItems.itemBootsObsidian); } if(ConfigCrafting.TOOL_CRYSTALS.isEnabled()){ @@ -56,61 +56,61 @@ public class ToolCrafting{ //Paxels if(ConfigCrafting.PAXELS.isEnabled()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.woodenPaxel), - new ItemStack(Items.wooden_axe), - new ItemStack(Items.wooden_pickaxe), - new ItemStack(Items.wooden_shovel), - new ItemStack(Items.wooden_sword), - new ItemStack(Items.wooden_hoe))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + new ItemStack(Items.WOODEN_AXE), + new ItemStack(Items.WOODEN_PICKAXE), + new ItemStack(Items.WOODEN_SHOVEL), + new ItemStack(Items.WOODEN_SWORD), + new ItemStack(Items.WOODEN_HOE))); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.stonePaxel), - new ItemStack(Items.stone_axe), - new ItemStack(Items.stone_pickaxe), - new ItemStack(Items.stone_shovel), - new ItemStack(Items.stone_sword), - new ItemStack(Items.stone_hoe))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + new ItemStack(Items.STONE_AXE), + new ItemStack(Items.STONE_PICKAXE), + new ItemStack(Items.STONE_SHOVEL), + new ItemStack(Items.STONE_SWORD), + new ItemStack(Items.STONE_HOE))); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.ironPaxel), - new ItemStack(Items.iron_axe), - new ItemStack(Items.iron_pickaxe), - new ItemStack(Items.iron_shovel), - new ItemStack(Items.iron_sword), - new ItemStack(Items.iron_hoe))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + new ItemStack(Items.IRON_AXE), + new ItemStack(Items.IRON_PICKAXE), + new ItemStack(Items.IRON_SHOVEL), + new ItemStack(Items.IRON_SWORD), + new ItemStack(Items.IRON_HOE))); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.goldPaxel), - new ItemStack(Items.golden_axe), - new ItemStack(Items.golden_pickaxe), - new ItemStack(Items.golden_shovel), - new ItemStack(Items.golden_sword), - new ItemStack(Items.golden_hoe))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + new ItemStack(Items.GOLDEN_AXE), + new ItemStack(Items.GOLDEN_PICKAXE), + new ItemStack(Items.GOLDEN_SHOVEL), + new ItemStack(Items.GOLDEN_SWORD), + new ItemStack(Items.GOLDEN_HOE))); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.diamondPaxel), - new ItemStack(Items.diamond_axe), - new ItemStack(Items.diamond_pickaxe), - new ItemStack(Items.diamond_shovel), - new ItemStack(Items.diamond_sword), - new ItemStack(Items.diamond_hoe))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + new ItemStack(Items.DIAMOND_AXE), + new ItemStack(Items.DIAMOND_PICKAXE), + new ItemStack(Items.DIAMOND_SHOVEL), + new ItemStack(Items.DIAMOND_SWORD), + new ItemStack(Items.DIAMOND_HOE))); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.emeraldPaxel), new ItemStack(InitItems.itemAxeEmerald), new ItemStack(InitItems.itemPickaxeEmerald), new ItemStack(InitItems.itemSwordEmerald), new ItemStack(InitItems.itemShovelEmerald), new ItemStack(InitItems.itemHoeEmerald))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.obsidianPaxel), new ItemStack(InitItems.itemAxeObsidian), new ItemStack(InitItems.itemPickaxeObsidian), new ItemStack(InitItems.itemSwordObsidian), new ItemStack(InitItems.itemShovelObsidian), new ItemStack(InitItems.itemHoeObsidian))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.quartzPaxel), new ItemStack(InitItems.itemAxeQuartz), new ItemStack(InitItems.itemPickaxeQuartz), new ItemStack(InitItems.itemSwordQuartz), new ItemStack(InitItems.itemShovelQuartz), new ItemStack(InitItems.itemHoeQuartz))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalRed), new ItemStack(InitItems.itemAxeCrystalRed), @@ -118,42 +118,42 @@ public class ToolCrafting{ new ItemStack(InitItems.itemSwordCrystalRed), new ItemStack(InitItems.itemShovelCrystalRed), new ItemStack(InitItems.itemHoeCrystalRed))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalGreen), new ItemStack(InitItems.itemAxeCrystalGreen), new ItemStack(InitItems.itemPickaxeCrystalGreen), new ItemStack(InitItems.itemSwordCrystalGreen), new ItemStack(InitItems.itemShovelCrystalGreen), new ItemStack(InitItems.itemHoeCrystalGreen))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalBlue), new ItemStack(InitItems.itemAxeCrystalBlue), new ItemStack(InitItems.itemPickaxeCrystalBlue), new ItemStack(InitItems.itemSwordCrystalBlue), new ItemStack(InitItems.itemShovelCrystalBlue), new ItemStack(InitItems.itemHoeCrystalBlue))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalLightBlue), new ItemStack(InitItems.itemAxeCrystalLightBlue), new ItemStack(InitItems.itemPickaxeCrystalLightBlue), new ItemStack(InitItems.itemSwordCrystalLightBlue), new ItemStack(InitItems.itemShovelCrystalLightBlue), new ItemStack(InitItems.itemHoeCrystalLightBlue))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalBlack), new ItemStack(InitItems.itemAxeCrystalBlack), new ItemStack(InitItems.itemPickaxeCrystalBlack), new ItemStack(InitItems.itemSwordCrystalBlack), new ItemStack(InitItems.itemShovelCrystalBlack), new ItemStack(InitItems.itemHoeCrystalBlack))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalWhite), new ItemStack(InitItems.itemAxeCrystalWhite), new ItemStack(InitItems.itemPickaxeCrystalWhite), new ItemStack(InitItems.itemSwordCrystalWhite), new ItemStack(InitItems.itemShovelCrystalWhite), new ItemStack(InitItems.itemHoeCrystalWhite))); - recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); } } @@ -162,31 +162,31 @@ public class ToolCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(pickaxe), "EEE", " S ", " S ", 'E', base, - 'S', new ItemStack(Items.stick))); + 'S', new ItemStack(Items.STICK))); //Sword GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(sword), "E", "E", "S", 'E', base, - 'S', new ItemStack(Items.stick))); + 'S', new ItemStack(Items.STICK))); //Axe GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(axe), "EE", "ES", " S", 'E', base, - 'S', new ItemStack(Items.stick))); + 'S', new ItemStack(Items.STICK))); //Shovel GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(shovel), "E", "S", "S", 'E', base, - 'S', new ItemStack(Items.stick))); + 'S', new ItemStack(Items.STICK))); //Hoe GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(hoe), "EE", " S", " S", 'E', base, - 'S', new ItemStack(Items.stick))); + 'S', new ItemStack(Items.STICK))); //Helm GameRegistry.addRecipe(new ItemStack(helm), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java index fb9c016fd..accdf5025 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java @@ -1,16 +1,17 @@ /* - * This file ("CreativeTab.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CreativeTab.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.creative; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.InitForeignPaxels; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.util.ModUtil; @@ -18,6 +19,8 @@ import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.ForgeModContainer; +import net.minecraftforge.fluids.UniversalBucket; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -25,11 +28,11 @@ import java.util.List; public class CreativeTab extends CreativeTabs{ - public static CreativeTab instance = new CreativeTab(); - private List list; + public static final CreativeTab INSTANCE = new CreativeTab(); + private List list; public CreativeTab(){ - super(ModUtil.MOD_ID_LOWER); + super(ModUtil.MOD_ID); } @Override @@ -44,261 +47,278 @@ public class CreativeTab extends CreativeTabs{ @Override @SideOnly(Side.CLIENT) - public void displayAllReleventItems(List list){ + public void displayAllRelevantItems(List list){ this.list = list; - add(InitItems.itemBooklet); - add(InitBlocks.blockSmileyCloud); + this.add(InitItems.itemBooklet); + this.add(InitBlocks.blockSmileyCloud); - add(InitBlocks.blockFireworkBox); - add(InitBlocks.blockLaserRelay); - add(InitBlocks.blockAtomicReconstructor); - add(InitBlocks.blockPhantomface); - add(InitBlocks.blockPhantomEnergyface); - add(InitBlocks.blockPhantomLiquiface); - add(InitBlocks.blockPhantomPlacer); - add(InitBlocks.blockPhantomBreaker); - add(InitBlocks.blockInputter); - add(InitBlocks.blockInputterAdvanced); - add(InitBlocks.blockPhantomBooster); - add(InitBlocks.blockCoffeeMachine); - add(InitBlocks.blockXPSolidifier); + this.add(InitBlocks.blockFireworkBox); + this.add(InitBlocks.blockLaserRelay); + this.add(InitBlocks.blockLaserRelayItem); + this.add(InitBlocks.blockLaserRelayItemWhitelist); + this.add(InitBlocks.blockItemViewer); + this.add(InitBlocks.blockAtomicReconstructor); + this.add(InitBlocks.blockPhantomface); + this.add(InitBlocks.blockPhantomEnergyface); + this.add(InitBlocks.blockPhantomLiquiface); + this.add(InitBlocks.blockPhantomRedstoneface); + this.add(InitBlocks.blockPhantomPlacer); + this.add(InitBlocks.blockPhantomBreaker); + this.add(InitBlocks.blockPlayerInterface); + this.add(InitBlocks.blockInputter); + this.add(InitBlocks.blockInputterAdvanced); + this.add(InitBlocks.blockPhantomBooster); + this.add(InitBlocks.blockCoffeeMachine); + this.add(InitBlocks.blockXPSolidifier); + this.add(InitBlocks.blockDisplayStand); - add(InitBlocks.blockMiner); - add(InitBlocks.blockGreenhouseGlass); - add(InitBlocks.blockGrinder); - add(InitBlocks.blockGrinderDouble); - add(InitBlocks.blockFurnaceDouble); - add(InitBlocks.blockLavaFactoryController); + this.add(InitBlocks.blockShockSuppressor); + this.add(InitBlocks.blockMiner); + this.add(InitBlocks.blockGreenhouseGlass); + this.add(InitBlocks.blockGrinder); + this.add(InitBlocks.blockGrinderDouble); + this.add(InitBlocks.blockFurnaceDouble); + this.add(InitBlocks.blockLavaFactoryController); - add(InitBlocks.blockEnergizer); - add(InitBlocks.blockEnervator); + this.add(InitBlocks.blockEnergizer); + this.add(InitBlocks.blockEnervator); - add(InitBlocks.blockFurnaceSolar); - add(InitBlocks.blockHeatCollector); - add(InitBlocks.blockCoalGenerator); - add(InitBlocks.blockOilGenerator); - add(InitBlocks.blockLeafGenerator); + this.add(InitBlocks.blockFurnaceSolar); + this.add(InitBlocks.blockHeatCollector); + this.add(InitBlocks.blockCoalGenerator); + this.add(InitBlocks.blockOilGenerator); + this.add(InitBlocks.blockLeafGenerator); - add(InitBlocks.blockItemRepairer); - add(InitBlocks.blockFishingNet); - add(InitBlocks.blockBreaker); - add(InitBlocks.blockDirectionalBreaker); - add(InitBlocks.blockRangedCollector); - add(InitBlocks.blockPlacer); - add(InitBlocks.blockDropper); - add(InitBlocks.blockFluidPlacer); - add(InitBlocks.blockFluidCollector); + this.add(InitBlocks.blockItemRepairer); + this.add(InitBlocks.blockFishingNet); + this.add(InitBlocks.blockBreaker); + this.add(InitBlocks.blockDirectionalBreaker); + this.add(InitBlocks.blockRangedCollector); + this.add(InitBlocks.blockPlacer); + this.add(InitBlocks.blockDropper); + this.add(InitBlocks.blockFluidPlacer); + this.add(InitBlocks.blockFluidCollector); - add(InitBlocks.blockMisc); - add(InitBlocks.blockFeeder); - add(InitBlocks.blockCompost); - add(InitBlocks.blockGiantChest); - add(InitBlocks.blockCanolaPress); - add(InitBlocks.blockFermentingBarrel); + this.add(InitBlocks.blockMisc); + this.add(InitBlocks.blockFeeder); + this.add(InitBlocks.blockCompost); + this.add(InitBlocks.blockGiantChest); + this.add(InitBlocks.blockGiantChestMedium); + this.add(InitBlocks.blockGiantChestLarge); + this.add(InitBlocks.blockCanolaPress); + this.add(InitBlocks.blockFermentingBarrel); - add(InitBlocks.blockTestifiBucksGreenWall); - add(InitBlocks.blockTestifiBucksWhiteWall); - add(InitBlocks.blockTestifiBucksGreenStairs); - add(InitBlocks.blockTestifiBucksWhiteStairs); - add(InitBlocks.blockTestifiBucksGreenSlab); - add(InitBlocks.blockTestifiBucksWhiteSlab); - add(InitBlocks.blockTestifiBucksGreenFence); - add(InitBlocks.blockTestifiBucksWhiteFence); + this.add(InitBlocks.blockTestifiBucksGreenWall); + this.add(InitBlocks.blockTestifiBucksWhiteWall); + this.add(InitBlocks.blockTestifiBucksGreenStairs); + this.add(InitBlocks.blockTestifiBucksWhiteStairs); + this.add(InitBlocks.blockTestifiBucksGreenSlab); + this.add(InitBlocks.blockTestifiBucksWhiteSlab); + this.add(InitBlocks.blockTestifiBucksGreenFence); + this.add(InitBlocks.blockTestifiBucksWhiteFence); - add(InitBlocks.blockQuartzWall); - add(InitBlocks.blockQuartzStair); - add(InitBlocks.blockQuartzSlab); - add(InitBlocks.blockChiseledQuartzWall); - add(InitBlocks.blockChiseledQuartzStair); - add(InitBlocks.blockChiseledQuartzSlab); - add(InitBlocks.blockPillarQuartzWall); - add(InitBlocks.blockPillarQuartzStair); - add(InitBlocks.blockPillarQuartzSlab); + this.add(InitBlocks.blockQuartzWall); + this.add(InitBlocks.blockQuartzStair); + this.add(InitBlocks.blockQuartzSlab); + this.add(InitBlocks.blockChiseledQuartzWall); + this.add(InitBlocks.blockChiseledQuartzStair); + this.add(InitBlocks.blockChiseledQuartzSlab); + this.add(InitBlocks.blockPillarQuartzWall); + this.add(InitBlocks.blockPillarQuartzStair); + this.add(InitBlocks.blockPillarQuartzSlab); - add(InitBlocks.blockColoredLamp); - add(InitBlocks.blockColoredLampOn); - add(InitBlocks.blockLampPowerer); - add(InitBlocks.blockTreasureChest); + this.add(InitBlocks.blockColoredLamp); + this.add(InitBlocks.blockColoredLampOn); + this.add(InitBlocks.blockLampPowerer); + this.add(InitBlocks.blockTreasureChest); - add(InitBlocks.blockBlackLotus); + this.add(InitBlocks.blockBlackLotus); + this.add(InitBlocks.blockBookletStand); - add(InitItems.itemColorLens); - add(InitItems.itemExplosionLens); - add(InitItems.itemDamageLens); - add(InitItems.itemLaserWrench); - add(InitItems.itemCrateKeeper); - add(InitItems.itemChestToCrateUpgrade); + this.add(InitItems.itemColorLens); + this.add(InitItems.itemExplosionLens); + this.add(InitItems.itemDamageLens); + this.add(InitItems.itemLaserWrench); + this.add(InitItems.itemCrateKeeper); + this.add(InitItems.itemChestToCrateUpgrade); + this.add(InitItems.itemSpawnerChanger); + this.add(InitItems.itemWaterBowl); - add(InitItems.itemDrill); - add(InitItems.itemDrillUpgradeSpeed); - add(InitItems.itemDrillUpgradeSpeedII); - add(InitItems.itemDrillUpgradeSpeedIII); - add(InitItems.itemDrillUpgradeSilkTouch); - add(InitItems.itemDrillUpgradeFortune); - add(InitItems.itemDrillUpgradeFortuneII); - add(InitItems.itemDrillUpgradeThreeByThree); - add(InitItems.itemDrillUpgradeFiveByFive); - add(InitItems.itemDrillUpgradeBlockPlacing); - add(InitItems.itemBattery); - add(InitItems.itemBatteryDouble); - add(InitItems.itemBatteryTriple); - add(InitItems.itemBatteryQuadruple); - add(InitItems.itemBatteryQuintuple); - add(InitItems.itemTeleStaff); + this.add(InitItems.itemDrill); + this.add(InitItems.itemDrillUpgradeSpeed); + this.add(InitItems.itemDrillUpgradeSpeedII); + this.add(InitItems.itemDrillUpgradeSpeedIII); + this.add(InitItems.itemDrillUpgradeSilkTouch); + this.add(InitItems.itemDrillUpgradeFortune); + this.add(InitItems.itemDrillUpgradeFortuneII); + this.add(InitItems.itemDrillUpgradeThreeByThree); + this.add(InitItems.itemDrillUpgradeFiveByFive); + this.add(InitItems.itemDrillUpgradeBlockPlacing); + this.add(InitItems.itemBattery); + this.add(InitItems.itemBatteryDouble); + this.add(InitItems.itemBatteryTriple); + this.add(InitItems.itemBatteryQuadruple); + this.add(InitItems.itemBatteryQuintuple); + this.add(InitItems.itemTeleStaff); - add(InitItems.itemGrowthRing); - add(InitItems.itemMagnetRing); - add(InitItems.itemWaterRemovalRing); + this.add(InitItems.itemGrowthRing); + this.add(InitItems.itemMagnetRing); + this.add(InitItems.itemWaterRemovalRing); - add(InitItems.itemPhantomConnector); - add(InitItems.itemBucketCanolaOil); - add(InitItems.itemBucketOil); + this.list.add(UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, InitFluids.fluidCanolaOil)); + this.list.add(UniversalBucket.getFilledBucket(ForgeModContainer.getInstance().universalBucket, InitFluids.fluidOil)); - add(InitItems.itemWingsOfTheBats); + this.add(InitItems.itemPhantomConnector); + this.add(InitItems.itemFilter); + this.add(InitItems.itemWingsOfTheBats); - add(InitItems.itemCoffeeSeed); - add(InitItems.itemCoffeeBean); - add(InitItems.itemRiceSeed); - add(InitItems.itemCanolaSeed); - add(InitItems.itemFlaxSeed); - add(InitItems.itemHairyBall); - add(InitItems.itemMisc); - add(InitItems.itemResonantRice); - add(InitItems.itemFertilizer); + this.add(InitItems.itemCoffeeSeed); + this.add(InitItems.itemCoffeeBean); + this.add(InitItems.itemRiceSeed); + this.add(InitItems.itemCanolaSeed); + this.add(InitItems.itemFlaxSeed); + this.add(InitItems.itemHairyBall); + this.add(InitItems.itemMisc); + this.add(InitItems.itemResonantRice); + this.add(InitItems.itemFertilizer); - add(InitItems.itemCoffee); - add(InitItems.itemFoods); - add(InitItems.itemKnife); - add(InitItems.itemCrafterOnAStick); - add(InitItems.itemDust); - add(InitItems.itemSolidifiedExperience); - add(InitItems.itemLeafBlower); - add(InitItems.itemLeafBlowerAdvanced); + this.add(InitItems.itemCoffee); + this.add(InitItems.itemFoods); + this.add(InitItems.itemKnife); + this.add(InitItems.itemCrafterOnAStick); + this.add(InitItems.itemDust); + this.add(InitItems.itemSolidifiedExperience); + this.add(InitItems.itemLeafBlower); + this.add(InitItems.itemLeafBlowerAdvanced); - add(InitItems.woodenPaxel); - add(InitItems.stonePaxel); - add(InitItems.ironPaxel); - add(InitItems.goldPaxel); - add(InitItems.diamondPaxel); - add(InitItems.emeraldPaxel); - add(InitItems.obsidianPaxel); - add(InitItems.quartzPaxel); - add(InitItems.itemPaxelCrystalRed); - add(InitItems.itemPaxelCrystalBlue); - add(InitItems.itemPaxelCrystalLightBlue); - add(InitItems.itemPaxelCrystalBlack); - add(InitItems.itemPaxelCrystalGreen); - add(InitItems.itemPaxelCrystalWhite); + this.add(InitItems.woodenPaxel); + this.add(InitItems.stonePaxel); + this.add(InitItems.ironPaxel); + this.add(InitItems.goldPaxel); + this.add(InitItems.diamondPaxel); + this.add(InitItems.emeraldPaxel); + this.add(InitItems.obsidianPaxel); + this.add(InitItems.quartzPaxel); + this.add(InitItems.itemPaxelCrystalRed); + this.add(InitItems.itemPaxelCrystalBlue); + this.add(InitItems.itemPaxelCrystalLightBlue); + this.add(InitItems.itemPaxelCrystalBlack); + this.add(InitItems.itemPaxelCrystalGreen); + this.add(InitItems.itemPaxelCrystalWhite); InitForeignPaxels.addToCreativeTab(); - add(InitBlocks.blockCrystal); - add(InitItems.itemCrystal); + this.add(InitBlocks.blockCrystal); + this.add(InitItems.itemCrystal); - add(InitItems.itemJams); + this.add(InitItems.itemJams); - add(InitItems.itemPotionRing); - add(InitItems.itemPotionRingAdvanced); + this.add(InitItems.itemPotionRing); + this.add(InitItems.itemPotionRingAdvanced); - add(InitItems.itemPickaxeQuartz); - add(InitItems.itemSwordQuartz); - add(InitItems.itemAxeQuartz); - add(InitItems.itemShovelQuartz); - add(InitItems.itemHoeQuartz); + this.add(InitItems.itemPickaxeQuartz); + this.add(InitItems.itemSwordQuartz); + this.add(InitItems.itemAxeQuartz); + this.add(InitItems.itemShovelQuartz); + this.add(InitItems.itemHoeQuartz); - add(InitItems.itemHelmQuartz); - add(InitItems.itemChestQuartz); - add(InitItems.itemPantsQuartz); - add(InitItems.itemBootsQuartz); + this.add(InitItems.itemHelmQuartz); + this.add(InitItems.itemChestQuartz); + this.add(InitItems.itemPantsQuartz); + this.add(InitItems.itemBootsQuartz); - add(InitItems.itemPickaxeEmerald); - add(InitItems.itemSwordEmerald); - add(InitItems.itemAxeEmerald); - add(InitItems.itemShovelEmerald); - add(InitItems.itemHoeEmerald); + this.add(InitItems.itemPickaxeEmerald); + this.add(InitItems.itemSwordEmerald); + this.add(InitItems.itemAxeEmerald); + this.add(InitItems.itemShovelEmerald); + this.add(InitItems.itemHoeEmerald); - add(InitItems.itemHelmEmerald); - add(InitItems.itemChestEmerald); - add(InitItems.itemPantsEmerald); - add(InitItems.itemBootsEmerald); + this.add(InitItems.itemHelmEmerald); + this.add(InitItems.itemChestEmerald); + this.add(InitItems.itemPantsEmerald); + this.add(InitItems.itemBootsEmerald); - add(InitItems.itemPickaxeObsidian); - add(InitItems.itemSwordObsidian); - add(InitItems.itemAxeObsidian); - add(InitItems.itemShovelObsidian); - add(InitItems.itemHoeObsidian); + this.add(InitItems.itemPickaxeObsidian); + this.add(InitItems.itemSwordObsidian); + this.add(InitItems.itemAxeObsidian); + this.add(InitItems.itemShovelObsidian); + this.add(InitItems.itemHoeObsidian); - add(InitItems.itemHelmObsidian); - add(InitItems.itemChestObsidian); - add(InitItems.itemPantsObsidian); - add(InitItems.itemBootsObsidian); + this.add(InitItems.itemHelmObsidian); + this.add(InitItems.itemChestObsidian); + this.add(InitItems.itemPantsObsidian); + this.add(InitItems.itemBootsObsidian); - add(InitItems.itemPickaxeCrystalRed); - add(InitItems.itemAxeCrystalRed); - add(InitItems.itemShovelCrystalRed); - add(InitItems.itemSwordCrystalRed); - add(InitItems.itemHoeCrystalRed); - add(InitItems.itemHelmCrystalRed); - add(InitItems.itemChestCrystalRed); - add(InitItems.itemPantsCrystalRed); - add(InitItems.itemBootsCrystalRed); + this.add(InitItems.itemPickaxeCrystalRed); + this.add(InitItems.itemAxeCrystalRed); + this.add(InitItems.itemShovelCrystalRed); + this.add(InitItems.itemSwordCrystalRed); + this.add(InitItems.itemHoeCrystalRed); + this.add(InitItems.itemHelmCrystalRed); + this.add(InitItems.itemChestCrystalRed); + this.add(InitItems.itemPantsCrystalRed); + this.add(InitItems.itemBootsCrystalRed); - add(InitItems.itemPickaxeCrystalBlue); - add(InitItems.itemAxeCrystalBlue); - add(InitItems.itemShovelCrystalBlue); - add(InitItems.itemSwordCrystalBlue); - add(InitItems.itemHoeCrystalBlue); - add(InitItems.itemHelmCrystalBlue); - add(InitItems.itemChestCrystalBlue); - add(InitItems.itemPantsCrystalBlue); - add(InitItems.itemBootsCrystalBlue); + this.add(InitItems.itemPickaxeCrystalBlue); + this.add(InitItems.itemAxeCrystalBlue); + this.add(InitItems.itemShovelCrystalBlue); + this.add(InitItems.itemSwordCrystalBlue); + this.add(InitItems.itemHoeCrystalBlue); + this.add(InitItems.itemHelmCrystalBlue); + this.add(InitItems.itemChestCrystalBlue); + this.add(InitItems.itemPantsCrystalBlue); + this.add(InitItems.itemBootsCrystalBlue); - add(InitItems.itemPickaxeCrystalLightBlue); - add(InitItems.itemAxeCrystalLightBlue); - add(InitItems.itemShovelCrystalLightBlue); - add(InitItems.itemSwordCrystalLightBlue); - add(InitItems.itemHoeCrystalLightBlue); - add(InitItems.itemHelmCrystalLightBlue); - add(InitItems.itemChestCrystalLightBlue); - add(InitItems.itemPantsCrystalLightBlue); - add(InitItems.itemBootsCrystalLightBlue); + this.add(InitItems.itemPickaxeCrystalLightBlue); + this.add(InitItems.itemAxeCrystalLightBlue); + this.add(InitItems.itemShovelCrystalLightBlue); + this.add(InitItems.itemSwordCrystalLightBlue); + this.add(InitItems.itemHoeCrystalLightBlue); + this.add(InitItems.itemHelmCrystalLightBlue); + this.add(InitItems.itemChestCrystalLightBlue); + this.add(InitItems.itemPantsCrystalLightBlue); + this.add(InitItems.itemBootsCrystalLightBlue); - add(InitItems.itemPickaxeCrystalBlack); - add(InitItems.itemAxeCrystalBlack); - add(InitItems.itemShovelCrystalBlack); - add(InitItems.itemSwordCrystalBlack); - add(InitItems.itemHoeCrystalBlack); - add(InitItems.itemHelmCrystalBlack); - add(InitItems.itemChestCrystalBlack); - add(InitItems.itemPantsCrystalBlack); - add(InitItems.itemBootsCrystalBlack); + this.add(InitItems.itemPickaxeCrystalBlack); + this.add(InitItems.itemAxeCrystalBlack); + this.add(InitItems.itemShovelCrystalBlack); + this.add(InitItems.itemSwordCrystalBlack); + this.add(InitItems.itemHoeCrystalBlack); + this.add(InitItems.itemHelmCrystalBlack); + this.add(InitItems.itemChestCrystalBlack); + this.add(InitItems.itemPantsCrystalBlack); + this.add(InitItems.itemBootsCrystalBlack); - add(InitItems.itemPickaxeCrystalGreen); - add(InitItems.itemAxeCrystalGreen); - add(InitItems.itemShovelCrystalGreen); - add(InitItems.itemSwordCrystalGreen); - add(InitItems.itemHoeCrystalGreen); - add(InitItems.itemHelmCrystalGreen); - add(InitItems.itemChestCrystalGreen); - add(InitItems.itemPantsCrystalGreen); - add(InitItems.itemBootsCrystalGreen); + this.add(InitItems.itemPickaxeCrystalGreen); + this.add(InitItems.itemAxeCrystalGreen); + this.add(InitItems.itemShovelCrystalGreen); + this.add(InitItems.itemSwordCrystalGreen); + this.add(InitItems.itemHoeCrystalGreen); + this.add(InitItems.itemHelmCrystalGreen); + this.add(InitItems.itemChestCrystalGreen); + this.add(InitItems.itemPantsCrystalGreen); + this.add(InitItems.itemBootsCrystalGreen); - add(InitItems.itemPickaxeCrystalWhite); - add(InitItems.itemAxeCrystalWhite); - add(InitItems.itemShovelCrystalWhite); - add(InitItems.itemSwordCrystalWhite); - add(InitItems.itemHoeCrystalWhite); - add(InitItems.itemHelmCrystalWhite); - add(InitItems.itemChestCrystalWhite); - add(InitItems.itemPantsCrystalWhite); - add(InitItems.itemBootsCrystalWhite); + this.add(InitItems.itemPickaxeCrystalWhite); + this.add(InitItems.itemAxeCrystalWhite); + this.add(InitItems.itemShovelCrystalWhite); + this.add(InitItems.itemSwordCrystalWhite); + this.add(InitItems.itemHoeCrystalWhite); + this.add(InitItems.itemHelmCrystalWhite); + this.add(InitItems.itemChestCrystalWhite); + this.add(InitItems.itemPantsCrystalWhite); + this.add(InitItems.itemBootsCrystalWhite); } public void add(Item item){ - item.getSubItems(item, instance, this.list); + if(item != null){ + item.getSubItems(item, INSTANCE, this.list); + } } public void add(Block block){ - block.getSubBlocks(new ItemStack(block).getItem(), instance, this.list); + if(block != null){ + block.getSubBlocks(new ItemStack(block).getItem(), INSTANCE, this.list); + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/playerdata/PersistentServerData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/data/PlayerData.java similarity index 75% rename from src/main/java/de/ellpeck/actuallyadditions/mod/util/playerdata/PersistentServerData.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/data/PlayerData.java index 80bcb3501..2c4f5b8d7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/playerdata/PersistentServerData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/data/PlayerData.java @@ -1,14 +1,14 @@ /* - * This file ("PersistentServerData.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PersistentServerData.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ -package de.ellpeck.actuallyadditions.mod.util.playerdata; +package de.ellpeck.actuallyadditions.mod.data; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -16,27 +16,26 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; import java.util.UUID; -public class PersistentServerData{ +public final class PlayerData{ - public static ArrayList playerSaveData = new ArrayList(); - - public static NBTTagCompound getDataFromPlayer(EntityPlayer player){ + public static PlayerSave getDataFromPlayer(EntityPlayer player){ + ArrayList data = WorldData.PLAYER_SAVE_DATA; //Get Data from existing data - for(PlayerSave save : playerSaveData){ + for(PlayerSave save : data){ if(save.thePlayerUUID.equals(player.getUniqueID())){ - return save.theCompound; + return save; } } //Add Data if none is existant PlayerSave aSave = new PlayerSave(player.getUniqueID(), new NBTTagCompound()); - playerSaveData.add(aSave); - return aSave.theCompound; + data.add(aSave); + return aSave; } public static class PlayerSave{ - public UUID thePlayerUUID; + public final UUID thePlayerUUID; public NBTTagCompound theCompound; public PlayerSave(UUID theUUID, NBTTagCompound theCompound){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java new file mode 100644 index 000000000..7735892aa --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java @@ -0,0 +1,169 @@ +/* + * This file ("WorldData.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.data; + +import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave; +import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; +import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler.Network; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import io.netty.util.internal.ConcurrentSet; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraftforge.common.WorldSpecificSaveHandler; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class WorldData{ + + public static final String DATA_TAG = ModUtil.MOD_ID+"data"; + public static final ArrayList PLAYER_SAVE_DATA = new ArrayList(); + private static final Map WORLD_DATA = new ConcurrentHashMap(); + public final ConcurrentSet laserRelayNetworks = new ConcurrentSet(); + private final ISaveHandler handler; + private final int dimension; + + public WorldData(ISaveHandler handler, int dimension){ + this.handler = handler; + this.dimension = dimension; + } + + public static WorldData getDataForWorld(World world){ + int dim = world.provider.getDimension(); + WorldData data = WORLD_DATA.get(dim); + + if(data == null){ + data = new WorldData(null, dim); + + if(world.isRemote){ + WORLD_DATA.put(dim, data); + ModUtil.LOGGER.info("Creating temporary WorldData for world "+dim+" on the client!"); + } + else{ + ModUtil.LOGGER.warn("Trying to get WorldData from world "+dim+" that doesn't have any data!? This shouldn't happen!"); + } + } + + return data; + } + + public static void load(World world){ + if(!world.isRemote && world instanceof WorldServer){ + WorldData data = new WorldData(new WorldSpecificSaveHandler((WorldServer)world, world.getSaveHandler()), world.provider.getDimension()); + WORLD_DATA.put(data.dimension, data); + + try{ + File dataFile = data.handler.getMapFileFromName(DATA_TAG+data.dimension); + + if(dataFile != null && dataFile.exists()){ + FileInputStream stream = new FileInputStream(dataFile); + NBTTagCompound compound = CompressedStreamTools.readCompressed(stream); + stream.close(); + data.readFromNBT(compound); + + ModUtil.LOGGER.info("Successfully received WorldData for world "+data.dimension+"!"); + } + else{ + ModUtil.LOGGER.info("No WorldData found for world "+data.dimension+", creating..."); + } + + } + catch(Exception e){ + ModUtil.LOGGER.error("Something went wrong trying to load WorldData for world "+data.dimension+"!", e); + } + } + } + + public static void save(World world){ + if(!world.isRemote){ + WorldData data = WORLD_DATA.get(world.provider.getDimension()); + if(data != null && data.handler != null){ + try{ + File dataFile = data.handler.getMapFileFromName(DATA_TAG+data.dimension); + + if(dataFile != null){ + if(!dataFile.exists()){ + dataFile.createNewFile(); + ModUtil.LOGGER.info("Creating new WorldData file for world "+data.dimension+"!"); + } + + NBTTagCompound compound = new NBTTagCompound(); + data.writeToNBT(compound); + FileOutputStream stream = new FileOutputStream(dataFile); + CompressedStreamTools.writeCompressed(compound, stream); + stream.close(); + } + } + catch(Exception e){ + ModUtil.LOGGER.error("Something went wrong trying to save WorldData for world "+data.dimension+"!", e); + } + } + else{ + ModUtil.LOGGER.error("Tried to save WorldData for "+world.provider.getDimension()+" without any data being present!?"); + } + } + } + + public static void unload(World world){ + if(!world.isRemote){ + WORLD_DATA.remove(world.provider.getDimension()); + ModUtil.LOGGER.info("Unloading WorldData for world "+world.provider.getDimension()+"!"); + } + } + + private void readFromNBT(NBTTagCompound compound){ + //Laser World Data + this.laserRelayNetworks.clear(); + + NBTTagList networkList = compound.getTagList("Networks", 10); + for(int i = 0; i < networkList.tagCount(); i++){ + Network network = LaserRelayConnectionHandler.readNetworkFromNBT(networkList.getCompoundTagAt(i)); + this.laserRelayNetworks.add(network); + } + + if(this.dimension == 0){ + //Player Data + PLAYER_SAVE_DATA.clear(); + + NBTTagList playerList = compound.getTagList("PlayerData", 10); + for(int i = 0; i < playerList.tagCount(); i++){ + PlayerSave aSave = PlayerSave.fromNBT(playerList.getCompoundTagAt(i)); + PLAYER_SAVE_DATA.add(aSave); + } + } + } + + private void writeToNBT(NBTTagCompound compound){ + //Laser World Data + NBTTagList networkList = new NBTTagList(); + for(Network network : this.laserRelayNetworks){ + networkList.appendTag(LaserRelayConnectionHandler.writeNetworkToNBT(network)); + } + compound.setTag("Networks", networkList); + + if(this.dimension == 0){ + //Player Data + NBTTagList playerList = new NBTTagList(); + for(PlayerSave theSave : PLAYER_SAVE_DATA){ + playerList.appendTag(theSave.toNBT()); + } + compound.setTag("PlayerData", playerList); + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java deleted file mode 100644 index f86ab2dfe..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file ("BucketFillEvent.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - - -import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.player.FillBucketEvent; -import net.minecraftforge.fml.common.eventhandler.Event; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class BucketFillEvent{ - - @SubscribeEvent - public void onBucketFilled(FillBucketEvent event){ - this.fillBucket(event, InitItems.itemBucketOil, InitFluids.blockOil); - this.fillBucket(event, InitItems.itemBucketCanolaOil, InitFluids.blockCanolaOil); - } - - private void fillBucket(FillBucketEvent event, Item item, Block fluid){ - Block block = PosUtil.getBlock(event.target.getBlockPos(), event.world); - if(block == fluid){ - event.world.setBlockToAir(event.target.getBlockPos()); - event.result = new ItemStack(item); - event.setResult(Event.Result.ALLOW); - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java new file mode 100644 index 000000000..1550e2a11 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java @@ -0,0 +1,186 @@ +/* + * This file ("ClientEvents.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.event; + +import de.ellpeck.actuallyadditions.mod.blocks.IHudDisplay; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.tile.IEnergyDisplay; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.block.Block; +import net.minecraft.block.BlockRedstoneTorch; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.profiler.Profiler; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.List; + +@SideOnly(Side.CLIENT) +public class ClientEvents{ + + private static final String ADVANCED_INFO_TEXT_PRE = TextFormatting.DARK_GRAY+" "; + private static final String ADVANCED_INFO_HEADER_PRE = TextFormatting.GRAY+" -"; + + public ClientEvents(){ + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onTooltipEvent(ItemTooltipEvent event){ + //Advanced Item Info + if(event.getItemStack().getItem() != null){ + if(ConfigBoolValues.CTRL_EXTRA_INFO.isEnabled()){ + if(GuiScreen.isCtrlKeyDown()){ + event.getToolTip().add(TextFormatting.DARK_GRAY+""+TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".extraInfo.desc")+":"); + + //OreDict Names + int[] oreIDs = OreDictionary.getOreIDs(event.getItemStack()); + event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".oredictName.desc")+":"); + if(oreIDs.length > 0){ + for(int oreID : oreIDs){ + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+OreDictionary.getOreName(oreID)); + } + } + else{ + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".noOredictNameAvail.desc")); + } + + //Code Name + event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".codeName.desc")+":"); + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+Item.REGISTRY.getNameForObject(event.getItemStack().getItem())); + + //Base Item's Unlocalized Name + String baseName = event.getItemStack().getItem().getUnlocalizedName(); + if(baseName != null){ + event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".baseUnlocName.desc")+":"); + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+baseName); + } + + //Metadata + int meta = event.getItemStack().getItemDamage(); + int max = event.getItemStack().getMaxDamage(); + event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".meta.desc")+":"); + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+meta+(max > 0 ? "/"+max : "")); + + //Unlocalized Name + String metaName = event.getItemStack().getItem().getUnlocalizedName(event.getItemStack()); + if(metaName != null && baseName != null && !metaName.equals(baseName)){ + event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".unlocName.desc")+":"); + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+metaName); + } + + //NBT + NBTTagCompound compound = event.getItemStack().getTagCompound(); + if(compound != null && !compound.hasNoTags()){ + event.getToolTip().add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".nbt.desc")+":"); + if(GuiScreen.isShiftKeyDown()){ + List strgList = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(compound.toString(), 200); + for(String strg : strgList){ + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+strg); + } + } + else{ + event.getToolTip().add(ADVANCED_INFO_TEXT_PRE+TextFormatting.ITALIC+"["+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".pressShift.desc")+"]"); + } + } + + //Disabling Info + event.getToolTip().addAll(Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".disablingInfo.desc"), 200)); + + } + else{ + if(ConfigBoolValues.CTRL_INFO_FOR_EXTRA_INFO.isEnabled()){ + event.getToolTip().add(TextFormatting.DARK_GRAY+""+TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".ctrlForMoreInfo.desc")); + } + } + } + } + } + + @SubscribeEvent + public void onGameOverlay(RenderGameOverlayEvent.Post event){ + if(event.getType() == RenderGameOverlayEvent.ElementType.ALL && Minecraft.getMinecraft().currentScreen == null){ + Minecraft minecraft = Minecraft.getMinecraft(); + Profiler profiler = minecraft.mcProfiler; + EntityPlayer player = minecraft.thePlayer; + RayTraceResult posHit = minecraft.objectMouseOver; + FontRenderer font = minecraft.fontRendererObj; + ItemStack stack = player.getHeldItemMainhand(); + + profiler.startSection(ModUtil.MOD_ID+"Hud"); + + if(stack != null){ + if(stack.getItem() instanceof IHudDisplay){ + profiler.startSection("ItemHudDisplay"); + ((IHudDisplay)stack.getItem()).displayHud(minecraft, player, stack, posHit, profiler, event.getResolution()); + profiler.endSection(); + } + } + + if(posHit != null && posHit.getBlockPos() != null){ + Block blockHit = minecraft.theWorld.getBlockState(posHit.getBlockPos()).getBlock(); + TileEntity tileHit = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + + if(blockHit instanceof IHudDisplay){ + profiler.startSection("BlockHudDisplay"); + ((IHudDisplay)blockHit).displayHud(minecraft, player, stack, posHit, profiler, event.getResolution()); + profiler.endSection(); + } + + if(tileHit instanceof TileEntityBase){ + TileEntityBase base = (TileEntityBase)tileHit; + if(base.isRedstoneToggle()){ + profiler.startSection("RedstoneToggleHudDisplay"); + + String strg = "Redstone Mode: "+TextFormatting.DARK_RED+(base.isPulseMode ? "Pulse" : "Deactivation")+TextFormatting.RESET; + font.drawStringWithShadow(strg, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2+5, StringUtil.DECIMAL_COLOR_WHITE); + + if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){ + String expl = TextFormatting.GREEN+"Right-Click to toggle!"; + font.drawStringWithShadow(expl, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2+15, StringUtil.DECIMAL_COLOR_WHITE); + } + + profiler.endSection(); + } + } + + if(tileHit instanceof IEnergyDisplay){ + IEnergyDisplay display = (IEnergyDisplay)tileHit; + if(!display.needsHoldShift() || player.isSneaking()){ + profiler.startSection("EnergyDisplay"); + String strg = display.getEnergy()+"/"+display.getMaxEnergy()+" RF"; + font.drawStringWithShadow(TextFormatting.GOLD+strg, event.getResolution().getScaledWidth()/2+5, event.getResolution().getScaledHeight()/2-10, StringUtil.DECIMAL_COLOR_WHITE); + profiler.endSection(); + } + } + } + + profiler.endSection(); + } + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java new file mode 100644 index 000000000..603ffe403 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java @@ -0,0 +1,151 @@ +/* + * This file ("CommonEvents.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.event; + +import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements; +import de.ellpeck.actuallyadditions.mod.achievement.TheAchievements; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.data.PlayerData; +import de.ellpeck.actuallyadditions.mod.data.WorldData; +import de.ellpeck.actuallyadditions.mod.items.InitItems; +import de.ellpeck.actuallyadditions.mod.network.PacketHandler; +import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent; + +import java.util.Locale; + +public class CommonEvents{ + + public CommonEvents(){ + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void livingDeathEvent(LivingDeathEvent event){ + if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getEntityLiving() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.getEntityLiving(); + PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); + + NBTTagList deaths = data.theCompound.getTagList("Deaths", 10); + while(deaths.tagCount() >= 5){ + deaths.removeTag(0); + } + + NBTTagCompound death = new NBTTagCompound(); + death.setDouble("X", player.posX); + death.setDouble("Y", player.posY); + death.setDouble("Z", player.posZ); + deaths.appendTag(death); + + data.theCompound.setTag("Deaths", deaths); + + //player.addChatComponentMessage(new TextComponentTranslation("info."+ModUtil.MOD_ID+".deathRecorded")); + } + } + + @SubscribeEvent + public void onEntityDropEvent(LivingDropsEvent event){ + if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ + //Drop Cobwebs from Spiders + if(ConfigBoolValues.DO_SPIDER_DROPS.isEnabled() && event.getEntityLiving() instanceof EntitySpider){ + if(Util.RANDOM.nextInt(20) <= event.getLootingLevel()*2){ + event.getEntityLiving().entityDropItem(new ItemStack(Blocks.WEB, Util.RANDOM.nextInt(2+event.getLootingLevel())+1), 0); + } + } + } + } + + @SubscribeEvent + public void onLogInEvent(EntityJoinWorldEvent event){ + if(!event.getEntity().worldObj.isRemote && event.getEntity() instanceof EntityPlayerMP){ + EntityPlayerMP player = (EntityPlayerMP)event.getEntity(); + PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); + if(!data.theCompound.hasNoTags()){ + PacketHandler.theNetwork.sendTo(new PacketServerToClient(data.theCompound, PacketHandler.PLAYER_DATA_TO_CLIENT_HANDLER), player); + } + } + } + + public static void checkAchievements(ItemStack gotten, EntityPlayer player, InitAchievements.Type type){ + for(TheAchievements ach : TheAchievements.values()){ + if(ach.type == type){ + if(gotten != null && ach.chieve.theItemStack != null && gotten.getItem() == ach.chieve.theItemStack.getItem()){ + if(gotten.getItemDamage() == ach.chieve.theItemStack.getItemDamage()){ + player.addStat(ach.chieve, 1); + } + } + } + } + } + + @SubscribeEvent + public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){ + checkAchievements(event.crafting, event.player, InitAchievements.Type.CRAFTING); + + if(ConfigBoolValues.GIVE_BOOKLET_ON_FIRST_CRAFT.isEnabled()){ + if(!event.player.worldObj.isRemote && event.crafting != null && event.crafting.getItem() != null && event.crafting.getItem() != InitItems.itemBooklet){ + + String name = event.crafting.getItem().getRegistryName().toString(); + if(name != null && name.toLowerCase(Locale.ROOT).contains(ModUtil.MOD_ID)){ + PlayerData.PlayerSave compound = PlayerData.getDataFromPlayer(event.player); + if(compound != null && !compound.theCompound.getBoolean("BookGottenAlready")){ + compound.theCompound.setBoolean("BookGottenAlready", true); + + EntityItem entityItem = new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(InitItems.itemBooklet)); + entityItem.setPickupDelay(0); + event.player.worldObj.spawnEntityInWorld(entityItem); + } + } + } + } + } + + @SubscribeEvent + public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event){ + checkAchievements(event.smelting, event.player, InitAchievements.Type.SMELTING); + } + + @SubscribeEvent + public void onPickupEvent(PlayerEvent.ItemPickupEvent event){ + checkAchievements(event.pickedUp.getEntityItem(), event.player, InitAchievements.Type.PICK_UP); + } + + @SubscribeEvent + public void onLoad(WorldEvent.Load event){ + WorldData.load(event.getWorld()); + } + + @SubscribeEvent + public void onUnload(WorldEvent.Unload event){ + WorldData.unload(event.getWorld()); + } + + @SubscribeEvent + public void onSave(WorldEvent.Save event){ + WorldData.save(event.getWorld()); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/EntityLivingEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/EntityLivingEvent.java deleted file mode 100644 index 263ae1bb5..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/EntityLivingEvent.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This file ("EntityLivingEvent.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats; -import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.passive.EntityOcelot; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import java.util.UUID; - -public class EntityLivingEvent{ - - @SubscribeEvent - public void livingUpdateEvent(LivingUpdateEvent event){ - //Ocelots dropping Hair Balls - if(event.entityLiving != null && event.entityLiving.worldObj != null && !event.entityLiving.worldObj.isRemote){ - if((event.entityLiving instanceof EntityOcelot && ((EntityOcelot)event.entityLiving).isTamed()) || (event.entityLiving instanceof EntityPlayer && event.entityLiving.getUniqueID().equals(/*KittyVanCat*/ UUID.fromString("681d4e20-10ef-40c9-a0a5-ba2f1995ef44")))){ - if(ConfigBoolValues.DO_CAT_DROPS.isEnabled()){ - if(Util.RANDOM.nextInt(5000)+1 == 1){ - EntityItem item = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX+0.5, event.entityLiving.posY+0.5, event.entityLiving.posZ+0.5, new ItemStack(InitItems.itemHairyBall)); - event.entityLiving.worldObj.spawnEntityInWorld(item); - } - } - } - } - - //Wings allowing Flight - this.doWingStuff(event); - } - - /** - * Makes players be able to fly if they have Wings Of The Bats equipped - * (Partially excerpted from Botania's Wing System by Vazkii (as I had fiddled around with the system and couldn't make it work) with permission, thanks!) - */ - private void doWingStuff(LivingUpdateEvent event){ - if(event.entityLiving instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer)event.entityLiving; - boolean wingsEquipped = ItemWingsOfTheBats.getWingItem(player) != null; - - //If Player isn't (really) winged - if(!ItemWingsOfTheBats.isPlayerWinged(player)){ - if(wingsEquipped){ - //Make the Player actually winged - ItemWingsOfTheBats.addWingsToPlayer(player); - } - } - //If Player is (or should be) winged - else{ - if(wingsEquipped){ - //Allow the Player to fly when he has Wings equipped - player.capabilities.allowFlying = true; - } - else{ - //Make the Player not winged - ItemWingsOfTheBats.removeWingsFromPlayer(player); - //Reset Player's Values - if(!player.capabilities.isCreativeMode){ - player.capabilities.allowFlying = false; - player.capabilities.isFlying = false; - //Enables Fall Damage again (Automatically gets disabled for some reason) - player.capabilities.disableDamage = false; - } - } - } - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/HudEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/HudEvent.java deleted file mode 100644 index ceb691ded..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/HudEvent.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * This file ("HudEvent.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - -import de.ellpeck.actuallyadditions.mod.blocks.IHudDisplay; -import de.ellpeck.actuallyadditions.mod.tile.IEnergyDisplay; -import de.ellpeck.actuallyadditions.mod.tile.IRedstoneToggle; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.block.Block; -import net.minecraft.block.BlockRedstoneTorch; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.profiler.Profiler; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class HudEvent{ - - @SubscribeEvent - public void onGameOverlay(RenderGameOverlayEvent.Post event){ - if(event.type == RenderGameOverlayEvent.ElementType.ALL && Minecraft.getMinecraft().currentScreen == null){ - Minecraft minecraft = Minecraft.getMinecraft(); - Profiler profiler = minecraft.mcProfiler; - EntityPlayer player = minecraft.thePlayer; - MovingObjectPosition posHit = minecraft.objectMouseOver; - FontRenderer font = minecraft.fontRendererObj; - ItemStack stack = player.getCurrentEquippedItem(); - - profiler.startSection(ModUtil.MOD_ID+"Hud"); - - if(stack != null){ - if(stack.getItem() instanceof IHudDisplay){ - profiler.startSection("ItemHudDisplay"); - ((IHudDisplay)stack.getItem()).displayHud(minecraft, player, stack, posHit, profiler, event.resolution); - profiler.endSection(); - } - } - - if(posHit != null && posHit.getBlockPos() != null){ - Block blockHit = PosUtil.getBlock(posHit.getBlockPos(), minecraft.theWorld); - TileEntity tileHit = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); - - if(blockHit instanceof IHudDisplay){ - profiler.startSection("BlockHudDisplay"); - ((IHudDisplay)blockHit).displayHud(minecraft, player, stack, posHit, profiler, event.resolution); - profiler.endSection(); - } - - if(tileHit instanceof IRedstoneToggle){ - profiler.startSection("RedstoneToggleHudDisplay"); - - String strg = "Redstone Mode: "+EnumChatFormatting.DARK_RED+(((IRedstoneToggle)tileHit).isPulseMode() ? "Pulse" : "Deactivation")+EnumChatFormatting.RESET; - font.drawStringWithShadow(strg, event.resolution.getScaledWidth()/2+5, event.resolution.getScaledHeight()/2+5, StringUtil.DECIMAL_COLOR_WHITE); - - if(stack != null && Block.getBlockFromItem(stack.getItem()) instanceof BlockRedstoneTorch){ - String expl = EnumChatFormatting.GREEN+"Right-Click to toggle!"; - font.drawStringWithShadow(expl, event.resolution.getScaledWidth()/2+5, event.resolution.getScaledHeight()/2+15, StringUtil.DECIMAL_COLOR_WHITE); - } - - profiler.endSection(); - } - - if(tileHit instanceof IEnergyDisplay){ - profiler.startSection("EnergyDisplay"); - String strg = ((IEnergyDisplay)tileHit).getEnergy()+"/"+((IEnergyDisplay)tileHit).getMaxEnergy()+" RF"; - font.drawStringWithShadow(EnumChatFormatting.GOLD+strg, event.resolution.getScaledWidth()/2+5, event.resolution.getScaledHeight()/2-10, StringUtil.DECIMAL_COLOR_WHITE); - profiler.endSection(); - } - } - - profiler.endSection(); - } - } - -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java deleted file mode 100644 index 1ddf59809..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file ("InitEvents.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.nei.NEIScreenEvents; -import de.ellpeck.actuallyadditions.mod.update.UpdateCheckerClientNotificationEvent; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.Loader; - -public class InitEvents{ - - public static void init(){ - ModUtil.LOGGER.info("Initializing Events..."); - - Util.registerEvent(new PlayerObtainEvents()); - Util.registerEvent(new LivingDropEvent()); - Util.registerEvent(new EntityLivingEvent()); - Util.registerEvent(new BucketFillEvent()); - Util.registerEvent(new LogoutEvent()); - Util.registerEvent(new WorldLoadingEvents()); - MinecraftForge.TERRAIN_GEN_BUS.register(new WorldDecorationEvent()); - - } - - public static void initClient(){ - Util.registerEvent(new TooltipEvent()); - Util.registerEvent(new HudEvent()); - - if(Loader.isModLoaded("NotEnoughItems")){ - Util.registerEvent(new NEIScreenEvents()); - } - - if(ConfigBoolValues.DO_UPDATE_CHECK.isEnabled() && !Util.isDevVersion()){ - Util.registerEvent(new UpdateCheckerClientNotificationEvent()); - } - } - -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/LivingDropEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/LivingDropEvent.java deleted file mode 100644 index c84cf1df8..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/LivingDropEvent.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file ("LivingDropEvent.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.monster.EntitySpider; -import net.minecraft.entity.passive.EntityBat; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.living.LivingDropsEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class LivingDropEvent{ - - @SubscribeEvent - public void onEntityDropEvent(LivingDropsEvent event){ - if(event.source.getEntity() instanceof EntityPlayer){ - //Drop Solidified XP - if(event.entityLiving instanceof EntityCreature){ - if(Util.RANDOM.nextInt(15) <= 0){ - event.entityLiving.entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, Util.RANDOM.nextInt(2)+1), 0); - } - } - - //Drop Cobwebs from Spiders - if(ConfigBoolValues.DO_SPIDER_DROPS.isEnabled() && event.entityLiving instanceof EntitySpider){ - if(Util.RANDOM.nextInt(80) <= 0){ - event.entityLiving.entityDropItem(new ItemStack(Blocks.web, Util.RANDOM.nextInt(2)+1), 0); - } - } - - //Drop Wings from Bats - if(ConfigBoolValues.DO_BAT_DROPS.isEnabled() && event.entityLiving instanceof EntityBat){ - if(Util.RANDOM.nextInt(30) <= 0){ - event.entityLiving.entityDropItem(new ItemStack(InitItems.itemMisc, Util.RANDOM.nextInt(2)+1, TheMiscItems.BAT_WING.ordinal()), 0); - } - } - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/LogoutEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/LogoutEvent.java deleted file mode 100644 index 2d14f6a0e..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/LogoutEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file ("LogoutEvent.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - -import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.PlayerEvent; - -public class LogoutEvent{ - - @SubscribeEvent - public void onLogOutEvent(PlayerEvent.PlayerLoggedOutEvent event){ - //Remove Player from Wings' Fly Permission List - ItemWingsOfTheBats.removeWingsFromPlayer(event.player, true); - ItemWingsOfTheBats.removeWingsFromPlayer(event.player, false); - } - -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerObtainEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerObtainEvents.java deleted file mode 100644 index d8f009d22..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerObtainEvents.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This file ("PlayerObtainEvents.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - -import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements; -import de.ellpeck.actuallyadditions.mod.achievement.TheAchievements; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.misc.WorldData; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentServerData; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.PlayerEvent; - -import java.util.Locale; - -public class PlayerObtainEvents{ - - public static void checkAchievements(ItemStack gotten, EntityPlayer player, InitAchievements.Type type){ - for(int i = 0; i < TheAchievements.values().length; i++){ - TheAchievements ach = TheAchievements.values()[i]; - if(ach.type == type){ - if(gotten != null && ach.ach.theItemStack != null && gotten.getItem() == ach.ach.theItemStack.getItem()){ - if(gotten.getItemDamage() == ach.ach.theItemStack.getItemDamage()){ - player.addStat(ach.ach, 1); - } - } - } - } - } - - @SubscribeEvent - public void onCraftedEvent(PlayerEvent.ItemCraftedEvent event){ - checkAchievements(event.crafting, event.player, InitAchievements.Type.CRAFTING); - - if(ConfigBoolValues.GIVE_BOOKLET_ON_FIRST_CRAFT.isEnabled()){ - if(!event.player.worldObj.isRemote && event.crafting != null && event.crafting.getItem() != null && event.crafting.getItem() != InitItems.itemBooklet){ - - String name = event.crafting.getItem().getRegistryName(); - if(name != null && name.toLowerCase(Locale.ROOT).contains(ModUtil.MOD_ID_LOWER)){ - NBTTagCompound compound = PersistentServerData.getDataFromPlayer(event.player); - if(compound != null && !compound.getBoolean("BookGottenAlready")){ - compound.setBoolean("BookGottenAlready", true); - WorldData.makeDirty(); - - EntityItem entityItem = new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(InitItems.itemBooklet)); - entityItem.setPickupDelay(0); - event.player.worldObj.spawnEntityInWorld(entityItem); - } - } - } - } - } - - @SubscribeEvent - public void onSmeltedEvent(PlayerEvent.ItemSmeltedEvent event){ - checkAchievements(event.smelting, event.player, InitAchievements.Type.SMELTING); - } - - @SubscribeEvent - public void onPickupEvent(PlayerEvent.ItemPickupEvent event){ - checkAchievements(event.pickedUp.getEntityItem(), event.player, InitAchievements.Type.PICK_UP); - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java deleted file mode 100644 index 2821db6b4..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/TooltipEvent.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file ("TooltipEvent.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.util.KeyUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.Minecraft; -import net.minecraft.item.Item; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.List; - -public class TooltipEvent{ - - private static final String ADVANCED_INFO_TEXT_PRE = EnumChatFormatting.DARK_GRAY+" "; - private static final String ADVANCED_INFO_HEADER_PRE = EnumChatFormatting.GRAY+" -"; - - @SuppressWarnings("unchecked") - @SubscribeEvent - public void onTooltipEvent(ItemTooltipEvent event){ - //Advanced Item Info - if(event.itemStack.getItem() != null){ - if(ConfigBoolValues.CTRL_EXTRA_INFO.isEnabled()){ - if(KeyUtil.isControlPressed()){ - event.toolTip.add(EnumChatFormatting.DARK_GRAY+""+EnumChatFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".extraInfo.desc")+":"); - - //OreDict Names - int[] oreIDs = OreDictionary.getOreIDs(event.itemStack); - event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".oredictName.desc")+":"); - if(oreIDs.length > 0){ - for(int oreID : oreIDs){ - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+OreDictionary.getOreName(oreID)); - } - } - else{ - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".noOredictNameAvail.desc")); - } - - //Code Name - event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".codeName.desc")+":"); - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+Item.itemRegistry.getNameForObject(event.itemStack.getItem())); - - //Base Item's Unlocalized Name - String baseName = event.itemStack.getItem().getUnlocalizedName(); - if(baseName != null){ - event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".baseUnlocName.desc")+":"); - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+baseName); - } - - //Metadata - int meta = event.itemStack.getItemDamage(); - event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".meta.desc")+":"); - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+meta); - - //Unlocalized Name - String metaName = event.itemStack.getItem().getUnlocalizedName(event.itemStack); - if(metaName != null && baseName != null && !metaName.equals(baseName)){ - event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".unlocName.desc")+":"); - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+metaName); - } - - //NBT - NBTTagCompound compound = event.itemStack.getTagCompound(); - if(compound != null && !compound.hasNoTags()){ - event.toolTip.add(ADVANCED_INFO_HEADER_PRE+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".nbt.desc")+":"); - if(KeyUtil.isShiftPressed()){ - List strgList = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(compound.toString(), 200); - for(String strg : strgList){ - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+strg); - } - } - else{ - event.toolTip.add(ADVANCED_INFO_TEXT_PRE+EnumChatFormatting.ITALIC+"["+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".pressShift.desc")+"]"); - } - } - - //Disabling Info - event.toolTip.addAll(Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(EnumChatFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".disablingInfo.desc"), 200)); - - } - else{ - if(ConfigBoolValues.CTRL_INFO_FOR_EXTRA_INFO.isEnabled()){ - event.toolTip.add(EnumChatFormatting.DARK_GRAY+""+EnumChatFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".ctrlForMoreInfo.desc")); - } - } - } - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java deleted file mode 100644 index 2b5f9da86..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldDecorationEvent.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file ("WorldDecorationEvent.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - - -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheWildPlants; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.BlockPos; -import net.minecraft.world.biome.BiomeGenOcean; -import net.minecraftforge.event.terraingen.DecorateBiomeEvent; -import net.minecraftforge.fml.common.eventhandler.Event; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import java.util.ArrayList; - -public class WorldDecorationEvent{ - - @SubscribeEvent - public void onWorldDecoration(DecorateBiomeEvent.Decorate event){ - if((event.getResult() == Event.Result.ALLOW || event.getResult() == Event.Result.DEFAULT)){ - if(Util.arrayContains(ConfigValues.plantDimensionBlacklist, event.world.provider.getDimensionId()) < 0){ - this.generateRice(event); - this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.CANOLA.ordinal(), ConfigIntValues.CANOLA_AMOUNT.getValue(), ConfigBoolValues.DO_CANOLA_GEN.isEnabled(), Material.grass, event); - this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.FLAX.ordinal(), ConfigIntValues.FLAX_AMOUNT.getValue(), ConfigBoolValues.DO_FLAX_GEN.isEnabled(), Material.grass, event); - this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.COFFEE.ordinal(), ConfigIntValues.COFFEE_AMOUNT.getValue(), ConfigBoolValues.DO_COFFEE_GEN.isEnabled(), Material.grass, event); - this.genPlantNormally(InitBlocks.blockBlackLotus, 0, ConfigIntValues.BLACK_LOTUS_AMOUNT.getValue(), ConfigBoolValues.DO_LOTUS_GEN.isEnabled(), Material.grass, event); - } - - //Generate Treasure Chests - if(ConfigBoolValues.DO_TREASURE_CHEST_GEN.isEnabled()){ - if(event.rand.nextInt(300) == 0){ - BlockPos randomPos = new BlockPos(event.pos.getX()+event.rand.nextInt(16)+8, 0, event.pos.getZ()+event.rand.nextInt(16)+8); - randomPos = event.world.getTopSolidOrLiquidBlock(randomPos); - - if(event.world.getBiomeGenForCoords(randomPos) instanceof BiomeGenOcean){ - if(randomPos.getY() >= 25 && randomPos.getY() <= 45){ - if(PosUtil.getBlock(randomPos, event.world).getMaterial() == Material.water){ - if(PosUtil.getMaterial(PosUtil.offset(randomPos, 0, -1, 0), event.world).isSolid()){ - PosUtil.setBlock(randomPos, event.world, InitBlocks.blockTreasureChest, event.rand.nextInt(4), 2); - } - } - } - } - } - } - } - } - - private void generateRice(DecorateBiomeEvent event){ - if(ConfigBoolValues.DO_RICE_GEN.isEnabled()){ - for(int i = 0; i < ConfigIntValues.RICE_AMOUNT.getValue(); i++){ - if(event.rand.nextInt(50) == 0){ - BlockPos randomPos = new BlockPos(event.pos.getX()+event.rand.nextInt(16)+8, 0, event.pos.getZ()+event.rand.nextInt(16)+8); - randomPos = event.world.getTopSolidOrLiquidBlock(randomPos); - if(PosUtil.getMaterial(randomPos, event.world) == Material.water){ - ArrayList blocksAroundBottom = WorldUtil.getMaterialsAround(event.world, randomPos); - BlockPos posToGenAt = PosUtil.offset(randomPos, 0, 1, 0); - ArrayList blocksAroundTop = WorldUtil.getMaterialsAround(event.world, posToGenAt); - if(blocksAroundBottom.contains(Material.grass) || blocksAroundBottom.contains(Material.ground) || blocksAroundBottom.contains(Material.rock) || blocksAroundBottom.contains(Material.sand)){ - if(!blocksAroundTop.contains(Material.water) && PosUtil.getMaterial(posToGenAt, event.world) == Material.air){ - PosUtil.setBlock(posToGenAt, event.world, InitBlocks.blockWildPlant, TheWildPlants.RICE.ordinal(), 2); - } - } - } - } - } - } - } - - private void genPlantNormally(Block plant, int meta, int amount, boolean doIt, Material blockBelow, DecorateBiomeEvent event){ - if(doIt){ - for(int i = 0; i < amount; i++){ - if(event.rand.nextInt(400) == 0){ - BlockPos randomPos = new BlockPos(event.pos.getX()+event.rand.nextInt(16)+8, 0, event.pos.getZ()+event.rand.nextInt(16)+8); - randomPos = event.world.getTopSolidOrLiquidBlock(randomPos); - - if(PosUtil.getMaterial(PosUtil.offset(randomPos, 0, -1, 0), event.world) == blockBelow){ - if(plant.canPlaceBlockAt(event.world, randomPos)){ - PosUtil.setBlock(randomPos, event.world, plant, meta, 2); - } - } - } - } - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldLoadingEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldLoadingEvents.java deleted file mode 100644 index 602ca99b7..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/WorldLoadingEvents.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file ("WorldLoadingEvents.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.event; - -import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; -import de.ellpeck.actuallyadditions.mod.misc.WorldData; -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -public class WorldLoadingEvents{ - - @SubscribeEvent - public void onLoad(WorldEvent.Load event){ - if(LaserRelayConnectionHandler.getInstance() == null){ - LaserRelayConnectionHandler.setInstance(new LaserRelayConnectionHandler()); - } - } - - @SubscribeEvent - public void onUnload(WorldEvent.Unload event){ - WorldData.makeDirty(); - } - - @SubscribeEvent - public void onSave(WorldEvent.Save event){ - WorldData.makeDirty(); - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java index c71e0a1a6..c1bd9b6ff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java @@ -1,11 +1,11 @@ /* - * This file ("FluidAA.java") is part of the Actually Additions Mod for Minecraft. + * This file ("FluidAA.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.fluids; @@ -17,11 +17,11 @@ import net.minecraftforge.fluids.Fluid; public class FluidAA extends Fluid{ public FluidAA(String fluidName, String textureName){ - super(fluidName, new ResourceLocation(ModUtil.MOD_ID_LOWER, "blocks/"+textureName+"Still"), new ResourceLocation(ModUtil.MOD_ID_LOWER, "blocks/"+textureName+"Flowing")); + super(fluidName, new ResourceLocation(ModUtil.MOD_ID, "blocks/"+textureName+"Still"), new ResourceLocation(ModUtil.MOD_ID, "blocks/"+textureName+"Flowing")); } @Override public String getUnlocalizedName(){ - return "fluid."+ModUtil.MOD_ID_LOWER+"."+this.unlocalizedName; + return "fluid."+ModUtil.MOD_ID+"."+this.unlocalizedName; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java index 0bab1171f..9e4130746 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java @@ -1,25 +1,25 @@ /* - * This file ("InitFluids.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitFluids.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.fluids; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.EnumRarity; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; -public class InitFluids{ +import java.util.Locale; + +public final class InitFluids{ public static Fluid fluidCanolaOil; public static Fluid fluidOil; @@ -28,48 +28,22 @@ public class InitFluids{ public static Block blockOil; public static void init(){ - //Canola Fluid - String canolaOil = "canolaoil"; - if(!FluidRegistry.isFluidRegistered(canolaOil) || ConfigBoolValues.PREVENT_CANOLA_OVERRIDE.isEnabled()){ - fluidCanolaOil = new FluidAA(canolaOil, "blockCanolaOil").setRarity(EnumRarity.UNCOMMON); - FluidRegistry.registerFluid(fluidCanolaOil); - } - else{ - errorAlreadyRegistered("Canola Oil Fluid"); - } - fluidCanolaOil = FluidRegistry.getFluid(canolaOil); + fluidCanolaOil = registerFluid("canolaoil", "blockCanolaOil", EnumRarity.UNCOMMON); + fluidOil = registerFluid("oil", "blockOil", EnumRarity.UNCOMMON); - //Canola Block - if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){ - blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil"); - } - else{ - errorAlreadyRegistered("Canola Oil Block"); - } - blockCanolaOil = fluidCanolaOil.getBlock(); - - //Oil Fluid - String oil = "oil"; - if(!FluidRegistry.isFluidRegistered(oil) || ConfigBoolValues.PREVENT_OIL_OVERRIDE.isEnabled()){ - fluidOil = new FluidAA(oil, "blockOil").setRarity(EnumRarity.UNCOMMON); - FluidRegistry.registerFluid(fluidOil); - } - else{ - errorAlreadyRegistered("Oil Fluid"); - } - fluidOil = FluidRegistry.getFluid(oil); - - //Oil Block - if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){ - blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil"); - } - else{ - errorAlreadyRegistered("Oil Block"); - } - blockOil = fluidOil.getBlock(); + blockCanolaOil = registerFluidBlock(fluidCanolaOil, Material.WATER, "blockCanolaOil"); + blockOil = registerFluidBlock(fluidOil, Material.WATER, "blockOil"); } - public static void errorAlreadyRegistered(String str){ - ModUtil.LOGGER.warn(str+" from "+ModUtil.NAME+" is not getting used as it has already been registered by another Mod! If this causes Issues (which it shouldn't!), you can turn this off in the Config File!"); + private static Fluid registerFluid(String fluidName, String fluidTextureName, EnumRarity rarity){ + Fluid fluid = new FluidAA(fluidName.toLowerCase(Locale.ROOT), fluidTextureName).setRarity(rarity); + FluidRegistry.registerFluid(fluid); + FluidRegistry.addBucketForFluid(fluid); + + return fluid; + } + + private static Block registerFluidBlock(Fluid fluid, Material material, String name){ + return new BlockFluidFlowing(fluid, material, name); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/InitVillager.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/InitVillager.java index f46d3b9a2..ddacb3eff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/InitVillager.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/InitVillager.java @@ -1,11 +1,11 @@ /* - * This file ("InitVillager.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitVillager.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.gen; @@ -13,10 +13,11 @@ package de.ellpeck.actuallyadditions.mod.gen; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraftforge.fml.common.registry.VillagerRegistry; -public class InitVillager{ +public final class InitVillager{ - public static final String JAM_HOUSE_CHEST_NAME = ModUtil.MOD_ID_LOWER+".jamHouseChest"; + public static final String JAM_HOUSE_CHEST_NAME = ModUtil.MOD_ID+".jamHouseChest"; public static void init(){ ModUtil.LOGGER.info("Initializing Village Addons..."); @@ -32,8 +33,8 @@ public class InitVillager{ private static void initJamVillagePart(){ //TODO Fix villager /*int jamID = ConfigIntValues.JAM_VILLAGER_ID.getValue(); - VillagerRegistry.instance().registerVillagerId(jamID); - VillagerRegistry.instance().registerVillageTradeHandler(jamID, new JamVillagerTradeHandler()); + VillagerRegistry.INSTANCE().registerVillagerId(jamID); + VillagerRegistry.INSTANCE().registerVillageTradeHandler(jamID, new JamVillagerTradeHandler()); ChestGenHooks jamHouseChest = ChestGenHooks.getInfo(JAM_HOUSE_CHEST_NAME); jamHouseChest.setMin(5); @@ -42,16 +43,15 @@ public class InitVillager{ ChestGenHooks.addItem(JAM_HOUSE_CHEST_NAME, new WeightedRandomChestContent(new ItemStack(InitItems.itemJams, 1, i), 1, 1, 10)); } ChestGenHooks.addItem(JAM_HOUSE_CHEST_NAME, new WeightedRandomChestContent(new ItemStack(Items.glass_bottle), 1, 2, 30)); - ChestGenHooks.addItem(JAM_HOUSE_CHEST_NAME, new WeightedRandomChestContent(new ItemStack(Items.potionitem), 1, 1, 20)); + ChestGenHooks.addItem(JAM_HOUSE_CHEST_NAME, new WeightedRandomChestContent(new ItemStack(Items.potionitem), 1, 1, 20));*/ VillagerRegistry.instance().registerVillageCreationHandler(new VillageJamHouseHandler()); - MapGenStructureIO.func_143031_a(VillageComponentJamHouse.class, ModUtil.MOD_ID_LOWER+":jamHouseStructure");*/ + MapGenStructureIO.registerStructureComponent(VillageComponentJamHouse.class, ModUtil.MOD_ID+":jamHouseStructure"); } private static void initCustomCropFieldPart(){ - //TODO Fix village - //VillagerRegistry.instance().registerVillageCreationHandler(new VillageCustomCropFieldHandler()); - MapGenStructureIO.registerStructureComponent(VillageComponentCustomCropField.class, ModUtil.MOD_ID_LOWER+":customCropFieldStructure"); + VillagerRegistry.instance().registerVillageCreationHandler(new VillageCustomCropFieldHandler()); + MapGenStructureIO.registerStructureComponent(VillageComponentCustomCropField.class, ModUtil.MOD_ID+":customCropFieldStructure"); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java index a67fbfeb7..f8f0ab7e6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java @@ -1,11 +1,11 @@ /* - * This file ("JamVillagerTradeHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("JamVillagerTradeHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.gen; @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheJams; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; import net.minecraft.village.MerchantRecipe; import net.minecraft.village.MerchantRecipeList; import net.minecraftforge.oredict.OreDictionary; @@ -23,47 +23,44 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.ArrayList; import java.util.Random; -//TODO Fix the villager public class JamVillagerTradeHandler{ - private ArrayList trades = new ArrayList(); + private final ArrayList trades = new ArrayList(); public JamVillagerTradeHandler(){ this.addWants("ingotGold", 5, 7); this.addWants("cropWheat", 15, 25); this.addWants("dustRedstone", 25, 40); - this.addWants(new ItemStack(Items.bucket), 5, 9); - this.addWants(new ItemStack(Items.glass_bottle), 12, 17); - this.addWants(new ItemStack(Items.potionitem), 1, 1); + this.addWants(new ItemStack(Items.BUCKET), 5, 9); + this.addWants(new ItemStack(Items.GLASS_BOTTLE), 12, 17); + this.addWants(new ItemStack(Items.POTIONITEM), 1, 1); this.addWants("ingotIron", 10, 15); this.addWants("gemDiamond", 1, 2); this.addWants("dustGlowstone", 12, 22); } public void addWants(String oredictName, int minSize, int maxSize){ - ArrayList stacks = (ArrayList)OreDictionary.getOres(oredictName); - trades.add(new Trade(stacks, minSize, maxSize)); + ArrayList stacks = (ArrayList)OreDictionary.getOres(oredictName, false); + this.trades.add(new Trade(stacks, minSize, maxSize)); } public void addWants(ItemStack stack, int minSize, int maxSize){ - trades.add(new Trade(stack, minSize, maxSize)); + this.trades.add(new Trade(stack, minSize, maxSize)); } - //TODO Fix the Villager //@Override - @SuppressWarnings("all") public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand){ - for(int trade = 0; trade < trades.size(); trade++){ - for(int want = 0; want < trades.get(trade).wants.size(); want++){ - ItemStack wantsOne = trades.get(trade).wants.get(want); - wantsOne.stackSize = MathHelper.getRandomIntegerInRange(rand, trades.get(trade).minStackSize, trades.get(trade).maxStackSize); + for(int trade = 0; trade < this.trades.size(); trade++){ + for(int want = 0; want < this.trades.get(trade).wants.size(); want++){ + ItemStack wantsOne = this.trades.get(trade).wants.get(want); + wantsOne.stackSize = MathHelper.getRandomIntegerInRange(rand, this.trades.get(trade).minStackSize, this.trades.get(trade).maxStackSize); ItemStack wantsTwo = null; if(rand.nextInt(3) == 0){ - int randomSecondTrade = rand.nextInt(trades.size()); - for(int randomSecondWant = 0; randomSecondWant < trades.get(randomSecondTrade).wants.size(); randomSecondWant++){ - wantsTwo = trades.get(randomSecondTrade).wants.get(randomSecondWant); - wantsTwo.stackSize = MathHelper.getRandomIntegerInRange(rand, trades.get(randomSecondTrade).minStackSize, trades.get(randomSecondTrade).maxStackSize); + int randomSecondTrade = rand.nextInt(this.trades.size()); + for(int randomSecondWant = 0; randomSecondWant < this.trades.get(randomSecondTrade).wants.size(); randomSecondWant++){ + wantsTwo = this.trades.get(randomSecondTrade).wants.get(randomSecondWant); + wantsTwo.stackSize = MathHelper.getRandomIntegerInRange(rand, this.trades.get(randomSecondTrade).minStackSize, this.trades.get(randomSecondTrade).maxStackSize); } } if(wantsOne == wantsTwo){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/OreGen.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/OreGen.java index 46a556502..317cdc0fe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/OreGen.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/OreGen.java @@ -1,33 +1,45 @@ /* - * This file ("OreGen.java") is part of the Actually Additions Mod for Minecraft. + * This file ("OreGen.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.gen; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; +import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheWildPlants; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntListValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; -import net.minecraft.block.state.pattern.BlockHelper; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.pattern.BlockMatcher; import net.minecraft.init.Blocks; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeOcean; +import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; import net.minecraftforge.fml.common.IWorldGenerator; +import net.minecraftforge.fml.common.eventhandler.Event; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.registry.GameRegistry; +import org.apache.commons.lang3.ArrayUtils; +import java.util.ArrayList; import java.util.Random; public class OreGen implements IWorldGenerator{ @@ -35,40 +47,32 @@ public class OreGen implements IWorldGenerator{ public static final int QUARTZ_MIN = 0; public static final int QUARTZ_MAX = 45; - public static void init(){ + private final WorldGenLushCaves caveGen = new WorldGenLushCaves(); + + public OreGen(){ ModUtil.LOGGER.info("Registering World Generator..."); - GameRegistry.registerWorldGenerator(new OreGen(), 10); + GameRegistry.registerWorldGenerator(this, 10); + MinecraftForge.TERRAIN_GEN_BUS.register(this); } @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){ - if(world.getWorldType() != WorldType.FLAT && Util.arrayContains(ConfigValues.oreGenDimensionBlacklist, world.provider.getDimensionId()) < 0){ - switch(world.provider.getDimensionId()){ - case -1: - generateNether(world, random, chunkX*16, chunkZ*16); - //case 0: - // generateSurface(world, random, chunkX*16, chunkZ*16); - case 1: - generateEnd(world, random, chunkX*16, chunkZ*16); - default: - generateSurface(world, random, chunkX*16, chunkZ*16); + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider){ + int dimension = world.provider.getDimension(); + if(dimension != -1 && dimension != 1){ + if(world.getWorldType() != WorldType.FLAT && Util.arrayContains(ArrayUtils.toObject(ConfigIntListValues.ORE_GEN_DIMENSION_BLACKLIST.getValue()), world.provider.getDimension()) < 0){ + this.generateDefault(world, random, chunkX*16, chunkZ*16); } } } - @SuppressWarnings("unused") - private void generateNether(World world, Random random, int x, int z){ - - } - - @SuppressWarnings("unused") - private void generateEnd(World world, Random random, int x, int z){ - - } - - private void generateSurface(World world, Random random, int x, int z){ + private void generateDefault(World world, Random random, int x, int z){ if(ConfigBoolValues.GENERATE_QUARTZ.isEnabled()){ - this.addOreSpawn(InitBlocks.blockMisc, TheMiscBlocks.ORE_QUARTZ.ordinal(), Blocks.stone, world, random, x, z, MathHelper.getRandomIntegerInRange(random, 5, 8), 10, QUARTZ_MIN, QUARTZ_MAX); + this.addOreSpawn(InitBlocks.blockMisc, TheMiscBlocks.ORE_QUARTZ.ordinal(), Blocks.STONE, world, random, x, z, MathHelper.getRandomIntegerInRange(random, 5, 8), 10, QUARTZ_MIN, QUARTZ_MAX); + } + + if(ConfigBoolValues.GEN_LUSH_CAVES.isEnabled() && random.nextInt(ConfigIntValues.LUSH_CAVE_CHANCE.getValue()) <= 0){ + BlockPos posAtHeight = world.getTopSolidOrLiquidBlock(new BlockPos(x+random.nextInt(16)+8, 0, z+random.nextInt(16)+8)); + this.caveGen.generate(world, random, posAtHeight.down(MathHelper.getRandomIntegerInRange(random, 10, posAtHeight.getY()-10))); } } @@ -79,11 +83,80 @@ public class OreGen implements IWorldGenerator{ int posX = blockXPos+random.nextInt(16); int posY = minY+random.nextInt(yDiff); int posZ = blockZPos+random.nextInt(16); - new WorldGenMinable(block.getStateFromMeta(meta), maxVeinSize, BlockHelper.forBlock(blockIn)).generate(world, random, new BlockPos(posX, posY, posZ)); + new WorldGenMinable(block.getStateFromMeta(meta), maxVeinSize, BlockMatcher.forBlock(blockIn)).generate(world, random, new BlockPos(posX, posY, posZ)); } } else{ ModUtil.LOGGER.fatal("Couldn't generate '"+block.getUnlocalizedName()+"' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!"); } } + + @SubscribeEvent + public void onWorldDecoration(DecorateBiomeEvent.Decorate event){ + if((event.getResult() == Event.Result.ALLOW || event.getResult() == Event.Result.DEFAULT)){ + if(Util.arrayContains(ArrayUtils.toObject(ConfigIntListValues.PLANT_DIMENSION_BLACKLIST.getValue()), event.getWorld().provider.getDimension()) < 0){ + this.generateRice(event); + this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.CANOLA.ordinal(), ConfigIntValues.CANOLA_AMOUNT.getValue(), ConfigBoolValues.DO_CANOLA_GEN.isEnabled(), Material.GRASS, event); + this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.FLAX.ordinal(), ConfigIntValues.FLAX_AMOUNT.getValue(), ConfigBoolValues.DO_FLAX_GEN.isEnabled(), Material.GRASS, event); + this.genPlantNormally(InitBlocks.blockWildPlant, TheWildPlants.COFFEE.ordinal(), ConfigIntValues.COFFEE_AMOUNT.getValue(), ConfigBoolValues.DO_COFFEE_GEN.isEnabled(), Material.GRASS, event); + this.genPlantNormally(InitBlocks.blockBlackLotus, 0, ConfigIntValues.BLACK_LOTUS_AMOUNT.getValue(), ConfigBoolValues.DO_LOTUS_GEN.isEnabled(), Material.GRASS, event); + } + + //Generate Treasure Chests + if(ConfigBoolValues.DO_TREASURE_CHEST_GEN.isEnabled()){ + if(event.getRand().nextInt(300) == 0){ + BlockPos randomPos = new BlockPos(event.getPos().getX()+event.getRand().nextInt(16)+8, 0, event.getPos().getZ()+event.getRand().nextInt(16)+8); + randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos); + + if(event.getWorld().getBiomeGenForCoords(randomPos) instanceof BiomeOcean){ + if(randomPos.getY() >= 25 && randomPos.getY() <= 45){ + if(event.getWorld().getBlockState(randomPos).getMaterial() == Material.WATER){ + if(event.getWorld().getBlockState(randomPos.down()).getMaterial().isSolid()){ + event.getWorld().setBlockState(randomPos, InitBlocks.blockTreasureChest.getStateFromMeta(event.getRand().nextInt(4)), 2); + } + } + } + } + } + } + } + } + + private void generateRice(DecorateBiomeEvent event){ + if(ConfigBoolValues.DO_RICE_GEN.isEnabled()){ + for(int i = 0; i < ConfigIntValues.RICE_AMOUNT.getValue(); i++){ + if(event.getRand().nextInt(50) == 0){ + BlockPos randomPos = new BlockPos(event.getPos().getX()+event.getRand().nextInt(16)+8, 0, event.getPos().getZ()+event.getRand().nextInt(16)+8); + randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos); + if(event.getWorld().getBlockState(randomPos).getMaterial() == Material.WATER){ + ArrayList blocksAroundBottom = WorldUtil.getMaterialsAround(event.getWorld(), randomPos); + BlockPos posToGenAt = randomPos.up(); + ArrayList blocksAroundTop = WorldUtil.getMaterialsAround(event.getWorld(), posToGenAt); + if(blocksAroundBottom.contains(Material.GRASS) || blocksAroundBottom.contains(Material.GROUND) || blocksAroundBottom.contains(Material.ROCK) || blocksAroundBottom.contains(Material.SAND)){ + if(!blocksAroundTop.contains(Material.WATER) && event.getWorld().getBlockState(posToGenAt).getMaterial() == Material.AIR){ + event.getWorld().setBlockState(posToGenAt, InitBlocks.blockWildPlant.getStateFromMeta(TheWildPlants.RICE.ordinal()), 2); + } + } + } + } + } + } + } + + private void genPlantNormally(Block plant, int meta, int amount, boolean doIt, Material blockBelow, DecorateBiomeEvent event){ + if(doIt){ + for(int i = 0; i < amount; i++){ + if(event.getRand().nextInt(400) == 0){ + BlockPos randomPos = new BlockPos(event.getPos().getX()+event.getRand().nextInt(16)+8, 0, event.getPos().getZ()+event.getRand().nextInt(16)+8); + randomPos = event.getWorld().getTopSolidOrLiquidBlock(randomPos); + + if(event.getWorld().getBlockState(randomPos.down()).getMaterial() == blockBelow){ + if(plant.canPlaceBlockAt(event.getWorld(), randomPos) && event.getWorld().isAirBlock(randomPos)){ + event.getWorld().setBlockState(randomPos, plant.getStateFromMeta(meta), 2); + } + } + } + } + } + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentCustomCropField.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentCustomCropField.java index 2106b9729..61c054aa0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentCustomCropField.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentCustomCropField.java @@ -1,38 +1,48 @@ /* - * This file ("VillageComponentCustomCropField.java") is part of the Actually Additions Mod for Minecraft. + * This file ("VillageComponentCustomCropField.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.gen; +import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; import net.minecraft.world.gen.structure.StructureVillagePieces; +import java.util.List; +import java.util.Random; + public class VillageComponentCustomCropField extends StructureVillagePieces.House1{ - private static final int xSize = 13; - private static final int ySize = 4; - private static final int zSize = 9; + private static final int X_SIZE = 13; + private static final int Y_SIZE = 4; + private static final int Z_SIZE = 9; private int averageGroundLevel = -1; - @SuppressWarnings("unused") public VillageComponentCustomCropField(){ } - //TODO Fix village - /*public VillageComponentCustomCropField(StructureBoundingBox boundingBox, int par5){ - this.coordBaseMode = par5; + public VillageComponentCustomCropField(StructureBoundingBox boundingBox, EnumFacing par5){ + this.setCoordBaseMode(par5); this.boundingBox = boundingBox; } - public static VillageComponentCustomCropField buildComponent(List pieces, int p1, int p2, int p3, int p4){ - StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, xSize, ySize, zSize, p4); + public static VillageComponentCustomCropField buildComponent(List pieces, int p1, int p2, int p3, EnumFacing p4){ + StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, X_SIZE, Y_SIZE, Z_SIZE, p4); return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentCustomCropField(boundingBox, p4) : null; } @@ -43,16 +53,16 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous if(this.averageGroundLevel < 0){ return true; } - this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+ySize-1, 0); + this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+Y_SIZE-1, 0); } - this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.air); + this.fillWithBlocks(world, sbb, 0, 0, 0, X_SIZE-1, Y_SIZE-1, Z_SIZE-1, Blocks.AIR); this.spawnActualHouse(world, rand, sbb); - for(int i = 0; i < xSize; i++){ - for(int j = 0; j < zSize; j++){ - this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb); - this.func_151554_b(world, Blocks.dirt, 0, i, -1, j, sbb); + for(int i = 0; i < X_SIZE; i++){ + for(int j = 0; j < Z_SIZE; j++){ + this.clearCurrentPositionBlocksUpwards(world, i, Y_SIZE, j, sbb); + this.replaceAirAndLiquidDownwards(world, Blocks.DIRT.getDefaultState(), i, -1, j, sbb); } } @@ -60,44 +70,45 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous } public void fillWithBlocks(World world, StructureBoundingBox sbb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block){ - this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block, block, false); + this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block.getDefaultState(), block.getDefaultState(), false); } public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){ - this.fillWithBlocks(world, sbb, 1, 0, 1, 2, 0, 7, Blocks.farmland); - this.fillWithBlocks(world, sbb, 4, 0, 1, 5, 0, 7, Blocks.farmland); - this.fillWithBlocks(world, sbb, 7, 0, 1, 8, 0, 7, Blocks.farmland); - this.fillWithBlocks(world, sbb, 10, 0, 1, 11, 0, 7, Blocks.farmland); - this.fillWithBlocks(world, sbb, 0, 0, 0, 0, 0, 8, Blocks.log); - this.fillWithBlocks(world, sbb, 6, 0, 0, 6, 0, 8, Blocks.log); - this.fillWithBlocks(world, sbb, 12, 0, 0, 12, 0, 8, Blocks.log); - this.fillWithBlocks(world, sbb, 1, 0, 0, 11, 0, 0, Blocks.log); - this.fillWithBlocks(world, sbb, 1, 0, 8, 11, 0, 8, Blocks.log); - this.fillWithBlocks(world, sbb, 3, 0, 1, 3, 0, 7, Blocks.water); - this.fillWithBlocks(world, sbb, 9, 0, 1, 9, 0, 7, Blocks.water); + this.fillWithBlocks(world, sbb, 1, 0, 1, 2, 0, 7, Blocks.FARMLAND); + this.fillWithBlocks(world, sbb, 4, 0, 1, 5, 0, 7, Blocks.FARMLAND); + this.fillWithBlocks(world, sbb, 7, 0, 1, 8, 0, 7, Blocks.FARMLAND); + this.fillWithBlocks(world, sbb, 10, 0, 1, 11, 0, 7, Blocks.FARMLAND); + this.fillWithBlocks(world, sbb, 0, 0, 0, 0, 0, 8, Blocks.LOG); + this.fillWithBlocks(world, sbb, 6, 0, 0, 6, 0, 8, Blocks.LOG); + this.fillWithBlocks(world, sbb, 12, 0, 0, 12, 0, 8, Blocks.LOG); + this.fillWithBlocks(world, sbb, 1, 0, 0, 11, 0, 0, Blocks.LOG); + this.fillWithBlocks(world, sbb, 1, 0, 8, 11, 0, 8, Blocks.LOG); + this.fillWithBlocks(world, sbb, 3, 0, 1, 3, 0, 7, Blocks.WATER); + this.fillWithBlocks(world, sbb, 9, 0, 1, 9, 0, 7, Blocks.WATER); for(int i = 1; i <= 7; ++i){ - this.placeBlockAtCurrentPosition(world, this.getRandomCropType(rand), MathHelper.getRandomIntegerInRange(rand, 1, 7), 1, 1, i, sbb); - this.placeBlockAtCurrentPosition(world, this.getRandomCropType(rand), MathHelper.getRandomIntegerInRange(rand, 1, 7), 2, 1, i, sbb); - this.placeBlockAtCurrentPosition(world, this.getRandomCropType(rand), MathHelper.getRandomIntegerInRange(rand, 1, 7), 4, 1, i, sbb); - this.placeBlockAtCurrentPosition(world, this.getRandomCropType(rand), MathHelper.getRandomIntegerInRange(rand, 1, 7), 5, 1, i, sbb); - this.placeBlockAtCurrentPosition(world, this.getRandomCropType(rand), MathHelper.getRandomIntegerInRange(rand, 1, 7), 7, 1, i, sbb); - this.placeBlockAtCurrentPosition(world, this.getRandomCropType(rand), MathHelper.getRandomIntegerInRange(rand, 1, 7), 8, 1, i, sbb); - this.placeBlockAtCurrentPosition(world, this.getRandomCropType(rand), MathHelper.getRandomIntegerInRange(rand, 1, 7), 10, 1, i, sbb); - this.placeBlockAtCurrentPosition(world, this.getRandomCropType(rand), MathHelper.getRandomIntegerInRange(rand, 1, 7), 11, 1, i, sbb); + this.setBlockState(world, this.getRandomCropType(rand), 1, 1, i, sbb); + this.setBlockState(world, this.getRandomCropType(rand), 2, 1, i, sbb); + this.setBlockState(world, this.getRandomCropType(rand), 4, 1, i, sbb); + this.setBlockState(world, this.getRandomCropType(rand), 5, 1, i, sbb); + this.setBlockState(world, this.getRandomCropType(rand), 7, 1, i, sbb); + this.setBlockState(world, this.getRandomCropType(rand), 8, 1, i, sbb); + this.setBlockState(world, this.getRandomCropType(rand), 10, 1, i, sbb); + this.setBlockState(world, this.getRandomCropType(rand), 11, 1, i, sbb); } } - private Block getRandomCropType(Random rand){ + private IBlockState getRandomCropType(Random rand){ + int randomMeta = MathHelper.getRandomIntegerInRange(rand, 1, 7); switch(rand.nextInt(4)){ case 0: - return InitBlocks.blockFlax; + return InitBlocks.blockFlax.getStateFromMeta(randomMeta); case 1: - return InitBlocks.blockCoffee; + return InitBlocks.blockCoffee.getStateFromMeta(randomMeta); case 2: - return InitBlocks.blockRice; + return InitBlocks.blockRice.getStateFromMeta(randomMeta); default: - return InitBlocks.blockCanola; + return InitBlocks.blockCanola.getStateFromMeta(randomMeta); } - }*/ + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentJamHouse.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentJamHouse.java index 7fe2d8b9e..2ce2f0e6e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentJamHouse.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentJamHouse.java @@ -1,38 +1,46 @@ /* - * This file ("VillageComponentJamHouse.java") is part of the Actually Additions Mod for Minecraft. + * This file ("VillageComponentJamHouse.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.gen; +import net.minecraft.block.*; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; import net.minecraft.world.gen.structure.StructureVillagePieces; +import java.util.List; +import java.util.Random; + public class VillageComponentJamHouse extends StructureVillagePieces.House1{ - private static final int xSize = 11; - private static final int ySize = 8; - private static final int zSize = 12; + private static final int X_SIZE = 11; + private static final int Y_SIZE = 8; + private static final int Z_SIZE = 12; private int averageGroundLevel = -1; - @SuppressWarnings("unused") public VillageComponentJamHouse(){ } - //TODO Fix village - /*public VillageComponentJamHouse(StructureBoundingBox boundingBox, int par5){ - this.coordBaseMode = par5; + public VillageComponentJamHouse(StructureBoundingBox boundingBox, EnumFacing par5){ + this.setCoordBaseMode(par5); this.boundingBox = boundingBox; } - public static VillageComponentJamHouse buildComponent(List pieces, int p1, int p2, int p3, int p4){ - StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, xSize, ySize, zSize, p4); + public static VillageComponentJamHouse buildComponent(List pieces, int p1, int p2, int p3, EnumFacing p4){ + StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, X_SIZE, Y_SIZE, Z_SIZE, p4); return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentJamHouse(boundingBox, p4) : null; } @@ -43,16 +51,16 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ if(this.averageGroundLevel < 0){ return true; } - this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+ySize-1, 0); + this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+Y_SIZE-1, 0); } - this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.air); + this.fillWithBlocks(world, sbb, 0, 0, 0, X_SIZE-1, Y_SIZE-1, Z_SIZE-1, Blocks.AIR); this.spawnActualHouse(world, rand, sbb); - for(int i = 0; i < xSize; i++){ - for(int j = 0; j < zSize; j++){ - this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb); - this.func_151554_b(world, Blocks.cobblestone, 0, i, -1, j, sbb); + for(int i = 0; i < X_SIZE; i++){ + for(int j = 0; j < Z_SIZE; j++){ + this.clearCurrentPositionBlocksUpwards(world, i, Y_SIZE, j, sbb); + this.replaceAirAndLiquidDownwards(world, Blocks.COBBLESTONE.getDefaultState(), i, -1, j, sbb); } } @@ -62,131 +70,133 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ } public void fillWithBlocks(World world, StructureBoundingBox sbb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block){ - this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block, block, false); + this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block.getDefaultState(), block.getDefaultState(), false); } public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){ //Base - this.fillWithBlocks(world, sbb, 1, 0, 8, 9, 0, 10, Blocks.grass); - this.fillWithBlocks(world, sbb, 0, 0, 0, 1, 0, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 2, 0, 0, 4, 0, 1, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 9, 0, 0, 10, 0, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 6, 0, 0, 8, 0, 1, Blocks.cobblestone); - this.placeBlockAtCurrentPosition(world, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 5, 0, 0, sbb); - this.fillWithBlocks(world, sbb, 2, 0, 7, 3, 0, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 5, 0, 7, 8, 0, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 10, 0, 8, 10, 0, 11, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 0, 0, 8, 0, 0, 11, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 0, 0, 11, 10, 0, 11, Blocks.cobblestone); - this.fillWithMetadataBlocks(world, sbb, 2, 0, 2, 8, 0, 6, Blocks.planks, 1, Blocks.planks, 1, false); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 1, 5, 0, 1, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 1, 4, 0, 7, sbb); + this.fillWithBlocks(world, sbb, 1, 0, 8, 9, 0, 10, Blocks.GRASS); + this.fillWithBlocks(world, sbb, 0, 0, 0, 1, 0, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 2, 0, 0, 4, 0, 1, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 9, 0, 0, 10, 0, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 6, 0, 0, 8, 0, 1, Blocks.COBBLESTONE); + this.setBlockState(world, Blocks.STONE_STAIRS.getStateFromMeta(3), 5, 0, 0, sbb); + this.fillWithBlocks(world, sbb, 2, 0, 7, 3, 0, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 5, 0, 7, 8, 0, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 10, 0, 8, 10, 0, 11, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 0, 0, 8, 0, 0, 11, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 0, 0, 11, 10, 0, 11, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 2, 0, 2, 8, 0, 6, Blocks.PLANKS.getStateFromMeta(1), Blocks.PLANKS.getStateFromMeta(1), false); + this.setBlockState(world, Blocks.PLANKS.getStateFromMeta(1), 5, 0, 1, sbb); + this.setBlockState(world, Blocks.PLANKS.getStateFromMeta(1), 4, 0, 7, sbb); - //Garden Fence - this.fillWithBlocks(world, sbb, 0, 1, 8, 0, 1, 11, Blocks.fence); - this.fillWithBlocks(world, sbb, 10, 1, 8, 10, 1, 11, Blocks.fence); - this.fillWithBlocks(world, sbb, 1, 1, 11, 9, 1, 11, Blocks.fence); + //Garden FENCE + this.fillWithBlocks(world, sbb, 0, 1, 8, 0, 1, 11, Blocks.OAK_FENCE); + this.fillWithBlocks(world, sbb, 10, 1, 8, 10, 1, 11, Blocks.OAK_FENCE); + this.fillWithBlocks(world, sbb, 1, 1, 11, 9, 1, 11, Blocks.OAK_FENCE); //Side Walls for(int i = 0; i < 2; i++){ - this.fillWithBlocks(world, sbb, 1+i*8, 1, 1, 1+i*8, 1, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 1+i*8, 1, 1, 1+i*8, 4, 1, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 1+i*8, 1, 7, 1+i*8, 4, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 1+i*8, 4, 2, 1+i*8, 5, 6, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 1+i*8, 3, 2, 1+i*8, 3, 6, Blocks.planks); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i*8, 2, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i*8, 2, 6, sbb); - this.fillWithBlocks(world, sbb, 1+i*8, 2, 3, 1+i*8, 2, 5, Blocks.glass_pane); + this.fillWithBlocks(world, sbb, 1+i*8, 1, 1, 1+i*8, 1, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 1+i*8, 1, 1, 1+i*8, 4, 1, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 1+i*8, 1, 7, 1+i*8, 4, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 1+i*8, 4, 2, 1+i*8, 5, 6, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 1+i*8, 3, 2, 1+i*8, 3, 6, Blocks.PLANKS); + this.setBlockState(world, Blocks.PLANKS.getStateFromMeta(0), 1+i*8, 2, 2, sbb); + this.setBlockState(world, Blocks.PLANKS.getStateFromMeta(0), 1+i*8, 2, 6, sbb); + this.fillWithBlocks(world, sbb, 1+i*8, 2, 3, 1+i*8, 2, 5, Blocks.GLASS_PANE); } //Front Wall - this.fillWithBlocks(world, sbb, 7, 1, 1, 8, 4, 1, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 2, 1, 1, 3, 4, 1, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 4, 4, 1, 7, 4, 1, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 6, 1, 1, 6, 3, 1, Blocks.planks); - this.fillWithBlocks(world, sbb, 4, 1, 1, 4, 3, 1, Blocks.planks); - this.fillWithBlocks(world, sbb, 5, 3, 1, 5, 3, 1, Blocks.planks); - this.placeDoorAtCurrentPosition(world, sbb, rand, 5, 1, 1, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + this.fillWithBlocks(world, sbb, 7, 1, 1, 8, 4, 1, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 2, 1, 1, 3, 4, 1, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 4, 4, 1, 7, 4, 1, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 6, 1, 1, 6, 3, 1, Blocks.PLANKS); + this.fillWithBlocks(world, sbb, 4, 1, 1, 4, 3, 1, Blocks.PLANKS); + this.fillWithBlocks(world, sbb, 5, 3, 1, 5, 3, 1, Blocks.PLANKS); + this.setBlockState(world, Blocks.SPRUCE_DOOR.getDefaultState(), 5, 1, 1, sbb); + this.setBlockState(world, Blocks.SPRUCE_DOOR.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 5, 2, 1, sbb); + //Back Wall - this.fillWithBlocks(world, sbb, 2, 1, 7, 2, 4, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 3, 1, 7, 3, 3, 7, Blocks.planks); - this.fillWithBlocks(world, sbb, 4, 3, 7, 8, 3, 7, Blocks.planks); - this.fillWithBlocks(world, sbb, 3, 4, 7, 8, 4, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 5, 1, 7, 5, 2, 7, Blocks.planks); - this.fillWithBlocks(world, sbb, 6, 1, 7, 8, 1, 7, Blocks.cobblestone); - this.fillWithBlocks(world, sbb, 6, 2, 7, 7, 2, 7, Blocks.glass_pane); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 8, 2, 7, sbb); - this.placeDoorAtCurrentPosition(world, sbb, rand, 4, 1, 7, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + this.fillWithBlocks(world, sbb, 2, 1, 7, 2, 4, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 3, 1, 7, 3, 3, 7, Blocks.PLANKS); + this.fillWithBlocks(world, sbb, 4, 3, 7, 8, 3, 7, Blocks.PLANKS); + this.fillWithBlocks(world, sbb, 3, 4, 7, 8, 4, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 5, 1, 7, 5, 2, 7, Blocks.PLANKS); + this.fillWithBlocks(world, sbb, 6, 1, 7, 8, 1, 7, Blocks.COBBLESTONE); + this.fillWithBlocks(world, sbb, 6, 2, 7, 7, 2, 7, Blocks.GLASS_PANE); + this.setBlockState(world, Blocks.PLANKS.getStateFromMeta(0), 8, 2, 7, sbb); + this.setBlockState(world, Blocks.SPRUCE_DOOR.getDefaultState().withProperty(BlockDoor.FACING, EnumFacing.SOUTH), 4, 1, 7, sbb); + this.setBlockState(world, Blocks.SPRUCE_DOOR.getDefaultState().withProperty(BlockDoor.FACING, EnumFacing.SOUTH).withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER), 4, 2, 7, sbb); - //Fence Supports - this.fillWithBlocks(world, sbb, 0, 1, 8, 0, 3, 8, Blocks.fence); - this.fillWithBlocks(world, sbb, 10, 1, 8, 10, 3, 8, Blocks.fence); - this.fillWithBlocks(world, sbb, 0, 1, 0, 0, 3, 0, Blocks.fence); - this.fillWithBlocks(world, sbb, 10, 1, 0, 10, 3, 0, Blocks.fence); + //FENCE Supports + this.fillWithBlocks(world, sbb, 0, 1, 8, 0, 3, 8, Blocks.OAK_FENCE); + this.fillWithBlocks(world, sbb, 10, 1, 8, 10, 3, 8, Blocks.OAK_FENCE); + this.fillWithBlocks(world, sbb, 0, 1, 0, 0, 3, 0, Blocks.OAK_FENCE); + this.fillWithBlocks(world, sbb, 10, 1, 0, 10, 3, 0, Blocks.OAK_FENCE); //Roof - this.fillWithBlocks(world, sbb, 1, 6, 3, 9, 6, 5, Blocks.planks); - this.fillWithMetadataBlocks(world, sbb, 0, 4, 0, 10, 4, 0, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), false); - this.fillWithMetadataBlocks(world, sbb, 0, 5, 1, 10, 5, 1, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), false); - this.fillWithMetadataBlocks(world, sbb, 0, 6, 2, 10, 6, 2, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), false); - this.fillWithMetadataBlocks(world, sbb, 0, 4, 8, 10, 4, 8, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), false); - this.fillWithMetadataBlocks(world, sbb, 0, 5, 7, 10, 5, 7, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), false); - this.fillWithMetadataBlocks(world, sbb, 0, 6, 6, 10, 6, 6, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), false); - this.fillWithBlocks(world, sbb, 0, 7, 3, 10, 7, 5, Blocks.wooden_slab); + this.fillWithBlocks(world, sbb, 1, 6, 3, 9, 6, 5, Blocks.PLANKS); + IBlockState stairSouth = Blocks.OAK_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.SOUTH); + IBlockState stairNorth = Blocks.OAK_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.NORTH); + this.fillWithBlocks(world, sbb, 0, 4, 0, 10, 4, 0, stairNorth, stairNorth, false); + this.fillWithBlocks(world, sbb, 0, 5, 1, 10, 5, 1, stairNorth, stairNorth, false); + this.fillWithBlocks(world, sbb, 0, 6, 2, 10, 6, 2, stairNorth, stairNorth, false); + this.fillWithBlocks(world, sbb, 0, 4, 8, 10, 4, 8, stairSouth, stairSouth, false); + this.fillWithBlocks(world, sbb, 0, 5, 7, 10, 5, 7, stairSouth, stairSouth, false); + this.fillWithBlocks(world, sbb, 0, 6, 6, 10, 6, 6, stairSouth, stairSouth, false); + this.fillWithBlocks(world, sbb, 0, 7, 3, 10, 7, 5, Blocks.WOODEN_SLAB); //Roof Gadgets - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 0, 4, 1, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 0, 5, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 10, 4, 1, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 10, 5, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 0, 4, 7, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 0, 5, 6, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 10, 4, 7, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 10, 5, 6, sbb); - this.fillWithBlocks(world, sbb, 0, 6, 3, 0, 6, 5, Blocks.planks); - this.fillWithBlocks(world, sbb, 10, 6, 3, 10, 6, 5, Blocks.planks); + this.setBlockState(world, Blocks.PLANKS.getDefaultState(), 0, 4, 1, sbb); + this.setBlockState(world, Blocks.PLANKS.getDefaultState(), 0, 5, 2, sbb); + this.setBlockState(world, Blocks.PLANKS.getDefaultState(), 10, 4, 1, sbb); + this.setBlockState(world, Blocks.PLANKS.getDefaultState(), 10, 5, 2, sbb); + this.setBlockState(world, Blocks.PLANKS.getDefaultState(), 0, 4, 7, sbb); + this.setBlockState(world, Blocks.PLANKS.getDefaultState(), 0, 5, 6, sbb); + this.setBlockState(world, Blocks.PLANKS.getDefaultState(), 10, 4, 7, sbb); + this.setBlockState(world, Blocks.PLANKS.getDefaultState(), 10, 5, 6, sbb); + this.fillWithBlocks(world, sbb, 0, 6, 3, 0, 6, 5, Blocks.PLANKS); + this.fillWithBlocks(world, sbb, 10, 6, 3, 10, 6, 5, Blocks.PLANKS); //Counter - this.fillWithMetadataBlocks(world, sbb, 6, 3, 2, 6, 3, 4, Blocks.wooden_slab, 8, Blocks.wooden_slab, 8, false); - this.fillWithMetadataBlocks(world, sbb, 5, 3, 4, 5, 3, 6, Blocks.wooden_slab, 8, Blocks.wooden_slab, 8, false); - this.fillWithBlocks(world, sbb, 6, 1, 2, 6, 1, 4, Blocks.planks); - this.fillWithBlocks(world, sbb, 5, 1, 4, 5, 1, 5, Blocks.planks); - this.fillWithBlocks(world, sbb, 6, 4, 2, 6, 5, 2, Blocks.fence); - this.fillWithBlocks(world, sbb, 5, 4, 4, 5, 5, 4, Blocks.fence); - this.fillWithBlocks(world, sbb, 5, 4, 6, 5, 5, 6, Blocks.fence); + this.fillWithBlocks(world, sbb, 6, 3, 2, 6, 3, 4, Blocks.WOODEN_SLAB.getStateFromMeta(8), Blocks.WOODEN_SLAB.getStateFromMeta(8), false); + this.fillWithBlocks(world, sbb, 5, 3, 4, 5, 3, 6, Blocks.WOODEN_SLAB.getStateFromMeta(8), Blocks.WOODEN_SLAB.getStateFromMeta(8), false); + this.fillWithBlocks(world, sbb, 6, 1, 2, 6, 1, 4, Blocks.PLANKS); + this.fillWithBlocks(world, sbb, 5, 1, 4, 5, 1, 5, Blocks.PLANKS); + this.fillWithBlocks(world, sbb, 6, 4, 2, 6, 5, 2, Blocks.OAK_FENCE); + this.fillWithBlocks(world, sbb, 5, 4, 4, 5, 5, 4, Blocks.OAK_FENCE); + this.fillWithBlocks(world, sbb, 5, 4, 6, 5, 5, 6, Blocks.OAK_FENCE); //Decoration - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 1, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.leaves, 0, 2, 2, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 8, 1, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.leaves, 0, 8, 2, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 1, 6, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.leaves, 0, 2, 2, 6, sbb); - this.fillWithMetadataBlocks(world, sbb, 2, 1, 3, 2, 1, 5, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 1), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 1), false); - this.fillWithMetadataBlocks(world, sbb, 3, 1, 2, 5, 1, 3, Blocks.carpet, 10, Blocks.carpet, 10, false); - this.fillWithMetadataBlocks(world, sbb, 3, 1, 4, 4, 1, 6, Blocks.carpet, 10, Blocks.carpet, 10, false); + this.setBlockState(world, Blocks.OAK_FENCE.getDefaultState(), 2, 1, 2, sbb); + this.setBlockState(world, Blocks.LEAVES.getDefaultState().withProperty(BlockLeaves.DECAYABLE, false), 2, 2, 2, sbb); + this.setBlockState(world, Blocks.OAK_FENCE.getDefaultState(), 8, 1, 2, sbb); + this.setBlockState(world, Blocks.LEAVES.getDefaultState().withProperty(BlockLeaves.DECAYABLE, false), 8, 2, 2, sbb); + this.setBlockState(world, Blocks.OAK_FENCE.getDefaultState(), 2, 1, 6, sbb); + this.setBlockState(world, Blocks.LEAVES.getDefaultState().withProperty(BlockLeaves.DECAYABLE, false), 2, 2, 6, sbb); + IBlockState stairWest = Blocks.OAK_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, EnumFacing.WEST); + this.fillWithBlocks(world, sbb, 2, 1, 3, 2, 1, 5, stairWest, stairWest, false); + this.fillWithBlocks(world, sbb, 3, 1, 2, 5, 1, 3, Blocks.CARPET.getStateFromMeta(10), Blocks.CARPET.getStateFromMeta(10), false); + this.fillWithBlocks(world, sbb, 3, 1, 4, 4, 1, 6, Blocks.CARPET.getStateFromMeta(10), Blocks.CARPET.getStateFromMeta(10), false); //Loot Chest - this.placeBlockAtCurrentPosition(world, Blocks.chest, 0, 8, 1, 6, sbb); - TileEntity chest = world.getTileEntity(this.getXWithOffset(8, 6), this.getYWithOffset(1), this.getZWithOffset(8, 6)); - if(chest != null && chest instanceof TileEntityChest){ + this.setBlockState(world, Blocks.CHEST.getDefaultState(), 8, 1, 6, sbb); + //TileEntity chest = world.getTileEntity(new BlockPos(this.getXWithOffset(8, 6), this.getYWithOffset(1), this.getZWithOffset(8, 6))); + //TODO Chest content + /*if(chest != null && chest instanceof TileEntityChest){ WeightedRandomChestContent.generateChestContents(rand, ChestGenHooks.getItems(InitVillager.JAM_HOUSE_CHEST_NAME, rand), (TileEntityChest)chest, ChestGenHooks.getCount(InitVillager.JAM_HOUSE_CHEST_NAME, rand)); - } + }*/ //Torches - this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 2, 0, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 4, 2, 0, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 2, 8, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 2, 8, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 2, 3, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 2, 3, 6, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 8, 3, 2, sbb); - this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 8, 3, 6, sbb); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.SOUTH), 6, 2, 0, sbb); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.SOUTH), 4, 2, 0, sbb); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.NORTH), 5, 2, 8, sbb); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.NORTH), 3, 2, 8, sbb); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.EAST), 2, 3, 2, sbb); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.EAST), 2, 3, 6, sbb); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.WEST), 8, 3, 2, sbb); + this.setBlockState(world, Blocks.TORCH.getDefaultState().withProperty(BlockTorch.FACING, EnumFacing.WEST), 8, 3, 6, sbb); } - - @Override - protected int getVillagerType(int par1){ - return ConfigIntValues.JAM_VILLAGER_ID.getValue(); - }*/ } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageCustomCropFieldHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageCustomCropFieldHandler.java index f5d6af12d..198e85d57 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageCustomCropFieldHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageCustomCropFieldHandler.java @@ -1,22 +1,24 @@ /* - * This file ("VillageCustomCropFieldHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("VillageCustomCropFieldHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.gen; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.gen.structure.StructureComponent; import net.minecraft.world.gen.structure.StructureVillagePieces; import net.minecraftforge.fml.common.registry.VillagerRegistry; +import java.util.List; import java.util.Random; -//TODO Fix village -public abstract class VillageCustomCropFieldHandler implements VillagerRegistry.IVillageCreationHandler{ +public class VillageCustomCropFieldHandler implements VillagerRegistry.IVillageCreationHandler{ @Override public StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int i){ @@ -28,8 +30,8 @@ public abstract class VillageCustomCropFieldHandler implements VillagerRegistry. return VillageComponentCustomCropField.class; } - /*@Override - public Object buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5){ - return VillageComponentCustomCropField.buildComponent(pieces, p1, p2, p3, p4); - }*/ + @Override + public StructureVillagePieces.Village buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5){ + return VillageComponentCustomCropField.buildComponent(pieces, p1, p2, p3, facing); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageJamHouseHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageJamHouseHandler.java index f847cdd2a..ac2809b31 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageJamHouseHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageJamHouseHandler.java @@ -1,22 +1,24 @@ /* - * This file ("VillageJamHouseHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("VillageJamHouseHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.gen; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.gen.structure.StructureComponent; import net.minecraft.world.gen.structure.StructureVillagePieces; import net.minecraftforge.fml.common.registry.VillagerRegistry; +import java.util.List; import java.util.Random; -//TODO Fix village -public abstract class VillageJamHouseHandler implements VillagerRegistry.IVillageCreationHandler{ +public class VillageJamHouseHandler implements VillagerRegistry.IVillageCreationHandler{ @Override public StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int i){ @@ -28,8 +30,8 @@ public abstract class VillageJamHouseHandler implements VillagerRegistry.IVillag return VillageComponentJamHouse.class; } - /*@Override - public Object buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5){ - return VillageComponentJamHouse.buildComponent(pieces, p1, p2, p3, p4); - }*/ + @Override + public StructureVillagePieces.Village buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5){ + return VillageComponentJamHouse.buildComponent(pieces, p1, p2, p3, facing); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java new file mode 100644 index 000000000..4b1dba16c --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java @@ -0,0 +1,100 @@ +/* + * This file ("WorldGenLushCaves.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.gen; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.*; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; + +public class WorldGenLushCaves extends WorldGenerator{ + + @Override + public boolean generate(World world, Random rand, BlockPos position){ + this.generateCave(world, position, rand); + return true; + } + + private void generateCave(World world, BlockPos center, Random rand){ + int spheres = rand.nextInt(5)+3; + for(int i = 0; i <= spheres; i++){ + this.makeSphereWithGrassFloor(world, center.add(rand.nextInt(11)-5, rand.nextInt(7)-3, rand.nextInt(11)-5), rand.nextInt(3)+5); + } + + this.genTreesAndTallGrass(world, center, 10, spheres*3, rand); + } + + private void genTreesAndTallGrass(World world, BlockPos center, int radius, int amount, Random rand){ + List possiblePoses = new ArrayList(); + for(double x = -radius; x < radius; x++){ + for(double y = -radius; y < radius; y++){ + for(double z = -radius; z < radius; z++){ + if(rand.nextDouble() >= 0.5D){ + BlockPos pos = center.add(x, y, z); + if(world.getBlockState(pos).getBlock() == Blocks.GRASS){ + possiblePoses.add(pos); + } + } + } + } + } + + if(!possiblePoses.isEmpty()){ + for(int i = 0; i <= amount; i++){ + Collections.shuffle(possiblePoses); + BlockPos pos = possiblePoses.get(0); + if(rand.nextBoolean()){ + WorldGenAbstractTree trees = rand.nextBoolean() ? (rand.nextBoolean() ? new WorldGenBigTree(false) : new WorldGenShrub(Blocks.LOG.getDefaultState(), Blocks.LEAVES.getDefaultState())) : new WorldGenTrees(false); + trees.generate(world, rand, pos.up()); + } + else{ + Blocks.GRASS.grow(world, rand, pos, world.getBlockState(pos)); + } + } + } + } + + private void makeSphereWithGrassFloor(World world, BlockPos center, int radius){ + for(double x = -radius; x < radius; x++){ + for(double y = -radius; y < radius; y++){ + for(double z = -radius; z < radius; z++){ + if(Math.sqrt((x*x)+(y*y)+(z*z)) < radius){ + world.setBlockToAir(center.add(x, y, z)); + } + } + } + } + + for(double x = -radius; x < radius; x++){ + for(double z = -radius; z < radius; z++){ + for(double y = -radius; y <= -3; y++){ + BlockPos pos = center.add(x, y, z); + IBlockState state = world.getBlockState(pos); + BlockPos posUp = pos.up(); + IBlockState stateUp = world.getBlockState(posUp); + if(!state.getBlock().isAir(state, world, pos) && stateUp.getBlock().isAir(stateUp, world, posUp)){ + world.setBlockState(pos, Blocks.GRASS.getDefaultState()); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java index 35e952d42..d32505358 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java @@ -1,28 +1,27 @@ /* - * This file ("ContainerBreaker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerBreaker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerBreaker extends Container{ - private TileEntityBreaker breaker; + private final TileEntityBreaker breaker; public ContainerBreaker(InventoryPlayer inventory, TileEntityBase tile){ this.breaker = (TileEntityBreaker)tile; @@ -45,12 +44,12 @@ public class ContainerBreaker extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -75,7 +74,7 @@ public class ContainerBreaker extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java index dc636f81f..0fa580100 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java @@ -1,41 +1,34 @@ /* - * This file ("ContainerCanolaPress.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerCanolaPress.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -@InventoryContainer + public class ContainerCanolaPress extends Container{ - private TileEntityCanolaPress press; + private final TileEntityCanolaPress press; public ContainerCanolaPress(InventoryPlayer inventory, TileEntityBase tile){ this.press = (TileEntityCanolaPress)tile; this.addSlotToContainer(new Slot(this.press, 0, 81, 10)); - this.addSlotToContainer(new Slot(this.press, 1, 136, 73)); - this.addSlotToContainer(new SlotOutput(this.press, 2, 136, 42)); for(int i = 0; i < 3; i++){ for(int j = 0; j < 9; j++){ @@ -49,12 +42,12 @@ public class ContainerCanolaPress extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 3; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -68,11 +61,6 @@ public class ContainerCanolaPress extends Container{ return null; } } - else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitFluids.fluidCanolaOil, 1), newStack) > 0){ - if(!this.mergeItemStack(newStack, 1, 2, false)){ - return null; - } - } // else if(slot >= inventoryStart && slot <= inventoryEnd){ @@ -88,7 +76,7 @@ public class ContainerCanolaPress extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java index 6c7dacdfa..ac31b4c08 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java @@ -1,18 +1,17 @@ /* - * This file ("ContainerCoalGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerCoalGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -20,10 +19,10 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityFurnace; -@InventoryContainer + public class ContainerCoalGenerator extends Container{ - private TileEntityCoalGenerator generator; + private final TileEntityCoalGenerator generator; public ContainerCoalGenerator(InventoryPlayer inventory, TileEntityBase tile){ this.generator = (TileEntityCoalGenerator)tile; @@ -42,12 +41,12 @@ public class ContainerCoalGenerator extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -76,7 +75,7 @@ public class ContainerCoalGenerator extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java index d9e5a4824..6a3235757 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerCoffeeMachine.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerCoffeeMachine.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -16,37 +16,30 @@ import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -@InventoryContainer + public class ContainerCoffeeMachine extends Container{ - private TileEntityCoffeeMachine machine; + private final TileEntityCoffeeMachine machine; public ContainerCoffeeMachine(InventoryPlayer inventory, TileEntityBase tile){ this.machine = (TileEntityCoffeeMachine)tile; - this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, 37, 6)); - this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_INPUT, 80, 42)); - this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_OUTPUT, 80, 73)); + this.addSlotToContainer(new Slot(this.machine, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, 37, 6)); + this.addSlotToContainer(new Slot(this.machine, TileEntityCoffeeMachine.SLOT_INPUT, 80, 42)); + this.addSlotToContainer(new SlotOutput(this.machine, TileEntityCoffeeMachine.SLOT_OUTPUT, 80, 73)); for(int i = 0; i < 4; i++){ for(int j = 0; j < 2; j++){ - this.addSlotToContainer(new Slot(machine, j+i*2+3, 125+j*18, 6+i*18)); + this.addSlotToContainer(new Slot(this.machine, j+i*2+3, 125+j*18, 6+i*18)); } } - this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_WATER_INPUT, 26, 73)); - this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_WATER_OUTPUT, 45, 73)); - for(int i = 0; i < 3; i++){ for(int j = 0; j < 9; j++){ this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); @@ -59,12 +52,12 @@ public class ContainerCoffeeMachine extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 13; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 11; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -85,11 +78,6 @@ public class ContainerCoffeeMachine extends Container{ return null; } } - else if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(FluidRegistry.WATER, 1))){ - if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_WATER_INPUT, TileEntityCoffeeMachine.SLOT_WATER_INPUT+1, false)){ - return null; - } - } else if(ItemCoffee.getIngredientFromStack(newStack) != null){ if(!this.mergeItemStack(newStack, 3, 11, false)){ return null; @@ -115,7 +103,7 @@ public class ContainerCoffeeMachine extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java index 25c9dc220..347630639 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java @@ -1,16 +1,16 @@ /* - * This file ("ContainerCrafter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerCrafter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; -import invtweaks.api.container.InventoryContainer; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.*; @@ -18,23 +18,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.world.World; -@InventoryContainer + public class ContainerCrafter extends Container{ - public final int x; - public final int y; - public final int z; public final World world; - public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); - public IInventory craftResult = new InventoryCraftResult(); + public final InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); + public final IInventory craftResult = new InventoryCraftResult(); public ContainerCrafter(EntityPlayer player){ InventoryPlayer inventory = player.inventory; this.world = player.worldObj; - this.x = (int)player.posX; - this.y = (int)player.posY; - this.z = (int)player.posZ; this.addSlotToContainer(new SlotCrafting(inventory.player, this.craftMatrix, this.craftResult, 0, 124, 35)); for(int i = 0; i < 3; i++){ @@ -56,44 +50,55 @@ public class ContainerCrafter extends Container{ } @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - ItemStack stack = null; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + public ItemStack transferStackInSlot(EntityPlayer player, int index){ + ItemStack itemstack = null; + Slot slot = this.inventorySlots.get(index); - if(theSlot != null && theSlot.getHasStack()){ - ItemStack savedStack = theSlot.getStack(); - stack = savedStack.copy(); + if(slot != null && slot.getHasStack()){ + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); - if(slot == 0){ - if(!this.mergeItemStack(savedStack, 10, 46, true)){ + if(index == 0){ + if(!this.mergeItemStack(itemstack1, 10, 46, true)){ return null; } - theSlot.onSlotChange(savedStack, stack); + + slot.onSlotChange(itemstack1, itemstack); } - else if(slot >= 10 && slot < 37 && !this.mergeItemStack(savedStack, 37, 46, false)){ - return null; + else if(index >= 10 && index < 37){ + if(!this.mergeItemStack(itemstack1, 37, 46, false)){ + return null; + } } - else if(slot >= 37 && slot < 46 && !this.mergeItemStack(savedStack, 10, 37, false)){ - return null; + else if(index >= 37 && index < 46){ + if(!this.mergeItemStack(itemstack1, 10, 37, false)){ + return null; + } } - else if(!this.mergeItemStack(savedStack, 10, 46, false)){ + else if(!this.mergeItemStack(itemstack1, 10, 46, false)){ return null; } - if(savedStack.stackSize == 0){ - theSlot.putStack(null); + if(itemstack1.stackSize <= 0){ + slot.putStack(null); } else{ - theSlot.onSlotChanged(); + slot.onSlotChanged(); } - if(savedStack.stackSize == stack.stackSize){ + if(itemstack1.stackSize == itemstack.stackSize){ return null; } - theSlot.onPickupFromSlot(player, savedStack); + slot.onPickupFromSlot(player, itemstack1); } - return stack; + + return itemstack; + } + + @Override + public boolean canMergeSlot(ItemStack stack, Slot slotIn){ + return slotIn.inventory != this.craftResult && super.canMergeSlot(stack, slotIn); } @Override @@ -104,7 +109,7 @@ public class ContainerCrafter extends Container{ for(int i = 0; i < 9; ++i){ ItemStack stack = this.craftMatrix.removeStackFromSlot(i); if(stack != null){ - player.dropPlayerItemWithRandomChoice(stack, false); + player.dropItem(stack, false); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java index 09523d780..31f567093 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java @@ -1,28 +1,27 @@ /* - * This file ("ContainerDirectionalBreaker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerDirectionalBreaker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerDirectionalBreaker extends Container{ - private TileEntityDirectionalBreaker breaker; + private final TileEntityDirectionalBreaker breaker; public ContainerDirectionalBreaker(InventoryPlayer inventory, TileEntityBase tile){ this.breaker = (TileEntityDirectionalBreaker)tile; @@ -45,12 +44,12 @@ public class ContainerDirectionalBreaker extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -75,7 +74,7 @@ public class ContainerDirectionalBreaker extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java index 17914bb9e..e0871a873 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerDrill.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerDrill.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -14,28 +14,29 @@ import cofh.api.energy.IEnergyContainerItem; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotImmovable; import de.ellpeck.actuallyadditions.mod.items.ItemDrill; import de.ellpeck.actuallyadditions.mod.items.ItemDrillUpgrade; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraft.util.IChatComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; + -@InventoryContainer public class ContainerDrill extends Container{ - private static final int SLOT_AMOUNT = 5; + public static final int SLOT_AMOUNT = 5; - private InventoryDrill drillInventory = new InventoryDrill(); - private InventoryPlayer inventory; + private final InventoryDrill drillInventory = new InventoryDrill(); + private final InventoryPlayer inventory; public ContainerDrill(InventoryPlayer inventory){ this.inventory = inventory; for(int i = 0; i < SLOT_AMOUNT; i++){ - this.addSlotToContainer(new Slot(drillInventory, i, 44+i*18, 19){ + this.addSlotToContainer(new Slot(this.drillInventory, i, 44+i*18, 19){ @Override public boolean isItemValid(ItemStack stack){ return stack.getItem() instanceof ItemDrillUpgrade || stack.getItem() instanceof IEnergyContainerItem; @@ -59,19 +60,16 @@ public class ContainerDrill extends Container{ ItemStack stack = inventory.getCurrentItem(); if(stack != null && stack.getItem() instanceof ItemDrill){ - ItemStack[] slots = ((ItemDrill)stack.getItem()).getSlotsFromNBT(inventory.getCurrentItem()); - if(slots != null && slots.length > 0){ - this.drillInventory.slots = slots; - } + ItemDrill.loadSlotsFromNBT(this.drillInventory.slots, inventory.getCurrentItem()); } } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 5; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 5; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); @@ -102,7 +100,7 @@ public class ContainerDrill extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ @@ -120,22 +118,20 @@ public class ContainerDrill extends Container{ } @Override - public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){ - //par3 appears to be the type of clicking - //par3 == 2 appears to be one of the number keys being hit - if(par3 == 2 && par2 == inventory.currentItem){ + public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){ + if(clickTypeIn == ClickType.SWAP && dragType == this.inventory.currentItem){ return null; } else{ - return super.slotClick(par1, par2, par3, player); + return super.slotClick(slotId, dragType, clickTypeIn, player); } } @Override public void onContainerClosed(EntityPlayer player){ - ItemStack stack = inventory.getCurrentItem(); + ItemStack stack = this.inventory.getCurrentItem(); if(stack != null && stack.getItem() instanceof ItemDrill){ - ((ItemDrill)stack.getItem()).writeSlotsToNBT(this.drillInventory.slots, inventory.getCurrentItem()); + ItemDrill.writeSlotsToNBT(this.drillInventory.slots, this.inventory.getCurrentItem()); } super.onContainerClosed(player); } @@ -154,16 +150,6 @@ public class ContainerDrill extends Container{ return "drill"; } - @Override - public boolean hasCustomName(){ - return false; - } - - @Override - public IChatComponent getDisplayName(){ - return null; - } - @Override public int getInventoryStackLimit(){ return 64; @@ -175,7 +161,22 @@ public class ContainerDrill extends Container{ } @Override - public boolean isItemValidForSlot(int slot, ItemStack stack){ + public boolean isUseableByPlayer(EntityPlayer player){ + return true; + } + + @Override + public void openInventory(EntityPlayer player){ + + } + + @Override + public void closeInventory(EntityPlayer player){ + + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack){ return true; } @@ -196,22 +197,8 @@ public class ContainerDrill extends Container{ @Override public void clear(){ - this.slots = new ItemStack[this.slots.length]; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player){ - return true; - } - - @Override - public void openInventory(EntityPlayer player){ - - } - - @Override - public void closeInventory(EntityPlayer player){ - + int length = this.slots.length; + this.slots = new ItemStack[length]; } @Override @@ -222,31 +209,31 @@ public class ContainerDrill extends Container{ @Override public int getSizeInventory(){ - return slots.length; + return this.slots.length; } @Override public ItemStack getStackInSlot(int i){ if(i < this.getSizeInventory()){ - return slots[i]; + return this.slots[i]; } return null; } @Override public ItemStack decrStackSize(int i, int j){ - if(slots[i] != null){ + if(this.slots[i] != null){ ItemStack stackAt; - if(slots[i].stackSize <= j){ - stackAt = slots[i]; - slots[i] = null; + if(this.slots[i].stackSize <= j){ + stackAt = this.slots[i]; + this.slots[i] = null; this.markDirty(); return stackAt; } else{ - stackAt = slots[i].splitStack(j); - if(slots[i].stackSize == 0){ - slots[i] = null; + stackAt = this.slots[i].splitStack(j); + if(this.slots[i].stackSize <= 0){ + this.slots[i] = null; } this.markDirty(); return stackAt; @@ -261,5 +248,16 @@ public class ContainerDrill extends Container{ this.slots[index] = null; return stack; } + + @Override + public boolean hasCustomName(){ + return false; + } + + + @Override + public ITextComponent getDisplayName(){ + return new TextComponentTranslation(this.getName()); + } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java index f6b268e0a..f6843b5b9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java @@ -1,28 +1,27 @@ /* - * This file ("ContainerDropper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerDropper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerDropper extends Container{ - private TileEntityDropper dropper; + private final TileEntityDropper dropper; public ContainerDropper(InventoryPlayer inventory, TileEntityBase tile){ this.dropper = (TileEntityDropper)tile; @@ -45,12 +44,12 @@ public class ContainerDropper extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -75,7 +74,7 @@ public class ContainerDropper extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java index d28356719..4f3382ad8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerEnergizer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerEnergizer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -14,22 +14,23 @@ import cofh.api.energy.IEnergyContainerItem; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -@InventoryContainer + public class ContainerEnergizer extends Container{ - private TileEntityEnergizer energizer; + public static final EntityEquipmentSlot[] VALID_EQUIPMENT_SLOTS = new EntityEquipmentSlot[]{EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET}; + private final TileEntityEnergizer energizer; - public ContainerEnergizer(EntityPlayer player, TileEntityBase tile){ + public ContainerEnergizer(final EntityPlayer player, TileEntityBase tile){ this.energizer = (TileEntityEnergizer)tile; InventoryPlayer inventory = player.inventory; @@ -44,24 +45,24 @@ public class ContainerEnergizer extends Container{ for(int i = 0; i < 9; i++){ this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } - final EntityPlayer finalPlayer = player; - for(int i = 0; i < 4; ++i){ - final int finalI = i; - this.addSlotToContainer(new Slot(inventory, inventory.getSizeInventory()-1-i, 102, 19+i*18){ - @Override - public boolean isItemValid(ItemStack stack){ - return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer); - } + for(int k = 0; k < 4; ++k){ + final EntityEquipmentSlot slot = VALID_EQUIPMENT_SLOTS[k]; + this.addSlotToContainer(new Slot(player.inventory, 36+(3-k), 102, 19+k*18){ @Override public int getSlotStackLimit(){ return 1; } + @Override + public boolean isItemValid(ItemStack stack){ + return stack != null && stack.getItem().isValidArmor(stack, slot, player); + } + @Override @SideOnly(Side.CLIENT) public String getSlotTexture(){ - return ItemArmor.EMPTY_SLOT_NAMES[finalI]; + return ItemArmor.EMPTY_SLOT_NAMES[slot.getIndex()]; } }); } @@ -69,12 +70,12 @@ public class ContainerEnergizer extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 2; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 2; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -110,7 +111,7 @@ public class ContainerEnergizer extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java index 95829c910..d13fa3cd6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerEnervator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerEnervator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -14,22 +14,22 @@ import cofh.api.energy.IEnergyContainerItem; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -@InventoryContainer + public class ContainerEnervator extends Container{ - private TileEntityEnervator enervator; + private final TileEntityEnervator enervator; - public ContainerEnervator(EntityPlayer player, TileEntityBase tile){ + public ContainerEnervator(final EntityPlayer player, TileEntityBase tile){ this.enervator = (TileEntityEnervator)tile; InventoryPlayer inventory = player.inventory; @@ -44,24 +44,24 @@ public class ContainerEnervator extends Container{ for(int i = 0; i < 9; i++){ this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } - final EntityPlayer finalPlayer = player; - for(int i = 0; i < 4; ++i){ - final int finalI = i; - this.addSlotToContainer(new Slot(inventory, inventory.getSizeInventory()-1-i, 102, 19+i*18){ - @Override - public boolean isItemValid(ItemStack stack){ - return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer); - } + for(int k = 0; k < 4; ++k){ + final EntityEquipmentSlot slot = ContainerEnergizer.VALID_EQUIPMENT_SLOTS[k]; + this.addSlotToContainer(new Slot(player.inventory, 36+(3-k), 102, 19+k*18){ @Override public int getSlotStackLimit(){ return 1; } + @Override + public boolean isItemValid(ItemStack stack){ + return stack != null && stack.getItem().isValidArmor(stack, slot, player); + } + @Override @SideOnly(Side.CLIENT) public String getSlotTexture(){ - return ItemArmor.EMPTY_SLOT_NAMES[finalI]; + return ItemArmor.EMPTY_SLOT_NAMES[slot.getIndex()]; } }); } @@ -69,12 +69,12 @@ public class ContainerEnervator extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 2; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 2; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -110,7 +110,7 @@ public class ContainerEnervator extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java index 267b17a25..847331f2a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java @@ -1,28 +1,27 @@ /* - * This file ("ContainerFeeder.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerFeeder.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFeeder; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerFeeder extends Container{ - private TileEntityFeeder tileFeeder; + private final TileEntityFeeder tileFeeder; public ContainerFeeder(InventoryPlayer inventory, TileEntityBase tile){ this.tileFeeder = (TileEntityFeeder)tile; @@ -40,12 +39,12 @@ public class ContainerFeeder extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -70,7 +69,7 @@ public class ContainerFeeder extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java index 6a23ad5df..eaa94d1f6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java @@ -1,41 +1,31 @@ /* - * This file ("ContainerFermentingBarrel.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerFermentingBarrel.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -@InventoryContainer + public class ContainerFermentingBarrel extends Container{ - private TileEntityFermentingBarrel barrel; + private final TileEntityFermentingBarrel barrel; public ContainerFermentingBarrel(InventoryPlayer inventory, TileEntityBase tile){ this.barrel = (TileEntityFermentingBarrel)tile; - this.addSlotToContainer(new Slot(this.barrel, 0, 42, 74)); - this.addSlotToContainer(new SlotOutput(this.barrel, 1, 42, 43)); - this.addSlotToContainer(new Slot(this.barrel, 2, 118, 74)); - this.addSlotToContainer(new SlotOutput(this.barrel, 3, 118, 43)); - for(int i = 0; i < 3; i++){ for(int j = 0; j < 9; j++){ this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); @@ -48,12 +38,12 @@ public class ContainerFermentingBarrel extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 4; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 0; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -61,20 +51,7 @@ public class ContainerFermentingBarrel extends Container{ //Other Slots in Inventory excluded if(slot >= inventoryStart){ - //Shift from Inventory - if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitFluids.fluidCanolaOil, 1))){ - if(!this.mergeItemStack(newStack, 0, 1, false)){ - return null; - } - } - else if(FluidContainerRegistry.getContainerCapacity(new FluidStack(InitFluids.fluidOil, 1), newStack) > 0){ - if(!this.mergeItemStack(newStack, 2, 3, false)){ - return null; - } - } - // - - else if(slot >= inventoryStart && slot <= inventoryEnd){ + if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)){ return null; } @@ -87,7 +64,7 @@ public class ContainerFermentingBarrel extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ @@ -106,6 +83,6 @@ public class ContainerFermentingBarrel extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.barrel.isUseableByPlayer(player); + return this.barrel.canPlayerUse(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java new file mode 100644 index 000000000..e0855fe6c --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java @@ -0,0 +1,258 @@ +/* + * This file ("ContainerFilter.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.inventory; + +import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter; +import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotImmovable; +import de.ellpeck.actuallyadditions.mod.items.ItemDrill; +import de.ellpeck.actuallyadditions.mod.items.ItemFilter; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ClickType; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; + + +public class ContainerFilter extends Container{ + + public static final int SLOT_AMOUNT = 24; + + private final InventoryFilter filterInventory = new InventoryFilter(); + private final InventoryPlayer inventory; + + public ContainerFilter(InventoryPlayer inventory){ + this.inventory = inventory; + + for(int i = 0; i < 4; i++){ + for(int j = 0; j < 6; j++){ + this.addSlotToContainer(new SlotFilter(this.filterInventory, j+(i*6), 35+j*18, 10+i*18)); + } + } + + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 94+i*18)); + } + } + for(int i = 0; i < 9; i++){ + if(i == inventory.currentItem){ + this.addSlotToContainer(new SlotImmovable(inventory, i, 8+i*18, 152)); + } + else{ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 152)); + } + } + + ItemStack stack = inventory.getCurrentItem(); + if(stack != null && stack.getItem() instanceof ItemFilter){ + ItemDrill.loadSlotsFromNBT(this.filterInventory.slots, inventory.getCurrentItem()); + } + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slot){ + int inventoryStart = SLOT_AMOUNT; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; + + Slot theSlot = this.inventorySlots.get(slot); + + if(theSlot != null && theSlot.getHasStack()){ + ItemStack newStack = theSlot.getStack(); + ItemStack currentStack = newStack.copy(); + + //Other Slots in Inventory excluded + if(slot >= inventoryStart){ + //Shift from Inventory + // + if(slot >= inventoryStart && slot <= inventoryEnd){ + if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)){ + return null; + } + } + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } + } + else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)){ + return null; + } + + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } + + if(newStack.stackSize == currentStack.stackSize){ + return null; + } + theSlot.onPickupFromSlot(player, newStack); + + return currentStack; + } + return null; + } + + @Override + public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){ + if(slotId >= 0 && slotId < this.inventorySlots.size() && this.getSlot(slotId) instanceof SlotFilter){ + //Calls the Filter's SlotClick function + return ((SlotFilter)this.getSlot(slotId)).slotClick(player); + } + else if(clickTypeIn == ClickType.SWAP && dragType == this.inventory.currentItem){ + return null; + } + else{ + return super.slotClick(slotId, dragType, clickTypeIn, player); + } + } + + @Override + public void onContainerClosed(EntityPlayer player){ + ItemStack stack = this.inventory.getCurrentItem(); + if(stack != null && stack.getItem() instanceof ItemFilter){ + ItemDrill.writeSlotsToNBT(this.filterInventory.slots, this.inventory.getCurrentItem()); + } + super.onContainerClosed(player); + } + + @Override + public boolean canInteractWith(EntityPlayer player){ + return this.filterInventory.isUseableByPlayer(player); + } + + public static class InventoryFilter implements IInventory{ + + public ItemStack[] slots = new ItemStack[SLOT_AMOUNT]; + + @Override + public String getName(){ + return "filter"; + } + + @Override + public int getInventoryStackLimit(){ + return 64; + } + + @Override + public void markDirty(){ + + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player){ + return true; + } + + @Override + public void openInventory(EntityPlayer player){ + + } + + @Override + public void closeInventory(EntityPlayer player){ + + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack){ + return true; + } + + @Override + public int getField(int id){ + return 0; + } + + @Override + public void setField(int id, int value){ + + } + + @Override + public int getFieldCount(){ + return 0; + } + + @Override + public void clear(){ + int length = this.slots.length; + this.slots = new ItemStack[length]; + } + + @Override + public void setInventorySlotContents(int i, ItemStack stack){ + this.slots[i] = stack; + this.markDirty(); + } + + @Override + public int getSizeInventory(){ + return this.slots.length; + } + + @Override + public ItemStack getStackInSlot(int i){ + if(i < this.getSizeInventory()){ + return this.slots[i]; + } + return null; + } + + @Override + public ItemStack decrStackSize(int i, int j){ + if(this.slots[i] != null){ + ItemStack stackAt; + if(this.slots[i].stackSize <= j){ + stackAt = this.slots[i]; + this.slots[i] = null; + this.markDirty(); + return stackAt; + } + else{ + stackAt = this.slots[i].splitStack(j); + if(this.slots[i].stackSize <= 0){ + this.slots[i] = null; + } + this.markDirty(); + return stackAt; + } + } + return null; + } + + @Override + public ItemStack removeStackFromSlot(int index){ + ItemStack stack = this.slots[index]; + this.slots[index] = null; + return stack; + } + + @Override + public boolean hasCustomName(){ + return false; + } + + + @Override + public ITextComponent getDisplayName(){ + return new TextComponentTranslation(this.getName()); + } + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java index 0ff708024..e48cd81d1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java @@ -1,37 +1,31 @@ /* - * This file ("ContainerFluidCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerFluidCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -@InventoryContainer + public class ContainerFluidCollector extends Container{ - private TileEntityFluidCollector collector; + private final TileEntityFluidCollector collector; public ContainerFluidCollector(InventoryPlayer inventory, TileEntityBase tile){ this.collector = (TileEntityFluidCollector)tile; - this.addSlotToContainer(new Slot(collector, 0, 90, 73)); - this.addSlotToContainer(new SlotOutput(collector, 1, 90, 42)); - for(int i = 0; i < 3; i++){ for(int j = 0; j < 9; j++){ this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); @@ -44,12 +38,12 @@ public class ContainerFluidCollector extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 2; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 0; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -64,15 +58,7 @@ public class ContainerFluidCollector extends Container{ } //Other Slots in Inventory excluded else if(slot >= inventoryStart){ - //Shift from Inventory - if(FluidContainerRegistry.isEmptyContainer(newStack)){ - if(!this.mergeItemStack(newStack, 0, 1, false)){ - return null; - } - } - // - - else if(slot >= inventoryStart && slot <= inventoryEnd){ + if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)){ return null; } @@ -85,7 +71,7 @@ public class ContainerFluidCollector extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ @@ -104,6 +90,6 @@ public class ContainerFluidCollector extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.collector.isUseableByPlayer(player); + return this.collector.canPlayerUse(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java index 0bf493f40..cc5a34e4f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java @@ -1,18 +1,17 @@ /* - * This file ("ContainerFurnaceDouble.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerFurnaceDouble.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -21,10 +20,10 @@ import net.minecraft.inventory.SlotFurnaceOutput; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; -@InventoryContainer + public class ContainerFurnaceDouble extends Container{ - private TileEntityFurnaceDouble tileFurnace; + private final TileEntityFurnaceDouble tileFurnace; public ContainerFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile){ this.tileFurnace = (TileEntityFurnaceDouble)tile; @@ -46,12 +45,12 @@ public class ContainerFurnaceDouble extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 4; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 4; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -89,7 +88,7 @@ public class ContainerFurnaceDouble extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java index f28af7335..c66995247 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerGiantChest.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerGiantChest.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -19,17 +19,17 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@ChestContainer(rowSize = 13) +@ChestContainer(rowSize = 13, isLargeChest = true) public class ContainerGiantChest extends Container{ - public TileEntityGiantChest tileChest; + public final TileEntityGiantChest tileChest; - public ContainerGiantChest(InventoryPlayer inventory, TileEntityBase tile){ + public ContainerGiantChest(InventoryPlayer inventory, TileEntityBase tile, int page){ this.tileChest = (TileEntityGiantChest)tile; for(int i = 0; i < 9; i++){ for(int j = 0; j < 13; j++){ - this.addSlotToContainer(new Slot(this.tileChest, j+(i*13), 5+j*18, 5+i*18)); + this.addSlotToContainer(new Slot(this.tileChest, (9*13*page)+j+(i*13), 5+j*18, 5+i*18)); } } @@ -45,12 +45,12 @@ public class ContainerGiantChest extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 117; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 117; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -75,7 +75,7 @@ public class ContainerGiantChest extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java index 8d7b36b63..9ec622969 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerGrinder.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerGrinder.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -22,11 +21,10 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer public class ContainerGrinder extends Container{ - public TileEntityGrinder tileGrinder; - private boolean isDouble; + public final TileEntityGrinder tileGrinder; + private final boolean isDouble; public ContainerGrinder(InventoryPlayer inventory, TileEntityBase tile, boolean isDouble){ this.tileGrinder = (TileEntityGrinder)tile; @@ -53,12 +51,12 @@ public class ContainerGrinder extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = this.isDouble ? 6 : 3; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = this.isDouble ? 6 : 3; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -101,7 +99,7 @@ public class ContainerGrinder extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java index 82efa927d..d8ae94535 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerInputter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerInputter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -14,19 +14,19 @@ import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInputter; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerInputter extends Container{ - private TileEntityInputter tileInputter; + private final TileEntityInputter tileInputter; - private boolean isAdvanced; + private final boolean isAdvanced; public ContainerInputter(InventoryPlayer inventory, TileEntityBase tile, boolean isAdvanced){ this.tileInputter = (TileEntityInputter)tile; @@ -46,22 +46,22 @@ public class ContainerInputter extends Container{ for(int i = 0; i < 3; i++){ for(int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18+(isAdvanced ? GuiInputter.OFFSET_ADVANCED : 0))); + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 101+i*18+(isAdvanced ? GuiInputter.OFFSET_ADVANCED : 0))); } } for(int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155+(isAdvanced ? GuiInputter.OFFSET_ADVANCED : 0))); + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 159+(isAdvanced ? GuiInputter.OFFSET_ADVANCED : 0))); } } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = this.isAdvanced ? 25 : 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = this.isAdvanced ? 25 : 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -86,7 +86,7 @@ public class ContainerInputter extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ @@ -104,13 +104,13 @@ public class ContainerInputter extends Container{ } @Override - public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){ - if(par1 >= 0 && par1 < this.inventorySlots.size() && this.getSlot(par1) instanceof SlotFilter){ + public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){ + if(slotId >= 0 && slotId < this.inventorySlots.size() && this.getSlot(slotId) instanceof SlotFilter){ //Calls the Filter's SlotClick function - return ((SlotFilter)getSlot(par1)).slotClick(player); + return ((SlotFilter)this.getSlot(slotId)).slotClick(player); } else{ - return super.slotClick(par1, par2, par3, player); + return super.slotClick(slotId, dragType, clickTypeIn, player); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java new file mode 100644 index 000000000..db0bfd991 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java @@ -0,0 +1,109 @@ +/* + * This file ("ContainerLaserRelayItemWhitelist.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.inventory; + +import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ClickType; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + + +public class ContainerLaserRelayItemWhitelist extends Container{ + + private final TileEntityLaserRelayItemWhitelist tile; + + public ContainerLaserRelayItemWhitelist(InventoryPlayer inventory, TileEntityBase tile){ + this.tile = (TileEntityLaserRelayItemWhitelist)tile; + + for(int i = 0; i < 2; i++){ + for(int x = 0; x < 3; x++){ + for(int y = 0; y < 4; y++){ + this.addSlotToContainer(new SlotFilter(this.tile.filterInventory, y+x*4+i*12, 20+i*84+x*18, 6+y*18)); + } + } + } + + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); + } + } + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); + } + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slot){ + int inventoryStart = 0; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; + + Slot theSlot = this.inventorySlots.get(slot); + + if(theSlot != null && theSlot.getHasStack()){ + ItemStack newStack = theSlot.getStack(); + ItemStack currentStack = newStack.copy(); + + //Other Slots in Inventory excluded + if(slot >= inventoryStart){ + if(slot >= inventoryStart && slot <= inventoryEnd){ + if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)){ + return null; + } + } + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } + } + else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)){ + return null; + } + + if(newStack.stackSize <= 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } + + if(newStack.stackSize == currentStack.stackSize){ + return null; + } + theSlot.onPickupFromSlot(player, newStack); + + return currentStack; + } + return null; + } + + @Override + public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){ + if(slotId >= 0 && slotId < this.inventorySlots.size() && this.getSlot(slotId) instanceof SlotFilter){ + //Calls the Filter's SlotClick function + return ((SlotFilter)this.getSlot(slotId)).slotClick(player); + } + else{ + return super.slotClick(slotId, dragType, clickTypeIn, player); + } + } + + @Override + public boolean canInteractWith(EntityPlayer player){ + return this.tile.canPlayerUse(player); + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java index e42b19279..f88888640 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java @@ -1,28 +1,27 @@ /* - * This file ("ContainerMiner.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerMiner.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerMiner extends Container{ - private TileEntityMiner miner; + private final TileEntityMiner miner; public ContainerMiner(InventoryPlayer inventory, TileEntityBase tile){ this.miner = (TileEntityMiner)tile; @@ -45,12 +44,12 @@ public class ContainerMiner extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -75,7 +74,7 @@ public class ContainerMiner extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java index a41d04864..a77bcc3cf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java @@ -1,39 +1,30 @@ /* - * This file ("ContainerOilGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerOilGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; -import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -@InventoryContainer public class ContainerOilGenerator extends Container{ - private TileEntityOilGenerator generator; + private final TileEntityOilGenerator generator; public ContainerOilGenerator(InventoryPlayer inventory, TileEntityBase tile){ this.generator = (TileEntityOilGenerator)tile; - this.addSlotToContainer(new Slot(this.generator, 0, 98, 74)); - this.addSlotToContainer(new SlotOutput(this.generator, 1, 98, 43)); - for(int i = 0; i < 3; i++){ for(int j = 0; j < 9; j++){ this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); @@ -46,12 +37,12 @@ public class ContainerOilGenerator extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 2; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 0; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -59,15 +50,7 @@ public class ContainerOilGenerator extends Container{ //Other Slots in Inventory excluded if(slot >= inventoryStart){ - //Shift from Inventory - if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitFluids.fluidOil, 1))){ - if(!this.mergeItemStack(newStack, 0, 1, false)){ - return null; - } - } - // - - else if(slot >= inventoryStart && slot <= inventoryEnd){ + if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)){ return null; } @@ -80,7 +63,7 @@ public class ContainerOilGenerator extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ @@ -99,6 +82,6 @@ public class ContainerOilGenerator extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.generator.isUseableByPlayer(player); + return this.generator.canPlayerUse(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java index b41246de6..9b82c73b1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java @@ -1,28 +1,27 @@ /* - * This file ("ContainerPhantomPlacer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerPhantomPlacer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerPhantomPlacer extends Container{ - private TileEntityPhantomPlacer placer; + private final TileEntityPhantomPlacer placer; public ContainerPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile){ this.placer = (TileEntityPhantomPlacer)tile; @@ -45,12 +44,12 @@ public class ContainerPhantomPlacer extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -75,7 +74,7 @@ public class ContainerPhantomPlacer extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java index 89eb7b93c..44ae77f02 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerRangedCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerRangedCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -13,17 +13,17 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotFilter; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ClickType; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerRangedCollector extends Container{ - private TileEntityRangedCollector collector; + private final TileEntityRangedCollector collector; public ContainerRangedCollector(InventoryPlayer inventory, TileEntityBase tile){ this.collector = (TileEntityRangedCollector)tile; @@ -51,12 +51,12 @@ public class ContainerRangedCollector extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 18; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 18; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -81,7 +81,7 @@ public class ContainerRangedCollector extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ @@ -99,13 +99,13 @@ public class ContainerRangedCollector extends Container{ } @Override - public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){ - if(par1 >= 0 && par1 < this.inventorySlots.size() && this.getSlot(par1) instanceof SlotFilter){ + public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player){ + if(slotId >= 0 && slotId < this.inventorySlots.size() && this.getSlot(slotId) instanceof SlotFilter){ //Calls the Filter's SlotClick function - return ((SlotFilter)getSlot(par1)).slotClick(player); + return ((SlotFilter)this.getSlot(slotId)).slotClick(player); } else{ - return super.slotClick(par1, par2, par3, player); + return super.slotClick(slotId, dragType, clickTypeIn, player); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java index c75ab13c4..6f1e45d81 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerRepairer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerRepairer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -13,17 +13,16 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerRepairer extends Container{ - private TileEntityItemRepairer tileRepairer; + private final TileEntityItemRepairer tileRepairer; public ContainerRepairer(InventoryPlayer inventory, TileEntityBase tile){ this.tileRepairer = (TileEntityItemRepairer)tile; @@ -43,12 +42,12 @@ public class ContainerRepairer extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 2; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 2; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -77,7 +76,7 @@ public class ContainerRepairer extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerSmileyCloud.java index 586303d7a..7e32752a8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerSmileyCloud.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerSmileyCloud.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerSmileyCloud.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java index 961b346f2..a224ac39e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java @@ -1,11 +1,11 @@ /* - * This file ("ContainerXPSolidifier.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ContainerXPSolidifier.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; @@ -13,22 +13,21 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotOutput; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier; -import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -@InventoryContainer + public class ContainerXPSolidifier extends Container{ - private TileEntityXPSolidifier solidifier; + private final TileEntityXPSolidifier solidifier; public ContainerXPSolidifier(InventoryPlayer inventory, TileEntityBase tile){ this.solidifier = (TileEntityXPSolidifier)tile; - this.addSlotToContainer(new SlotOutput(solidifier, 0, 80, 8)); + this.addSlotToContainer(new SlotOutput(this.solidifier, 0, 80, 8)); for(int i = 0; i < 3; i++){ for(int j = 0; j < 9; j++){ @@ -42,12 +41,12 @@ public class ContainerXPSolidifier extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; - Slot theSlot = (Slot)this.inventorySlots.get(slot); + Slot theSlot = this.inventorySlots.get(slot); if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); @@ -68,7 +67,7 @@ public class ContainerXPSolidifier extends Container{ return null; } - if(newStack.stackSize == 0){ + if(newStack.stackSize <= 0){ theSlot.putStack(null); } else{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/GuiHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/GuiHandler.java index 3ce88f5d0..600f10cfc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/GuiHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/GuiHandler.java @@ -1,22 +1,23 @@ /* - * This file ("GuiHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; +import de.ellpeck.actuallyadditions.mod.booklet.GuiBookletStand; import de.ellpeck.actuallyadditions.mod.inventory.gui.*; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; import net.minecraftforge.fml.common.network.NetworkRegistry; @@ -38,7 +39,11 @@ public class GuiHandler implements IGuiHandler{ case FEEDER: return new ContainerFeeder(entityPlayer.inventory, tile); case GIANT_CHEST: - return new ContainerGiantChest(entityPlayer.inventory, tile); + return new ContainerGiantChest(entityPlayer.inventory, tile, 0); + case GIANT_CHEST_PAGE_2: + return new ContainerGiantChest(entityPlayer.inventory, tile, 1); + case GIANT_CHEST_PAGE_3: + return new ContainerGiantChest(entityPlayer.inventory, tile, 2); case CRAFTER: return new ContainerCrafter(entityPlayer); case GRINDER: @@ -73,6 +78,8 @@ public class GuiHandler implements IGuiHandler{ return new ContainerCoffeeMachine(entityPlayer.inventory, tile); case DRILL: return new ContainerDrill(entityPlayer.inventory); + case FILTER: + return new ContainerFilter(entityPlayer.inventory); case ENERGIZER: return new ContainerEnergizer(entityPlayer, tile); case ENERVATOR: @@ -87,6 +94,8 @@ public class GuiHandler implements IGuiHandler{ return new ContainerRangedCollector(entityPlayer.inventory, tile); case MINER: return new ContainerMiner(entityPlayer.inventory, tile); + case LASER_RELAY_ITEM_WHITELIST: + return new ContainerLaserRelayItemWhitelist(entityPlayer.inventory, tile); default: return null; } @@ -102,7 +111,11 @@ public class GuiHandler implements IGuiHandler{ case FEEDER: return new GuiFeeder(entityPlayer.inventory, tile); case GIANT_CHEST: - return new GuiGiantChest(entityPlayer.inventory, tile); + return new GuiGiantChest(entityPlayer.inventory, tile, 0); + case GIANT_CHEST_PAGE_2: + return new GuiGiantChest(entityPlayer.inventory, tile, 1); + case GIANT_CHEST_PAGE_3: + return new GuiGiantChest(entityPlayer.inventory, tile, 2); case CRAFTER: return new GuiCrafter(entityPlayer); case GRINDER: @@ -137,6 +150,8 @@ public class GuiHandler implements IGuiHandler{ return new GuiCoffeeMachine(entityPlayer.inventory, tile, x, y, z, world); case DRILL: return new GuiDrill(entityPlayer.inventory); + case FILTER: + return new GuiFilter(entityPlayer.inventory); case ENERGIZER: return new GuiEnergizer(entityPlayer, tile); case ENERVATOR: @@ -153,6 +168,10 @@ public class GuiHandler implements IGuiHandler{ return new GuiRangedCollector(entityPlayer.inventory, tile, x, y, z, world); case MINER: return new GuiMiner(entityPlayer.inventory, tile); + case BOOK_STAND: + return new GuiBookletStand(tile); + case LASER_RELAY_ITEM_WHITELIST: + return new GuiLaserRelayItemWhitelist(entityPlayer.inventory, tile); default: return null; } @@ -161,6 +180,8 @@ public class GuiHandler implements IGuiHandler{ public enum GuiTypes{ FEEDER, GIANT_CHEST, + GIANT_CHEST_PAGE_2, + GIANT_CHEST_PAGE_3, CRAFTER(false), GRINDER, GRINDER_DOUBLE, @@ -185,9 +206,12 @@ public class GuiHandler implements IGuiHandler{ BOOK(false), DIRECTIONAL_BREAKER, RANGED_COLLECTOR, - MINER; + MINER, + BOOK_STAND, + LASER_RELAY_ITEM_WHITELIST, + FILTER(false); - public boolean checkTileEntity; + public final boolean checkTileEntity; GuiTypes(){ this(true); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java index 413ff5cb3..3ca67be11 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java @@ -1,11 +1,11 @@ /* - * This file ("GuiBreaker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiBreaker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -24,8 +24,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiBreaker extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBreaker"); - private TileEntityBreaker breaker; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiBreaker"); + private final TileEntityBreaker breaker; public GuiBreaker(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerBreaker(inventory, tile)); @@ -34,14 +34,9 @@ public class GuiBreaker extends GuiContainer{ this.ySize = 93+86; } - @Override - public void drawScreen(int x, int y, float f){ - super.drawScreen(x, y, f); - } - @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.breaker); } @Override @@ -51,7 +46,7 @@ public class GuiBreaker extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java index 8594f6447..2d28853e6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java @@ -1,11 +1,11 @@ /* - * This file ("GuiCanolaPress.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiCanolaPress.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -27,8 +27,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiCanolaPress extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCanolaPress"); - private TileEntityCanolaPress press; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiCanolaPress"); + private final TileEntityCanolaPress press; public GuiCanolaPress(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerCanolaPress(inventory, tile)); @@ -41,19 +41,19 @@ public class GuiCanolaPress extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); String text1 = this.press.storage.getEnergyStored()+"/"+this.press.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ + if(x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text1), x, y); } String text2 = StringUtil.getFluidInfo(this.press.tank); - if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ + if(x >= this.guiLeft+117 && y >= this.guiTop+6 && x <= this.guiLeft+132 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text2), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.press); } @Override @@ -63,22 +63,22 @@ public class GuiCanolaPress extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.press.storage.getEnergyStored() > 0){ int i = this.press.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i); + this.drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i); } if(this.press.tank.getFluidAmount() > 0){ int i = this.press.getTankScaled(83); - drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 29, 16, i); + this.drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 29, 16, i); } if(this.press.currentProcessTime > 0){ int i = this.press.getProcessScaled(29); - drawTexturedModalRect(this.guiLeft+83, this.guiTop+32, 176, 0, 12, i); + this.drawTexturedModalRect(this.guiLeft+83, this.guiTop+32, 176, 0, 12, i); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java index a0d541a9d..36ea1bb24 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java @@ -1,11 +1,11 @@ /* - * This file ("GuiCoalGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiCoalGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -26,8 +26,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiCoalGenerator extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCoalGenerator"); - private TileEntityCoalGenerator generator; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiCoalGenerator"); + private final TileEntityCoalGenerator generator; public GuiCoalGenerator(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerCoalGenerator(inventory, tile)); @@ -40,14 +40,14 @@ public class GuiCoalGenerator extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ + if(x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text1), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.generator); } @Override @@ -57,17 +57,17 @@ public class GuiCoalGenerator extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.generator.storage.getEnergyStored() > 0){ int i = this.generator.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i); + this.drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i); } if(this.generator.currentBurnTime > 0){ int i = this.generator.getBurningScaled(13); - this.drawTexturedModalRect(guiLeft+87, guiTop+27+12-i, 176, 96-i, 14, i); + this.drawTexturedModalRect(this.guiLeft+87, this.guiTop+27+12-i, 176, 96-i, 14, i); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java index 9991570ec..e745b36d3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java @@ -1,18 +1,18 @@ /* - * This file ("GuiCoffeeMachine.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiCoffeeMachine.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiButton; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -23,6 +23,7 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -33,12 +34,12 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiCoffeeMachine extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCoffeeMachine"); - private TileEntityCoffeeMachine machine; - private int x; - private int y; - private int z; - private World world; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiCoffeeMachine"); + private final TileEntityCoffeeMachine machine; + private final int x; + private final int y; + private final int z; + private final World world; public GuiCoffeeMachine(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world){ super(new ContainerCoffeeMachine(inventory, tile)); @@ -51,12 +52,11 @@ public class GuiCoffeeMachine extends GuiContainer{ this.world = world; } - @SuppressWarnings("unchecked") @Override public void initGui(){ super.initGui(); - GuiButton buttonOkay = new GuiButton(0, guiLeft+60, guiTop+11, 58, 20, StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.ok")); + GuiButton buttonOkay = new GuiButton(0, this.guiLeft+60, this.guiTop+11, 58, 20, StringUtil.localize("info."+ModUtil.MOD_ID+".gui.ok")); this.buttonList.add(buttonOkay); } @@ -65,23 +65,23 @@ public class GuiCoffeeMachine extends GuiContainer{ super.drawScreen(x, y, f); String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){ + if(x >= this.guiLeft+16 && y >= this.guiTop+5 && x <= this.guiLeft+23 && y <= this.guiTop+89){ this.drawHoveringText(Collections.singletonList(text1), x, y); } String text3 = StringUtil.getFluidInfo(this.machine.tank); - if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){ + if(x >= this.guiLeft+27 && y >= this.guiTop+5 && x <= this.guiLeft+33 && y <= this.guiTop+70){ this.drawHoveringText(Collections.singletonList(text3), x, y); } - String text2 = this.machine.coffeeCacheAmount+"/"+TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.coffee"); - if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){ + String text2 = this.machine.coffeeCacheAmount+"/"+TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.coffee"); + if(x >= this.guiLeft+40 && y >= this.guiTop+25 && x <= this.guiLeft+49 && y <= this.guiTop+56){ this.drawHoveringText(Collections.singletonList(text2), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.machine.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.machine); } @Override @@ -91,34 +91,41 @@ public class GuiCoffeeMachine extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.machine.storage.getEnergyStored() > 0){ int i = this.machine.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+17, this.guiTop+89-i, 176, 0, 6, i); + this.drawTexturedModalRect(this.guiLeft+17, this.guiTop+89-i, 176, 0, 6, i); } if(this.machine.tank.getFluidAmount() > 0){ int i = this.machine.getWaterScaled(64); - drawTexturedModalRect(this.guiLeft+27, this.guiTop+70-i, 182, 0, 6, i); + this.drawTexturedModalRect(this.guiLeft+27, this.guiTop+70-i, 182, 0, 6, i); } if(this.machine.coffeeCacheAmount > 0){ int i = this.machine.getCoffeeScaled(30); - drawTexturedModalRect(this.guiLeft+41, this.guiTop+56-i, 192, 0, 8, i); + this.drawTexturedModalRect(this.guiLeft+41, this.guiTop+56-i, 192, 0, 8, i); } if(this.machine.brewTime > 0){ int i = this.machine.getBrewScaled(23); - drawTexturedModalRect(this.guiLeft+53, this.guiTop+42, 192, 30, i, 16); + this.drawTexturedModalRect(this.guiLeft+53, this.guiTop+42, 192, 30, i, 16); int j = this.machine.getBrewScaled(26); - drawTexturedModalRect(this.guiLeft+99+25-j, this.guiTop+44, 192+25-j, 46, j, 12); + this.drawTexturedModalRect(this.guiLeft+99+25-j, this.guiTop+44, 192+25-j, 46, j, 12); } } @Override public void actionPerformed(GuiButton button){ - PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer)); + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.x); + compound.setInteger("Y", this.y); + compound.setInteger("Z", this.z); + compound.setInteger("WorldID", this.world.provider.getDimension()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("ButtonID", button.id); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCrafter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCrafter.java index e66956e1b..b097bf05f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCrafter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCrafter.java @@ -1,11 +1,11 @@ /* - * This file ("GuiCrafter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiCrafter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -23,7 +23,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiCrafter extends GuiContainer{ - private static final ResourceLocation resLoc = new ResourceLocation("textures/gui/container/crafting_table.png"); + private static final ResourceLocation RES_LOC = new ResourceLocation("textures/gui/container/crafting_table.png"); public GuiCrafter(EntityPlayer player){ super(new ContainerCrafter(player)); @@ -34,13 +34,13 @@ public class GuiCrafter extends GuiContainer{ @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, "container."+ModUtil.MOD_ID_LOWER+".crafting"); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, "container."+ModUtil.MOD_ID+".crafting"); } @Override public void drawGuiContainerBackgroundLayer(float f, int x, int y){ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java index f3dacb552..5bb51f2ef 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java @@ -1,11 +1,11 @@ /* - * This file ("GuiDirectionalBreaker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiDirectionalBreaker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -26,8 +26,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiDirectionalBreaker extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiDirectionalBreaker"); - private TileEntityDirectionalBreaker breaker; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiDirectionalBreaker"); + private final TileEntityDirectionalBreaker breaker; public GuiDirectionalBreaker(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerDirectionalBreaker(inventory, tile)); @@ -41,14 +41,14 @@ public class GuiDirectionalBreaker extends GuiContainer{ super.drawScreen(x, y, f); String text1 = this.breaker.storage.getEnergyStored()+"/"+this.breaker.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ + if(x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text1), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.breaker.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.breaker); } @Override @@ -58,12 +58,12 @@ public class GuiDirectionalBreaker extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.breaker.storage.getEnergyStored() > 0){ int i = this.breaker.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i); + this.drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java index fce51af26..24cdb2e1c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java @@ -1,11 +1,11 @@ /* - * This file ("GuiDrill.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiDrill.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -23,7 +23,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiDrill extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiDrill"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiDrill"); public GuiDrill(InventoryPlayer inventory){ super(new ContainerDrill(inventory)); @@ -33,7 +33,7 @@ public class GuiDrill extends GuiContainer{ @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, "container."+ModUtil.MOD_ID_LOWER+".drill"); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, "container."+ModUtil.MOD_ID+".drill"); } @Override @@ -43,7 +43,7 @@ public class GuiDrill extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+54, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 54); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java index a015c2eef..ad94d37e7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java @@ -1,11 +1,11 @@ /* - * This file ("GuiDropper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiDropper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -24,8 +24,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiDropper extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBreaker"); - private TileEntityDropper dropper; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiBreaker"); + private final TileEntityDropper dropper; public GuiDropper(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerDropper(inventory, tile)); @@ -34,14 +34,9 @@ public class GuiDropper extends GuiContainer{ this.ySize = 93+86; } - @Override - public void drawScreen(int x, int y, float f){ - super.drawScreen(x, y, f); - } - @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.dropper.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.dropper); } @Override @@ -51,7 +46,7 @@ public class GuiDropper extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java index 57e370a46..2e8251dc1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java @@ -1,11 +1,11 @@ /* - * This file ("GuiEnergizer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiEnergizer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -26,8 +26,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiEnergizer extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiEnergizer"); - private TileEntityEnergizer energizer; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiEnergizer"); + private final TileEntityEnergizer energizer; public GuiEnergizer(EntityPlayer inventory, TileEntityBase tile){ super(new ContainerEnergizer(inventory, tile)); @@ -40,14 +40,14 @@ public class GuiEnergizer extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ + if(x >= this.guiLeft+57 && y >= this.guiTop+6 && x <= this.guiLeft+72 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text1), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.energizer.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.energizer); } @Override @@ -57,12 +57,12 @@ public class GuiEnergizer extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.energizer.storage.getEnergyStored() > 0){ int i = this.energizer.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i); + this.drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java index 866c82aa0..49a30f393 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java @@ -1,11 +1,11 @@ /* - * This file ("GuiEnervator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiEnervator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -26,8 +26,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiEnervator extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiEnergizer"); - private TileEntityEnervator enervator; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiEnergizer"); + private final TileEntityEnervator enervator; public GuiEnervator(EntityPlayer inventory, TileEntityBase tile){ super(new ContainerEnervator(inventory, tile)); @@ -40,14 +40,14 @@ public class GuiEnervator extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ + if(x >= this.guiLeft+57 && y >= this.guiTop+6 && x <= this.guiLeft+72 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text1), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.enervator.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.enervator); } @Override @@ -57,12 +57,12 @@ public class GuiEnervator extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.enervator.storage.getEnergyStored() > 0){ int i = this.enervator.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i); + this.drawTexturedModalRect(this.guiLeft+57, this.guiTop+89-i, 176, 0, 16, i); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java index 7e60a3795..fbb9bead4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java @@ -1,11 +1,11 @@ /* - * This file ("GuiFeeder.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiFeeder.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -28,8 +28,8 @@ import java.util.Arrays; @SideOnly(Side.CLIENT) public class GuiFeeder extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFeeder"); - public TileEntityFeeder tileFeeder; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFeeder"); + public final TileEntityFeeder tileFeeder; public GuiFeeder(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerFeeder(inventory, tile)); @@ -41,15 +41,15 @@ public class GuiFeeder extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - if(x >= guiLeft+69 && y >= guiTop+30 && x <= guiLeft+69+10 && y <= guiTop+30+10){ - String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD) ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.tooMany") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.notEnough")))}; + if(x >= this.guiLeft+69 && y >= this.guiTop+30 && x <= this.guiLeft+69+10 && y <= this.guiTop+30+10){ + String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD) ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.tooMany") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.notEnough")))}; this.drawHoveringText(Arrays.asList(array), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFeeder.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileFeeder); } @Override @@ -57,20 +57,20 @@ public class GuiFeeder extends GuiContainer{ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+70, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 70); if(this.tileFeeder.currentTimer > 0){ int i = this.tileFeeder.getCurrentTimerToScale(20); - this.drawTexturedModalRect(guiLeft+85, guiTop+42-i, 181, 19+19-i, 6, 20); + this.drawTexturedModalRect(this.guiLeft+85, this.guiTop+42-i, 181, 19+19-i, 6, 20); } if(this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD){ - this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 16, 8, 8); + this.drawTexturedModalRect(this.guiLeft+70, this.guiTop+31, 192, 16, 8, 8); } if(this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD){ - this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 24, 8, 8); + this.drawTexturedModalRect(this.guiLeft+70, this.guiTop+31, 192, 24, 8, 8); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java index 543f88437..9d45e29df 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java @@ -1,11 +1,11 @@ /* - * This file ("GuiFermentingBarrel.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiFermentingBarrel.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -27,8 +27,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiFermentingBarrel extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFermentingBarrel"); - private TileEntityFermentingBarrel press; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFermentingBarrel"); + private final TileEntityFermentingBarrel press; public GuiFermentingBarrel(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerFermentingBarrel(inventory, tile)); @@ -42,19 +42,19 @@ public class GuiFermentingBarrel extends GuiContainer{ super.drawScreen(x, y, f); String text1 = StringUtil.getFluidInfo(this.press.canolaTank); - if(x >= guiLeft+61 && y >= guiTop+6 && x <= guiLeft+76 && y <= guiTop+88){ + if(x >= this.guiLeft+61 && y >= this.guiTop+6 && x <= this.guiLeft+76 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text1), x, y); } String text2 = StringUtil.getFluidInfo(this.press.oilTank); - if(x >= guiLeft+99 && y >= guiTop+6 && x <= guiLeft+114 && y <= guiTop+88){ + if(x >= this.guiLeft+99 && y >= this.guiTop+6 && x <= this.guiLeft+114 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text2), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.press.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.press); } @Override @@ -64,22 +64,22 @@ public class GuiFermentingBarrel extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.press.canolaTank.getFluidAmount() > 0){ int i = this.press.getCanolaTankScaled(83); - drawTexturedModalRect(this.guiLeft+61, this.guiTop+89-i, 192, 29, 16, i); + this.drawTexturedModalRect(this.guiLeft+61, this.guiTop+89-i, 192, 29, 16, i); } if(this.press.oilTank.getFluidAmount() > 0){ int i = this.press.getOilTankScaled(83); - drawTexturedModalRect(this.guiLeft+99, this.guiTop+89-i, 176, 29, 16, i); + this.drawTexturedModalRect(this.guiLeft+99, this.guiTop+89-i, 176, 29, 16, i); } if(this.press.currentProcessTime > 0){ int i = this.press.getProcessScaled(29); - drawTexturedModalRect(this.guiLeft+82, this.guiTop+34, 176, 0, 12, i); + this.drawTexturedModalRect(this.guiLeft+82, this.guiTop+34, 176, 0, 12, i); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java new file mode 100644 index 000000000..398971903 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFilter.java @@ -0,0 +1,49 @@ +/* + * This file ("GuiFilter.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.inventory.gui; + +import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiFilter extends GuiContainer{ + + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFilter"); + + public GuiFilter(InventoryPlayer inventory){ + super(new ContainerFilter(inventory)); + this.xSize = 176; + this.ySize = 90+86; + } + + @Override + public void drawGuiContainerForegroundLayer(int x, int y){ + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, "container."+ModUtil.MOD_ID+".filter"); + } + + @Override + public void drawGuiContainerBackgroundLayer(float f, int x, int y){ + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); + this.drawTexturedModalRect(this.guiLeft, this.guiTop+90, 0, 0, 176, 86); + + this.mc.getTextureManager().bindTexture(RES_LOC); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 90); + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java index bf3aedf77..bcb33a796 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java @@ -1,11 +1,11 @@ /* - * This file ("GuiFluidCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiFluidCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -27,8 +27,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiFluidCollector extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFluidCollector"); - private TileEntityFluidCollector collector; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFluidCollector"); + private final TileEntityFluidCollector collector; public GuiFluidCollector(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerFluidCollector(inventory, tile)); @@ -42,14 +42,14 @@ public class GuiFluidCollector extends GuiContainer{ super.drawScreen(x, y, f); String text2 = StringUtil.getFluidInfo(this.collector.tank); - if(x >= guiLeft+68 && y >= guiTop+6 && x <= guiLeft+83 && y <= guiTop+88){ + if(x >= this.guiLeft+68 && y >= this.guiTop+6 && x <= this.guiLeft+83 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text2), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.collector); } @Override @@ -59,12 +59,12 @@ public class GuiFluidCollector extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.collector.tank.getFluidAmount() > 0){ int i = this.collector.getTankScaled(83); - drawTexturedModalRect(this.guiLeft+68, this.guiTop+89-i, 176, 0, 16, i); + this.drawTexturedModalRect(this.guiLeft+68, this.guiTop+89-i, 176, 0, 16, i); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java index a821f0a28..9e97b5af5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java @@ -1,11 +1,11 @@ /* - * This file ("GuiFurnaceDouble.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiFurnaceDouble.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -26,8 +26,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiFurnaceDouble extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFurnaceDouble"); - private TileEntityFurnaceDouble tileFurnace; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFurnaceDouble"); + private final TileEntityFurnaceDouble tileFurnace; public GuiFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerFurnaceDouble(inventory, tile)); @@ -40,14 +40,14 @@ public class GuiFurnaceDouble extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ + if(x >= this.guiLeft+28 && y >= this.guiTop+6 && x <= this.guiLeft+43 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileFurnace.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileFurnace); } @Override @@ -57,12 +57,12 @@ public class GuiFurnaceDouble extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.tileFurnace.storage.getEnergyStored() > 0){ int i = this.tileFurnace.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+28, this.guiTop+89-i, 176, 44, 16, i); + this.drawTexturedModalRect(this.guiLeft+28, this.guiTop+89-i, 176, 44, 16, i); } if(this.tileFurnace.firstSmeltTime > 0){ int i = this.tileFurnace.getFirstTimeToScale(23); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java index 87acd5918..769a80037 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java @@ -1,50 +1,86 @@ /* - * This file ("GuiGiantChest.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiGiantChest.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; import de.ellpeck.actuallyadditions.mod.inventory.ContainerGiantChest; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; +import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChestLarge; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChestMedium; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.io.IOException; + @SideOnly(Side.CLIENT) public class GuiGiantChest extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiGiantChest"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiGiantChest"); - TileEntityGiantChest chest; + private final TileEntityGiantChest chest; + private final int page; - public GuiGiantChest(InventoryPlayer inventory, TileEntityBase tile){ - super(new ContainerGiantChest(inventory, tile)); + public GuiGiantChest(InventoryPlayer inventory, TileEntityBase tile, int page){ + super(new ContainerGiantChest(inventory, tile, page)); this.chest = (TileEntityGiantChest)tile; + this.page = page; this.xSize = 242; this.ySize = 172+86; } + @Override + public void initGui(){ + super.initGui(); + + if(this.page > 0){ + this.buttonList.add(new GuiButton(this.page-1, this.guiLeft+13, this.guiTop+172, 20, 20, "<")); + } + + if((this.page == 0 && this.chest instanceof TileEntityGiantChestMedium) || (this.page <= 1 && this.chest instanceof TileEntityGiantChestLarge)){ + this.buttonList.add(new GuiButton(this.page+1, this.guiLeft+209, this.guiTop+172, 20, 20, ">")); + } + } + + @Override + protected void actionPerformed(GuiButton button) throws IOException{ + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.chest.getPos().getX()); + compound.setInteger("Y", this.chest.getPos().getY()); + compound.setInteger("Z", this.chest.getPos().getZ()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("WorldID", this.chest.getWorld().provider.getDimension()); + compound.setInteger("ButtonID", button.id); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); + } + @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.chest.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.chest); } @Override public void drawGuiContainerBackgroundLayer(float f, int x, int y){ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 242, 190); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft+33, this.guiTop+172, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java index db7c2e000..5336aa460 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java @@ -1,11 +1,11 @@ /* - * This file ("GuiGrinder.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiGrinder.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -26,10 +26,10 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiGrinder extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiGrinder"); - private static final ResourceLocation resLocDouble = AssetUtil.getGuiLocation("guiGrinderDouble"); - private TileEntityGrinder tileGrinder; - private boolean isDouble; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiGrinder"); + private static final ResourceLocation RES_LOC_DOUBLE = AssetUtil.getGuiLocation("guiGrinderDouble"); + private final TileEntityGrinder tileGrinder; + private final boolean isDouble; public GuiGrinder(InventoryPlayer inventoryPlayer, TileEntityBase tile){ this(inventoryPlayer, tile, false); @@ -47,14 +47,14 @@ public class GuiGrinder extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); String text = this.tileGrinder.storage.getEnergyStored()+"/"+this.tileGrinder.storage.getMaxEnergyStored()+" RF"; - if((this.isDouble && x >= guiLeft+14 && y >= guiTop+6 && x <= guiLeft+29 && y <= guiTop+88) || (!this.isDouble && x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88)){ + if((this.isDouble && x >= this.guiLeft+14 && y >= this.guiTop+6 && x <= this.guiLeft+29 && y <= this.guiTop+88) || (!this.isDouble && x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88)){ this.drawHoveringText(Collections.singletonList(text), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileGrinder.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileGrinder); } @Override @@ -64,16 +64,16 @@ public class GuiGrinder extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(this.isDouble ? resLocDouble : resLoc); + this.mc.getTextureManager().bindTexture(this.isDouble ? RES_LOC_DOUBLE : RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.tileGrinder.storage.getEnergyStored() > 0){ int i = this.tileGrinder.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+(isDouble ? 14 : 43), this.guiTop+89-i, 176, (isDouble ? 44 : 23), 16, i); + this.drawTexturedModalRect(this.guiLeft+(this.isDouble ? 14 : 43), this.guiTop+89-i, 176, (this.isDouble ? 44 : 23), 16, i); } if(this.tileGrinder.firstCrushTime > 0){ int i = this.tileGrinder.getFirstTimeToScale(23); - this.drawTexturedModalRect(this.guiLeft+(isDouble ? 51 : 80), this.guiTop+40, 176, 0, 24, i); + this.drawTexturedModalRect(this.guiLeft+(this.isDouble ? 51 : 80), this.guiTop+40, 176, 0, 24, i); } if(this.isDouble){ if(this.tileGrinder.secondCrushTime > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java index ba72bc1ff..7e6dcd7b1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java @@ -1,19 +1,18 @@ /* - * This file ("GuiInputter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiInputter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; import de.ellpeck.actuallyadditions.mod.inventory.ContainerInputter; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiButton; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiNumber; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInputter; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -25,8 +24,9 @@ import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -40,28 +40,28 @@ import java.util.List; public class GuiInputter extends GuiContainer{ public static final int OFFSET_ADVANCED = 12+36; - public static final String[] sideString = new String[]{ - StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.disabled"), - StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.up"), - StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.down"), - StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.north"), - StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.east"), - StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.south"), - StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.west")}; - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter"); - private static final ResourceLocation resLocAdvanced = AssetUtil.getGuiLocation("guiInputterAdvanced"); - public TileEntityInputter tileInputter; - private int x; - private int y; - private int z; - private World world; + public static final String[] SIDES = new String[]{ + StringUtil.localize("info."+ModUtil.MOD_ID+".gui.disabled"), + StringUtil.localize("info."+ModUtil.MOD_ID+".gui.up"), + StringUtil.localize("info."+ModUtil.MOD_ID+".gui.down"), + StringUtil.localize("info."+ModUtil.MOD_ID+".gui.north"), + StringUtil.localize("info."+ModUtil.MOD_ID+".gui.east"), + StringUtil.localize("info."+ModUtil.MOD_ID+".gui.south"), + StringUtil.localize("info."+ModUtil.MOD_ID+".gui.west")}; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiInputter"); + private static final ResourceLocation RES_LOC_ADVANCED = AssetUtil.getGuiLocation("guiInputterAdvanced"); + public final TileEntityInputter tileInputter; + private final int x; + private final int y; + private final int z; + private final World world; + private final boolean isAdvanced; private SmallerButton whitelistPut; private SmallerButton whitelistPull; private GuiTextField fieldPutStart; private GuiTextField fieldPutEnd; private GuiTextField fieldPullStart; private GuiTextField fieldPullEnd; - private boolean isAdvanced; public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world, boolean isAdvanced){ super(new ContainerInputter(inventory, tile, isAdvanced)); @@ -71,52 +71,50 @@ public class GuiInputter extends GuiContainer{ this.z = z; this.world = world; this.xSize = 176; - this.ySize = 93+86+(isAdvanced ? OFFSET_ADVANCED : 0); + this.ySize = 97+86+(isAdvanced ? OFFSET_ADVANCED : 0); this.isAdvanced = isAdvanced; } - @SuppressWarnings("unchecked") @Override public void initGui(){ super.initGui(); - this.fieldPullStart = new GuiTextField(3000, this.fontRendererObj, guiLeft+13, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8); - this.fieldPullStart.setMaxStringLength(4); + this.fieldPullStart = new GuiTextField(3000, this.fontRendererObj, this.guiLeft+6, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); + this.fieldPullStart.setMaxStringLength(5); this.fieldPullStart.setEnableBackgroundDrawing(false); - this.fieldPullEnd = new GuiTextField(3001, this.fontRendererObj, guiLeft+50, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8); - this.fieldPullEnd.setMaxStringLength(4); + this.fieldPullEnd = new GuiTextField(3001, this.fontRendererObj, this.guiLeft+50, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); + this.fieldPullEnd.setMaxStringLength(5); this.fieldPullEnd.setEnableBackgroundDrawing(false); - this.fieldPutStart = new GuiTextField(3002, this.fontRendererObj, guiLeft+98, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8); - this.fieldPutStart.setMaxStringLength(4); + this.fieldPutStart = new GuiTextField(3002, this.fontRendererObj, this.guiLeft+91, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); + this.fieldPutStart.setMaxStringLength(5); this.fieldPutStart.setEnableBackgroundDrawing(false); - this.fieldPutEnd = new GuiTextField(3004, this.fontRendererObj, guiLeft+135, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0), 27, 8); - this.fieldPutEnd.setMaxStringLength(4); + this.fieldPutEnd = new GuiTextField(3004, this.fontRendererObj, this.guiLeft+135, this.guiTop+80+(this.isAdvanced ? OFFSET_ADVANCED : 0), 34, 8); + this.fieldPutEnd.setMaxStringLength(5); this.fieldPutEnd.setEnableBackgroundDrawing(false); - SmallerButton buttonSidePutP = new SmallerButton(0, guiLeft+155, guiTop+43+(isAdvanced ? OFFSET_ADVANCED : 0), ">"); - SmallerButton buttonSidePutM = new SmallerButton(1, guiLeft+90, guiTop+43+(isAdvanced ? OFFSET_ADVANCED : 0), "<"); + SmallerButton buttonSidePutP = new SmallerButton(0, this.guiLeft+155, this.guiTop+43+(this.isAdvanced ? OFFSET_ADVANCED : 0), ">"); + SmallerButton buttonSidePutM = new SmallerButton(1, this.guiLeft+90, this.guiTop+43+(this.isAdvanced ? OFFSET_ADVANCED : 0), "<"); - SmallerButton buttonSidePullP = new SmallerButton(2, guiLeft+70, guiTop+43+(isAdvanced ? OFFSET_ADVANCED : 0), ">"); - SmallerButton buttonSidePullM = new SmallerButton(3, guiLeft+5, guiTop+43+(isAdvanced ? OFFSET_ADVANCED : 0), "<"); + SmallerButton buttonSidePullP = new SmallerButton(2, this.guiLeft+70, this.guiTop+43+(this.isAdvanced ? OFFSET_ADVANCED : 0), ">"); + SmallerButton buttonSidePullM = new SmallerButton(3, this.guiLeft+5, this.guiTop+43+(this.isAdvanced ? OFFSET_ADVANCED : 0), "<"); - whitelistPull = new SmallerButton(TileEntityInputter.WHITELIST_PULL_BUTTON_ID, guiLeft+3, guiTop+16, ""); - whitelistPut = new SmallerButton(TileEntityInputter.WHITELIST_PUT_BUTTON_ID, guiLeft+157, guiTop+16, ""); + this.whitelistPull = new SmallerButton(TileEntityInputter.WHITELIST_PULL_BUTTON_ID, this.guiLeft+3, this.guiTop+16, ""); + this.whitelistPut = new SmallerButton(TileEntityInputter.WHITELIST_PUT_BUTTON_ID, this.guiLeft+157, this.guiTop+16, ""); this.buttonList.add(buttonSidePutP); this.buttonList.add(buttonSidePullP); this.buttonList.add(buttonSidePutM); this.buttonList.add(buttonSidePullM); if(this.isAdvanced){ - this.buttonList.add(whitelistPut); - this.buttonList.add(whitelistPull); + this.buttonList.add(this.whitelistPut); + this.buttonList.add(this.whitelistPull); } - this.buttonList.add(new TinyButton(TileEntityInputter.OKAY_BUTTON_ID, guiLeft+84, guiTop+80+(isAdvanced ? OFFSET_ADVANCED : 0))); + this.buttonList.add(new TinyButton(TileEntityInputter.OKAY_BUTTON_ID, this.guiLeft+84, this.guiTop+91+(this.isAdvanced ? OFFSET_ADVANCED : 0))); } @Override - @SuppressWarnings("unchecked") public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); @@ -124,18 +122,18 @@ public class GuiInputter extends GuiContainer{ this.whitelistPut.displayString = this.tileInputter.isPutWhitelist ? "O" : "X"; if(this.isAdvanced){ - List infoList = this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.whitelistInfo"), 200); - String text1 = this.tileInputter.isPullWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); - if(x >= guiLeft+3 && y >= guiTop+16 && x <= guiLeft+18 && y <= guiTop+31){ + List infoList = this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.whitelistInfo"), 200); + String text1 = this.tileInputter.isPullWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist"); + if(x >= this.guiLeft+3 && y >= this.guiTop+16 && x <= this.guiLeft+18 && y <= this.guiTop+31){ ArrayList list = new ArrayList(); - list.add(EnumChatFormatting.BOLD+text1); + list.add(TextFormatting.BOLD+text1); list.addAll(infoList); this.drawHoveringText(list, x, y); } - String text2 = this.tileInputter.isPutWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); - if(x >= guiLeft+157 && y >= guiTop+16 && x <= guiLeft+172 && y <= guiTop+31){ + String text2 = this.tileInputter.isPutWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist"); + if(x >= this.guiLeft+157 && y >= this.guiTop+16 && x <= this.guiLeft+172 && y <= this.guiTop+31){ ArrayList list = new ArrayList(); - list.add(EnumChatFormatting.BOLD+text2); + list.add(TextFormatting.BOLD+text2); list.addAll(infoList); this.drawHoveringText(list, x, y); } @@ -143,23 +141,23 @@ public class GuiInputter extends GuiContainer{ int newTopOffset = this.guiTop+(this.isAdvanced ? OFFSET_ADVANCED : 0); //Info Mode on! - if(x >= guiLeft+11 && y >= newTopOffset+65 && x <= guiLeft+11+31 && y <= newTopOffset+65+12){ - this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("

", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull")), 200), x, y); + if(x >= this.guiLeft+4 && y >= newTopOffset+65 && x <= this.guiLeft+4+38 && y <= newTopOffset+65+12){ + this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.1").replace("

", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.pull")), 200), x, y); } - if(x >= guiLeft+96 && y >= newTopOffset+65 && x <= guiLeft+96+31 && y <= newTopOffset+65+12){ - this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.1").replace("

", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put")), 200), x, y); + if(x >= this.guiLeft+89 && y >= newTopOffset+65 && x <= this.guiLeft+89+38 && y <= newTopOffset+65+12){ + this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.1").replace("

", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.put")), 200), x, y); } - if(x >= guiLeft+48 && y >= newTopOffset+65 && x <= guiLeft+48+31 && y <= newTopOffset+65+12){ - this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("

", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull")), 200), x, y); + if(x >= this.guiLeft+48 && y >= newTopOffset+65 && x <= this.guiLeft+48+38 && y <= newTopOffset+65+12){ + this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.2").replace("

", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.pull")), 200), x, y); } - if(x >= guiLeft+133 && y >= newTopOffset+65 && x <= guiLeft+133+31 && y <= newTopOffset+65+12){ - this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".inputter.info.2").replace("

", StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put")), 200), x, y); + if(x >= this.guiLeft+133 && y >= newTopOffset+65 && x <= this.guiLeft+133+38 && y <= newTopOffset+65+12){ + this.drawHoveringText(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.info.2").replace("

", StringUtil.localize("info."+ModUtil.MOD_ID+".gui.put")), 200), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileInputter.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileInputter); } @Override @@ -167,21 +165,21 @@ public class GuiInputter extends GuiContainer{ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); - this.drawTexturedModalRect(this.guiLeft, this.guiTop+93+(isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86); + this.drawTexturedModalRect(this.guiLeft, this.guiTop+97+(this.isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(this.isAdvanced ? resLocAdvanced : resLoc); - this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93+(isAdvanced ? OFFSET_ADVANCED : 0)); + this.mc.getTextureManager().bindTexture(this.isAdvanced ? RES_LOC_ADVANCED : RES_LOC); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 97+(this.isAdvanced ? OFFSET_ADVANCED : 0)); - this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.pull"), guiLeft+22+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRendererObj.drawString(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.put"), guiLeft+107+3, guiTop+32+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRendererObj.drawString("INBOUND", this.guiLeft+23+3, this.guiTop+32+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRendererObj.drawString("OUTBOUND", this.guiLeft+104+3, this.guiTop+32+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft+24+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft+109+1, guiTop+45+3+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRendererObj.drawString(SIDES[this.tileInputter.sideToPull+1], this.guiLeft+24+1, this.guiTop+45+3+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRendererObj.drawString(SIDES[this.tileInputter.sideToPut+1], this.guiLeft+109+1, this.guiTop+45+3+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_GRAY_TEXT); - this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutStart), guiLeft+99, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutEnd), guiLeft+136, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullStart), guiLeft+14, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); - this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullEnd), guiLeft+51, guiTop+67+(isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); + this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutStart), this.guiLeft+92, this.guiTop+67+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); + this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPutEnd), this.guiLeft+136, this.guiTop+67+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); + this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullStart), this.guiLeft+7, this.guiTop+67+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); + this.fontRendererObj.drawString(Integer.toString(this.tileInputter.slotToPullEnd), this.guiLeft+51, this.guiTop+67+(this.isAdvanced ? OFFSET_ADVANCED : 0), StringUtil.DECIMAL_COLOR_WHITE); this.fieldPutStart.drawTextBox(); this.fieldPutEnd.drawTextBox(); @@ -238,13 +236,21 @@ public class GuiInputter extends GuiContainer{ public void setVariable(GuiTextField field, int sendInt){ if(!field.getText().isEmpty()){ - this.sendPacket(parse(field.getText()), sendInt); + this.sendPacket(this.parse(field.getText()), sendInt); field.setText(""); } } private void sendPacket(int text, int textID){ - PacketHandler.theNetwork.sendToServer(new PacketGuiNumber(x, y, z, world, text, textID, Minecraft.getMinecraft().thePlayer)); + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.x); + compound.setInteger("Y", this.y); + compound.setInteger("Z", this.z); + compound.setInteger("WorldID", this.world.provider.getDimension()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("NumberID", textID); + compound.setInteger("Number", text); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_NUMBER_TO_TILE_HANDLER)); } private int parse(String theInt){ @@ -265,10 +271,18 @@ public class GuiInputter extends GuiContainer{ this.setVariable(this.fieldPullEnd, 3); } else{ - PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer)); + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.x); + compound.setInteger("Y", this.y); + compound.setInteger("Z", this.z); + compound.setInteger("WorldID", this.world.provider.getDimension()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("ButtonID", button.id); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); } } + @SideOnly(Side.CLIENT) public static class SmallerButton extends GuiButton{ public final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter"); @@ -280,7 +294,7 @@ public class GuiInputter extends GuiContainer{ @Override public void drawButton(Minecraft mc, int x, int y){ if(this.visible){ - mc.getTextureManager().bindTexture(resLoc); + mc.getTextureManager().bindTexture(this.resLoc); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; int k = this.getHoverState(this.hovered); @@ -291,8 +305,8 @@ public class GuiInputter extends GuiContainer{ this.mouseDragged(mc, x, y); int color = 14737632; - if(packedFGColour != 0){ - color = packedFGColour; + if(this.packedFGColour != 0){ + color = this.packedFGColour; } else if(!this.enabled){ color = 10526880; @@ -306,6 +320,7 @@ public class GuiInputter extends GuiContainer{ } } + @SideOnly(Side.CLIENT) public static class TinyButton extends GuiButton{ public final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter"); @@ -317,7 +332,7 @@ public class GuiInputter extends GuiContainer{ @Override public void drawButton(Minecraft mc, int x, int y){ if(this.visible){ - mc.getTextureManager().bindTexture(resLoc); + mc.getTextureManager().bindTexture(this.resLoc); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; int k = this.getHoverState(this.hovered); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java new file mode 100644 index 000000000..52d43326c --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java @@ -0,0 +1,130 @@ +/* + * This file ("GuiLaserRelayItemWhitelist.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.inventory.gui; + +import de.ellpeck.actuallyadditions.mod.inventory.ContainerLaserRelayItemWhitelist; +import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiInputter.SmallerButton; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; +import de.ellpeck.actuallyadditions.mod.network.PacketHandler; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItemWhitelist; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.List; + +@SideOnly(Side.CLIENT) +public class GuiLaserRelayItemWhitelist extends GuiContainer{ + + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiLaserRelayItemWhitelist"); + private final TileEntityLaserRelayItemWhitelist tile; + + private SmallerButton whitelistLeft; + private SmallerButton whitelistRight; + + public GuiLaserRelayItemWhitelist(InventoryPlayer inventory, TileEntityBase tile){ + super(new ContainerLaserRelayItemWhitelist(inventory, tile)); + this.tile = (TileEntityLaserRelayItemWhitelist)tile; + this.xSize = 176; + this.ySize = 93+86; + } + + @Override + public void initGui(){ + super.initGui(); + + this.whitelistLeft = new SmallerButton(0, this.guiLeft+3, this.guiTop+16, ""); + this.whitelistRight = new SmallerButton(1, this.guiLeft+157, this.guiTop+16, ""); + SmallerButton smartWhitelistLeft = new SmallerButton(2, this.guiLeft+3, this.guiTop+34, "S"); + SmallerButton smartWhitelistRight = new SmallerButton(3, this.guiLeft+157, this.guiTop+34, "S"); + + this.buttonList.add(this.whitelistLeft); + this.buttonList.add(this.whitelistRight); + this.buttonList.add(smartWhitelistLeft); + this.buttonList.add(smartWhitelistRight); + } + + @Override + public void actionPerformed(GuiButton button){ + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.tile.getPos().getX()); + compound.setInteger("Y", this.tile.getPos().getY()); + compound.setInteger("Z", this.tile.getPos().getZ()); + compound.setInteger("WorldID", this.tile.getWorld().provider.getDimension()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("ButtonID", button.id); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); + } + + @Override + public void drawScreen(int x, int y, float f){ + super.drawScreen(x, y, f); + + this.whitelistLeft.displayString = this.tile.isLeftWhitelist ? "O" : "X"; + this.whitelistRight.displayString = this.tile.isRightWhitelist ? "O" : "X"; + + List infoList = this.fontRendererObj.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".inputter.whitelistInfo"), 200); + String text1 = this.tile.isLeftWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist"); + if(x >= this.guiLeft+3 && y >= this.guiTop+16 && x <= this.guiLeft+18 && y <= this.guiTop+31){ + ArrayList list = new ArrayList(); + list.add(TextFormatting.BOLD+text1); + list.addAll(infoList); + this.drawHoveringText(list, x, y); + } + String text2 = this.tile.isRightWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist"); + if(x >= this.guiLeft+157 && y >= this.guiTop+16 && x <= this.guiLeft+172 && y <= this.guiTop+31){ + ArrayList list = new ArrayList(); + list.add(TextFormatting.BOLD+text2); + list.addAll(infoList); + this.drawHoveringText(list, x, y); + } + if(((x >= this.guiLeft+3 && x <= this.guiLeft+3+15) || (x >= this.guiLeft+157 && x <= this.guiLeft+157+15)) && y <= this.guiTop+34+15 && y >= this.guiTop+34){ + List list = new ArrayList(); + list.add(TextFormatting.BOLD+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.smart")); + list.addAll(this.fontRendererObj.listFormattedStringToWidth(StringUtil.localize("info."+ModUtil.MOD_ID+".gui.smartInfo"), 200)); + this.drawHoveringText(list, x, y); + } + } + + @Override + public void drawGuiContainerForegroundLayer(int x, int y){ + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tile); + + String s1 = "INBOUND"; + String s2 = "OUTBOUND"; + this.fontRendererObj.drawString(s1, 46-this.fontRendererObj.getStringWidth(s1)/2, 80, StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRendererObj.drawString(s2, 131-this.fontRendererObj.getStringWidth(s2)/2, 80, StringUtil.DECIMAL_COLOR_GRAY_TEXT); + } + + @Override + public void drawGuiContainerBackgroundLayer(float f, int x, int y){ + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); + this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); + + this.mc.getTextureManager().bindTexture(RES_LOC); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); + + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java index f3ab98257..026bc51a6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java @@ -1,18 +1,18 @@ /* - * This file ("GuiMiner.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiMiner.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; import de.ellpeck.actuallyadditions.mod.inventory.ContainerMiner; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiButton; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -22,6 +22,7 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -29,8 +30,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiMiner extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBreaker"); - private TileEntityMiner miner; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiBreaker"); + private final TileEntityMiner miner; public GuiMiner(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerMiner(inventory, tile)); @@ -39,26 +40,20 @@ public class GuiMiner extends GuiContainer{ this.ySize = 93+86; } - @SuppressWarnings("unchecked") @Override public void initGui(){ super.initGui(); - GuiButton buttonMode = new GuiButton(0, guiLeft+xSize/2-51, guiTop+75, 50, 20, "Mode"); + GuiButton buttonMode = new GuiButton(0, this.guiLeft+this.xSize/2-51, this.guiTop+75, 50, 20, "Mode"); this.buttonList.add(buttonMode); - GuiButton buttonReset = new GuiButton(1, guiLeft+xSize/2+1, guiTop+75, 50, 20, "Reset"); + GuiButton buttonReset = new GuiButton(1, this.guiLeft+this.xSize/2+1, this.guiTop+75, 50, 20, "Reset"); this.buttonList.add(buttonReset); } - @Override - public void drawScreen(int x, int y, float f){ - super.drawScreen(x, y, f); - } - @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.miner.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.miner); } @Override @@ -68,15 +63,22 @@ public class GuiMiner extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); String mining = this.miner.onlyMineOres ? "Only Mining Ores" : "Mining Everything"; - this.fontRendererObj.drawString(mining, this.guiLeft+this.xSize/2-fontRendererObj.getStringWidth(mining)/2, guiTop+8, StringUtil.DECIMAL_COLOR_GRAY_TEXT); + this.fontRendererObj.drawString(mining, this.guiLeft+this.xSize/2-this.fontRendererObj.getStringWidth(mining)/2, this.guiTop+8, StringUtil.DECIMAL_COLOR_GRAY_TEXT); } @Override public void actionPerformed(GuiButton button){ - PacketHandler.theNetwork.sendToServer(new PacketGuiButton(miner.getPos().getX(), miner.getPos().getY(), miner.getPos().getZ(), miner.getWorld(), button.id, Minecraft.getMinecraft().thePlayer)); + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.miner.getPos().getX()); + compound.setInteger("Y", this.miner.getPos().getY()); + compound.setInteger("Z", this.miner.getPos().getZ()); + compound.setInteger("WorldID", this.miner.getWorld().provider.getDimension()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("ButtonID", button.id); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java index 93dee8c80..0a6cf6942 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java @@ -1,11 +1,11 @@ /* - * This file ("GuiOilGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiOilGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -27,8 +27,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiOilGenerator extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiOilGenerator"); - private TileEntityOilGenerator generator; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiOilGenerator"); + private final TileEntityOilGenerator generator; public GuiOilGenerator(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerOilGenerator(inventory, tile)); @@ -41,18 +41,18 @@ public class GuiOilGenerator extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ + if(x >= this.guiLeft+43 && y >= this.guiTop+6 && x <= this.guiLeft+58 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text1), x, y); } String text2 = StringUtil.getFluidInfo(this.generator.tank); - if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ + if(x >= this.guiLeft+117 && y >= this.guiTop+6 && x <= this.guiLeft+132 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text2), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.generator.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.generator); } @Override @@ -62,22 +62,22 @@ public class GuiOilGenerator extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.generator.storage.getEnergyStored() > 0){ int i = this.generator.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i); + this.drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 0, 16, i); } if(this.generator.tank.getFluidAmount() > 0){ int i = this.generator.getTankScaled(83); - drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 0, 16, i); + this.drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 0, 16, i); } if(this.generator.currentBurnTime > 0){ int i = this.generator.getBurningScaled(13); - this.drawTexturedModalRect(guiLeft+72, guiTop+44+12-i, 176, 96-i, 14, i); + this.drawTexturedModalRect(this.guiLeft+72, this.guiTop+44+12-i, 176, 96-i, 14, i); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java index 58b2a48ef..95016976e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java @@ -1,11 +1,11 @@ /* - * This file ("GuiPhantomPlacer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiPhantomPlacer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -24,8 +24,8 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiPhantomPlacer extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBreaker"); - private TileEntityPhantomPlacer placer; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiBreaker"); + private final TileEntityPhantomPlacer placer; public GuiPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerPhantomPlacer(inventory, tile)); @@ -34,14 +34,9 @@ public class GuiPhantomPlacer extends GuiContainer{ this.ySize = 93+86; } - @Override - public void drawScreen(int x, int y, float f){ - super.drawScreen(x, y, f); - } - @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.placer.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.placer); } @Override @@ -51,7 +46,7 @@ public class GuiPhantomPlacer extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java index feb847d8a..25ab78282 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java @@ -1,18 +1,18 @@ /* - * This file ("GuiRangedCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiRangedCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; import de.ellpeck.actuallyadditions.mod.inventory.ContainerRangedCollector; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiButton; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -23,6 +23,7 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -33,16 +34,14 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiRangedCollector extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiRangedCollector"); - private TileEntityRangedCollector collector; - + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiRangedCollector"); + private final TileEntityRangedCollector collector; + private final int x; + private final int y; + private final int z; + private final World world; private GuiInputter.SmallerButton whitelistButton; - private int x; - private int y; - private int z; - private World world; - public GuiRangedCollector(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world){ super(new ContainerRangedCollector(inventory, tile)); this.collector = (TileEntityRangedCollector)tile; @@ -54,31 +53,29 @@ public class GuiRangedCollector extends GuiContainer{ this.world = world; } - @SuppressWarnings("unchecked") @Override public void initGui(){ super.initGui(); - this.whitelistButton = new GuiInputter.SmallerButton(0, guiLeft+3, guiTop+16, ""); + this.whitelistButton = new GuiInputter.SmallerButton(0, this.guiLeft+3, this.guiTop+16, ""); this.buttonList.add(this.whitelistButton); } @Override - @SuppressWarnings("unchecked") public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); this.whitelistButton.displayString = this.collector.isWhitelist ? "O" : "X"; - String text1 = this.collector.isWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.blacklist"); - if(x >= guiLeft+3 && y >= guiTop+16 && x <= guiLeft+18 && y <= guiTop+31){ + String text1 = this.collector.isWhitelist ? StringUtil.localize("info."+ModUtil.MOD_ID+".gui.whitelist") : StringUtil.localize("info."+ModUtil.MOD_ID+".gui.blacklist"); + if(x >= this.guiLeft+3 && y >= this.guiTop+16 && x <= this.guiLeft+18 && y <= this.guiTop+31){ this.drawHoveringText(Collections.singletonList(text1), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.collector.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.collector); } @Override @@ -88,12 +85,19 @@ public class GuiRangedCollector extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+86, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 86); } @Override public void actionPerformed(GuiButton button){ - PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer)); + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.x); + compound.setInteger("Y", this.y); + compound.setInteger("Z", this.z); + compound.setInteger("WorldID", this.world.provider.getDimension()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("ButtonID", button.id); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java index 6af9383b3..530df742b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java @@ -1,11 +1,11 @@ /* - * This file ("GuiRepairer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiRepairer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; @@ -26,8 +26,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiRepairer extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiRepairer"); - private TileEntityItemRepairer tileRepairer; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiRepairer"); + private final TileEntityItemRepairer tileRepairer; public GuiRepairer(InventoryPlayer inventory, TileEntityBase tile){ super(new ContainerRepairer(inventory, tile)); @@ -40,14 +40,14 @@ public class GuiRepairer extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); String text = this.tileRepairer.storage.getEnergyStored()+"/"+this.tileRepairer.storage.getMaxEnergyStored()+" RF"; - if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ + if(x >= this.guiLeft+28 && y >= this.guiTop+6 && x <= this.guiLeft+43 && y <= this.guiTop+88){ this.drawHoveringText(Collections.singletonList(text), x, y); } } @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.tileRepairer.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.tileRepairer); } @Override @@ -57,12 +57,12 @@ public class GuiRepairer extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.tileRepairer.storage.getEnergyStored() > 0){ int i = this.tileRepairer.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft+28, this.guiTop+89-i, 176, 44, 16, i); + this.drawTexturedModalRect(this.guiLeft+28, this.guiTop+89-i, 176, 44, 16, i); } if(TileEntityItemRepairer.canBeRepaired(this.tileRepairer.slots[TileEntityItemRepairer.SLOT_INPUT])){ int i = this.tileRepairer.getItemDamageToScale(22); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java index 3ec364c7b..5238f6ea4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java @@ -1,18 +1,18 @@ /* - * This file ("GuiSmileyCloud.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiSmileyCloud.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; import de.ellpeck.actuallyadditions.mod.inventory.ContainerSmileyCloud; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiString; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -22,8 +22,9 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -34,17 +35,15 @@ import java.io.IOException; @SideOnly(Side.CLIENT) public class GuiSmileyCloud extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiSmileyCloud"); - - private int x; - private int y; - private int z; - private World world; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiSmileyCloud"); + private final int x; + private final int y; + private final int z; + private final World world; + private final TileEntitySmileyCloud cloud; private GuiTextField nameField; - private TileEntitySmileyCloud cloud; - public GuiSmileyCloud(TileEntityBase tile, int x, int y, int z, World world){ super(new ContainerSmileyCloud()); this.cloud = (TileEntitySmileyCloud)tile; @@ -56,35 +55,28 @@ public class GuiSmileyCloud extends GuiContainer{ this.ySize = 20; } - @SuppressWarnings("unchecked") @Override public void initGui(){ super.initGui(); - this.nameField = new GuiTextField(4000, this.fontRendererObj, guiLeft+5, guiTop+6, 114, 8); + this.nameField = new GuiTextField(4000, this.fontRendererObj, this.guiLeft+5, this.guiTop+6, 114, 8); this.nameField.setMaxStringLength(20); this.nameField.setEnableBackgroundDrawing(false); this.nameField.setFocused(true); } - @Override - @SuppressWarnings("unchecked") - public void drawScreen(int x, int y, float f){ - super.drawScreen(x, y, f); - } - @Override public void drawGuiContainerForegroundLayer(int x, int y){ - String name = cloud.name == null || cloud.name.isEmpty() ? "" : EnumChatFormatting.GOLD+cloud.name+EnumChatFormatting.RESET+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.the")+" "; - String localizedName = name+StringUtil.localize("container."+ModUtil.MOD_ID_LOWER+".cloud.name"); - this.fontRendererObj.drawString(localizedName, xSize/2-this.fontRendererObj.getStringWidth(localizedName)/2, -10, StringUtil.DECIMAL_COLOR_WHITE); + String name = this.cloud.name == null || this.cloud.name.isEmpty() ? "" : TextFormatting.GOLD+this.cloud.name+TextFormatting.RESET+" "+StringUtil.localize("info."+ModUtil.MOD_ID+".gui.the")+" "; + String localizedName = name+StringUtil.localize("container."+ModUtil.MOD_ID+".cloud.name"); + this.fontRendererObj.drawString(localizedName, this.xSize/2-this.fontRendererObj.getStringWidth(localizedName)/2, -10, StringUtil.DECIMAL_COLOR_WHITE); } @Override public void drawGuiContainerBackgroundLayer(float f, int x, int y){ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); this.nameField.drawTextBox(); @@ -123,6 +115,14 @@ public class GuiSmileyCloud extends GuiContainer{ } private void sendPacket(String text, int textID){ - PacketHandler.theNetwork.sendToServer(new PacketGuiString(x, y, z, world, text, textID, Minecraft.getMinecraft().thePlayer)); + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.x); + compound.setInteger("Y", this.y); + compound.setInteger("Z", this.z); + compound.setInteger("WorldID", this.world.provider.getDimension()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("TextID", textID); + compound.setString("Text", text); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java index ef38f3511..089ffc6f1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java @@ -1,18 +1,18 @@ /* - * This file ("GuiXPSolidifier.java") is part of the Actually Additions Mod for Minecraft. + * This file ("GuiXPSolidifier.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.gui; import de.ellpeck.actuallyadditions.mod.inventory.ContainerXPSolidifier; +import de.ellpeck.actuallyadditions.mod.network.PacketClientToServer; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiButton; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; @@ -22,6 +22,7 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; @@ -30,12 +31,12 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiXPSolidifier extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiXPSolidifier"); - private TileEntityXPSolidifier solidifier; - private int x; - private int y; - private int z; - private World world; + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiXPSolidifier"); + private final TileEntityXPSolidifier solidifier; + private final int x; + private final int y; + private final int z; + private final World world; public GuiXPSolidifier(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world){ super(new ContainerXPSolidifier(inventory, tile)); @@ -48,20 +49,19 @@ public class GuiXPSolidifier extends GuiContainer{ this.world = world; } - @SuppressWarnings("unchecked") @Override public void initGui(){ super.initGui(); - GuiButton buttonOne = new GuiInputter.SmallerButton(0, guiLeft+62, guiTop+44, "1"); - GuiButton buttonFive = new GuiInputter.SmallerButton(1, guiLeft+80, guiTop+44, "5"); - GuiButton buttonTen = new GuiInputter.SmallerButton(2, guiLeft+99, guiTop+44, "10"); - GuiButton buttonTwenty = new GuiInputter.SmallerButton(3, guiLeft+62, guiTop+61, "20"); - GuiButton buttonThirty = new GuiInputter.SmallerButton(4, guiLeft+80, guiTop+61, "30"); - GuiButton buttonForty = new GuiInputter.SmallerButton(5, guiLeft+99, guiTop+61, "40"); - GuiButton buttonFifty = new GuiInputter.SmallerButton(6, guiLeft+62, guiTop+78, "50"); - GuiButton buttonSixtyFour = new GuiInputter.SmallerButton(7, guiLeft+80, guiTop+78, "64"); - GuiButton buttonAll = new GuiInputter.SmallerButton(8, guiLeft+99, guiTop+78, "All"); + GuiButton buttonOne = new GuiInputter.SmallerButton(0, this.guiLeft+62, this.guiTop+44, "1"); + GuiButton buttonFive = new GuiInputter.SmallerButton(1, this.guiLeft+80, this.guiTop+44, "5"); + GuiButton buttonTen = new GuiInputter.SmallerButton(2, this.guiLeft+99, this.guiTop+44, "10"); + GuiButton buttonTwenty = new GuiInputter.SmallerButton(3, this.guiLeft+62, this.guiTop+61, "20"); + GuiButton buttonThirty = new GuiInputter.SmallerButton(4, this.guiLeft+80, this.guiTop+61, "30"); + GuiButton buttonForty = new GuiInputter.SmallerButton(5, this.guiLeft+99, this.guiTop+61, "40"); + GuiButton buttonFifty = new GuiInputter.SmallerButton(6, this.guiLeft+62, this.guiTop+78, "50"); + GuiButton buttonSixtyFour = new GuiInputter.SmallerButton(7, this.guiLeft+80, this.guiTop+78, "64"); + GuiButton buttonAll = new GuiInputter.SmallerButton(8, this.guiLeft+99, this.guiTop+78, "All"); this.buttonList.add(buttonOne); this.buttonList.add(buttonFive); @@ -74,14 +74,9 @@ public class GuiXPSolidifier extends GuiContainer{ this.buttonList.add(buttonAll); } - @Override - public void drawScreen(int x, int y, float f){ - super.drawScreen(x, y, f); - } - @Override public void drawGuiContainerForegroundLayer(int x, int y){ - AssetUtil.displayNameString(this.fontRendererObj, xSize, -10, this.solidifier.getName()); + AssetUtil.displayNameString(this.fontRendererObj, this.xSize, -10, this.solidifier); } @Override @@ -91,15 +86,23 @@ public class GuiXPSolidifier extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); - this.drawCenteredString(this.fontRendererObj, Integer.toString(this.solidifier.amount), guiLeft+88, guiTop+30, StringUtil.DECIMAL_COLOR_WHITE); + this.drawCenteredString(this.fontRendererObj, Integer.toString(this.solidifier.amount), this.guiLeft+88, this.guiTop+30, StringUtil.DECIMAL_COLOR_WHITE); } @Override public void actionPerformed(GuiButton button){ - PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer)); + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.x); + compound.setInteger("Y", this.y); + compound.setInteger("Z", this.z); + compound.setInteger("WorldID", this.world.provider.getDimension()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("ButtonID", button.id); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); + this.solidifier.onButtonPressed(button.id, Minecraft.getMinecraft().thePlayer); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotFilter.java index 77042179f..d79532795 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotFilter.java @@ -1,11 +1,11 @@ /* - * This file ("SlotFilter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("SlotFilter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.slot; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotImmovable.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotImmovable.java index 91e13df92..d4e95e199 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotImmovable.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotImmovable.java @@ -1,11 +1,11 @@ /* - * This file ("SlotImmovable.java") is part of the Actually Additions Mod for Minecraft. + * This file ("SlotImmovable.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.slot; @@ -31,6 +31,7 @@ public class SlotImmovable extends Slot{ } + @Override public ItemStack decrStackSize(int i){ return null; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotOutput.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotOutput.java index 98b004186..1cd4ed9ca 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotOutput.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/slot/SlotOutput.java @@ -1,11 +1,11 @@ /* - * This file ("SlotOutput.java") is part of the Actually Additions Mod for Minecraft. + * This file ("SlotOutput.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.inventory.slot; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitForeignPaxels.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitForeignPaxels.java index 281ca1ec4..6bb6368b2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitForeignPaxels.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitForeignPaxels.java @@ -1,11 +1,11 @@ /* - * This file ("InitForeignPaxels.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitForeignPaxels.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -14,10 +14,9 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; import de.ellpeck.actuallyadditions.mod.crafting.ToolCrafting; import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.items.base.ItemAllToolAA; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; +import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemTool; @@ -25,12 +24,14 @@ import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapelessOreRecipe; -public class InitForeignPaxels{ +public final class InitForeignPaxels{ public static final int[] MT_COLORS = new int[]{4166, 2248890, 8882649, 12410135, 11451392, 3684412}; public static final String[] MT_NAMES = new String[]{"Obsidian", "LapisLazuli", "Osmium", "Bronze", "Glowstone", "Steel"}; public static final int[] TF_COLORS = new int[]{13332762, 5407943, 5407895, 5394789, 12960613, 12960653, 12410135, 2999795, 10143162}; public static final int[] SO_COLORS = new int[]{9409450, 2040021, 5714944, 526344, 545032}; + public static final Item[] TF_PAXELS = new Item[9]; + public static final Item[] SO_PAXELS = new Item[5]; //MekanismTools private static final String MEKANISM_TOOLS = "MekanismTools"; private static final String[] MT_REPAIR_NAMES = new String[]{"ingotRefinedObsidian", "gemLapis", "ingotOsmium", "ingotBronze", "ingotRefinedGlowstone", "ingotSteel"}; @@ -41,9 +42,7 @@ public class InitForeignPaxels{ private static final String SIMPLE_ORES = "simpleores"; private static final String[] SO_NAMES = new String[]{"tin", "mythril", "copper", "onyx", "adamantium"}; private static final String[] SO_REPAIR_NAMES = new String[]{"ingotTin", "ingotMythril", "ingotCopper", "gemOnyx", "ingotAdamantium"}; - public static Item[] tfPaxels = new Item[9]; - public static Item[] soPaxels = new Item[5]; - private static Item[] mtPaxels = new Item[6]; + private static final Item[] MT_PAXELS = new Item[6]; public static void init(){ //SimpleOres @@ -51,7 +50,7 @@ public class InitForeignPaxels{ if(Loader.isModLoaded(SIMPLE_ORES)){ ModUtil.LOGGER.info("Initializing "+SIMPLE_ORES+" AIOTs..."); - for(int i = 0; i < soPaxels.length; i++){ + for(int i = 0; i < SO_PAXELS.length; i++){ Item axe = ItemUtil.getItemFromName(SIMPLE_ORES+":"+SO_NAMES[i]+"_axe"); Item pickaxe = ItemUtil.getItemFromName(SIMPLE_ORES+":"+SO_NAMES[i]+"_pickaxe"); Item hoe = ItemUtil.getItemFromName(SIMPLE_ORES+":"+SO_NAMES[i]+"_hoe"); @@ -60,11 +59,11 @@ public class InitForeignPaxels{ if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){ Item.ToolMaterial material = ((ItemTool)axe).getToolMaterial(); - soPaxels[i] = new ItemAllToolAA(material, SO_REPAIR_NAMES[i], "paxelSO"+SO_NAMES[i], EnumRarity.RARE, SO_COLORS[i]); + SO_PAXELS[i] = new ItemAllToolAA(material, SO_REPAIR_NAMES[i], "paxelSO"+SO_NAMES[i], EnumRarity.RARE, SO_COLORS[i]); if(ConfigCrafting.PAXELS.isEnabled()){ - GameRegistry.addRecipe(new ShapelessOreRecipe(soPaxels[i], axe, pickaxe, hoe, sword, shovel)); - ToolCrafting.recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + GameRegistry.addRecipe(new ShapelessOreRecipe(SO_PAXELS[i], axe, pickaxe, hoe, sword, shovel)); + ToolCrafting.RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); } } } @@ -79,7 +78,7 @@ public class InitForeignPaxels{ if(Loader.isModLoaded(MEKANISM_TOOLS)){ ModUtil.LOGGER.info("Initializing "+MEKANISM_TOOLS+" AIOTs..."); - for(int i = 0; i < mtPaxels.length; i++){ + for(int i = 0; i < MT_PAXELS.length; i++){ Item axe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+MT_NAMES[i]+"Axe"); Item pickaxe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+MT_NAMES[i]+"Pickaxe"); Item hoe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+MT_NAMES[i]+"Hoe"); @@ -88,11 +87,11 @@ public class InitForeignPaxels{ if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){ Item.ToolMaterial material = ((ItemTool)axe).getToolMaterial(); - mtPaxels[i] = new ItemAllToolAA(material, MT_REPAIR_NAMES[i], "paxelMT"+MT_NAMES[i], EnumRarity.RARE, MT_COLORS[i]); + MT_PAXELS[i] = new ItemAllToolAA(material, MT_REPAIR_NAMES[i], "paxelMT"+MT_NAMES[i], EnumRarity.RARE, MT_COLORS[i]); if(ConfigCrafting.PAXELS.isEnabled()){ - GameRegistry.addRecipe(new ShapelessOreRecipe(mtPaxels[i], axe, pickaxe, hoe, sword, shovel)); - ToolCrafting.recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + GameRegistry.addRecipe(new ShapelessOreRecipe(MT_PAXELS[i], axe, pickaxe, hoe, sword, shovel)); + ToolCrafting.RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); } } } @@ -107,7 +106,7 @@ public class InitForeignPaxels{ if(Loader.isModLoaded(THERMAL_FOUNDATION)){ ModUtil.LOGGER.info("Initializing "+THERMAL_FOUNDATION+" AIOTs..."); - for(int i = 0; i < tfPaxels.length; i++){ + for(int i = 0; i < TF_PAXELS.length; i++){ Item axe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.axe"+TF_NAMES[i]); Item pickaxe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.pickaxe"+TF_NAMES[i]); Item hoe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.hoe"+TF_NAMES[i]); @@ -116,11 +115,11 @@ public class InitForeignPaxels{ if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){ Item.ToolMaterial material = ((ItemTool)axe).getToolMaterial(); - tfPaxels[i] = new ItemAllToolAA(material, "ingot"+TF_NAMES[i], "paxelTF"+TF_NAMES[i], EnumRarity.RARE, TF_COLORS[i]); + TF_PAXELS[i] = new ItemAllToolAA(material, "ingot"+TF_NAMES[i], "paxelTF"+TF_NAMES[i], EnumRarity.RARE, TF_COLORS[i]); if(ConfigCrafting.PAXELS.isEnabled()){ - GameRegistry.addRecipe(new ShapelessOreRecipe(tfPaxels[i], axe, pickaxe, hoe, sword, shovel)); - ToolCrafting.recipesPaxels.add(Util.GetRecipes.lastIRecipe()); + GameRegistry.addRecipe(new ShapelessOreRecipe(TF_PAXELS[i], axe, pickaxe, hoe, sword, shovel)); + ToolCrafting.RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); } } } @@ -132,19 +131,19 @@ public class InitForeignPaxels{ } public static void addToCreativeTab(){ - for(Item item : tfPaxels){ + for(Item item : TF_PAXELS){ if(item != null){ - CreativeTab.instance.add(item); + CreativeTab.INSTANCE.add(item); } } - for(Item item : mtPaxels){ + for(Item item : MT_PAXELS){ if(item != null){ - CreativeTab.instance.add(item); + CreativeTab.INSTANCE.add(item); } } - for(Item item : soPaxels){ + for(Item item : SO_PAXELS){ if(item != null){ - CreativeTab.instance.add(item); + CreativeTab.INSTANCE.add(item); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java index 6ccded60d..6ed36ad59 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java @@ -1,36 +1,36 @@ /* - * This file ("InitItems.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitItems.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.base.*; import de.ellpeck.actuallyadditions.mod.items.lens.ItemLens; -import de.ellpeck.actuallyadditions.mod.items.lens.Lenses; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.material.InitArmorMaterials; import de.ellpeck.actuallyadditions.mod.material.InitToolMaterials; -import de.ellpeck.actuallyadditions.mod.util.CompatUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.init.MobEffects; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraft.potion.PotionEffect; -public class InitItems{ +public final class InitItems{ public static Item itemBooklet; @@ -89,8 +89,6 @@ public class InitItems{ public static Item itemCoffeeSeed; public static Item itemResonantRice; - public static Item itemBucketOil; - public static Item itemBucketCanolaOil; public static Item itemPhantomConnector; @@ -133,6 +131,8 @@ public class InitItems{ public static Item itemChestToCrateUpgrade; public static Item itemCrateKeeper; + public static Item itemSpawnerChanger; + public static Item itemLaserWrench; public static Item itemCrystal; public static Item itemColorLens; @@ -205,14 +205,20 @@ public class InitItems{ public static Item itemBootsCrystalWhite; public static Item itemPaxelCrystalWhite; + public static Item itemWaterBowl; + public static Item itemFilter; + public static void init(){ ModUtil.LOGGER.info("Initializing Items..."); + itemFilter = new ItemFilter("itemFilter"); + itemWaterBowl = new ItemWaterBowl("itemWaterBowl"); + itemSpawnerChanger = new ItemSpawnerChanger("itemSpawnerChanger"); itemMisc = new ItemMisc("itemMisc"); - itemCrateKeeper = new ItemGeneric("itemCrateKeeper"); - itemColorLens = new ItemLens("itemColorLens", Lenses.LENS_COLOR); - itemExplosionLens = new ItemLens("itemExplosionLens", Lenses.LENS_DETONATION); - itemDamageLens = new ItemLens("itemDamageLens", Lenses.LENS_DEATH); + itemCrateKeeper = new ItemGeneric("itemCrateKeeper").setMaxStackSize(1); + itemColorLens = new ItemLens("itemColorLens", ActuallyAdditionsAPI.lensColor); + itemExplosionLens = new ItemLens("itemExplosionLens", ActuallyAdditionsAPI.lensDetonation); + itemDamageLens = new ItemLens("itemDamageLens", ActuallyAdditionsAPI.lensDeath); itemCrystal = new ItemCrystal("itemCrystal"); itemLaserWrench = new ItemLaserWrench("itemLaserWrench"); itemChestToCrateUpgrade = new ItemChestToCrateUpgrade("itemChestToCrateUpgrade"); @@ -220,18 +226,18 @@ public class InitItems{ itemGrowthRing = new ItemGrowthRing("itemGrowthRing"); itemMagnetRing = new ItemMagnetRing("itemSuctionRing"); itemWaterRemovalRing = new ItemWaterRemovalRing("itemWaterRemovalRing"); - itemHelmEmerald = new ItemArmorAA("itemHelmEmerald", InitArmorMaterials.armorMaterialEmerald, 0, new ItemStack(Items.emerald), "armorEmerald"); - itemChestEmerald = new ItemArmorAA("itemChestEmerald", InitArmorMaterials.armorMaterialEmerald, 1, new ItemStack(Items.emerald), "armorEmerald"); - itemPantsEmerald = new ItemArmorAA("itemPantsEmerald", InitArmorMaterials.armorMaterialEmerald, 2, new ItemStack(Items.emerald), "armorEmerald"); - itemBootsEmerald = new ItemArmorAA("itemBootsEmerald", InitArmorMaterials.armorMaterialEmerald, 3, new ItemStack(Items.emerald), "armorEmerald"); - itemHelmObsidian = new ItemArmorAA("itemHelmObsidian", InitArmorMaterials.armorMaterialObsidian, 0, new ItemStack(Blocks.obsidian), "armorObsidian"); - itemChestObsidian = new ItemArmorAA("itemChestObsidian", InitArmorMaterials.armorMaterialObsidian, 1, new ItemStack(Blocks.obsidian), "armorObsidian"); - itemPantsObsidian = new ItemArmorAA("itemPantsObsidian", InitArmorMaterials.armorMaterialObsidian, 2, new ItemStack(Blocks.obsidian), "armorObsidian"); - itemBootsObsidian = new ItemArmorAA("itemBootsObsidian", InitArmorMaterials.armorMaterialObsidian, 3, new ItemStack(Blocks.obsidian), "armorObsidian"); - itemHelmQuartz = new ItemArmorAA("itemHelmQuartz", InitArmorMaterials.armorMaterialQuartz, 0, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "armorQuartz"); - itemChestQuartz = new ItemArmorAA("itemChestQuartz", InitArmorMaterials.armorMaterialQuartz, 1, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "armorQuartz"); - itemPantsQuartz = new ItemArmorAA("itemPantsQuartz", InitArmorMaterials.armorMaterialQuartz, 2, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "armorQuartz"); - itemBootsQuartz = new ItemArmorAA("itemBootsQuartz", InitArmorMaterials.armorMaterialQuartz, 3, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "armorQuartz"); + itemHelmEmerald = new ItemArmorAA("itemHelmEmerald", InitArmorMaterials.armorMaterialEmerald, 0, new ItemStack(Items.EMERALD)); + itemChestEmerald = new ItemArmorAA("itemChestEmerald", InitArmorMaterials.armorMaterialEmerald, 1, new ItemStack(Items.EMERALD)); + itemPantsEmerald = new ItemArmorAA("itemPantsEmerald", InitArmorMaterials.armorMaterialEmerald, 2, new ItemStack(Items.EMERALD)); + itemBootsEmerald = new ItemArmorAA("itemBootsEmerald", InitArmorMaterials.armorMaterialEmerald, 3, new ItemStack(Items.EMERALD)); + itemHelmObsidian = new ItemArmorAA("itemHelmObsidian", InitArmorMaterials.armorMaterialObsidian, 0, new ItemStack(Blocks.OBSIDIAN)); + itemChestObsidian = new ItemArmorAA("itemChestObsidian", InitArmorMaterials.armorMaterialObsidian, 1, new ItemStack(Blocks.OBSIDIAN)); + itemPantsObsidian = new ItemArmorAA("itemPantsObsidian", InitArmorMaterials.armorMaterialObsidian, 2, new ItemStack(Blocks.OBSIDIAN)); + itemBootsObsidian = new ItemArmorAA("itemBootsObsidian", InitArmorMaterials.armorMaterialObsidian, 3, new ItemStack(Blocks.OBSIDIAN)); + itemHelmQuartz = new ItemArmorAA("itemHelmQuartz", InitArmorMaterials.armorMaterialQuartz, 0, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); + itemChestQuartz = new ItemArmorAA("itemChestQuartz", InitArmorMaterials.armorMaterialQuartz, 1, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); + itemPantsQuartz = new ItemArmorAA("itemPantsQuartz", InitArmorMaterials.armorMaterialQuartz, 2, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); + itemBootsQuartz = new ItemArmorAA("itemBootsQuartz", InitArmorMaterials.armorMaterialQuartz, 3, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); itemTeleStaff = new ItemTeleStaff("itemTeleStaff"); itemWingsOfTheBats = new ItemWingsOfTheBats("itemWingsOfTheBats"); itemDrill = new ItemDrill("itemDrill"); @@ -249,10 +255,6 @@ public class InitItems{ itemDrillUpgradeThreeByThree = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.THREE_BY_THREE, "itemDrillUpgradeThreeByThree"); itemDrillUpgradeFiveByFive = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE, "itemDrillUpgradeFiveByFive"); itemDrillUpgradeBlockPlacing = new ItemDrillUpgrade(ItemDrillUpgrade.UpgradeType.PLACER, "itemDrillUpgradeBlockPlacing"); - itemBucketOil = new ItemBucketAA(InitFluids.blockOil, "itemBucketOil"); - FluidContainerRegistry.registerFluidContainer(InitFluids.fluidOil, new ItemStack(itemBucketOil), FluidContainerRegistry.EMPTY_BUCKET); - itemBucketCanolaOil = new ItemBucketAA(InitFluids.blockCanolaOil, "itemBucketCanolaOil"); - FluidContainerRegistry.registerFluidContainer(InitFluids.fluidCanolaOil, new ItemStack(itemBucketCanolaOil), FluidContainerRegistry.EMPTY_BUCKET); itemFertilizer = new ItemFertilizer("itemFertilizer"); itemCoffee = new ItemCoffee("itemCoffee"); itemPhantomConnector = new ItemPhantomConnector("itemPhantomConnector"); @@ -270,35 +272,35 @@ public class InitItems{ itemHairyBall = new ItemHairyBall("itemHairyBall"); itemCoffeeBean = new ItemCoffeeBean("itemCoffeeBeans"); itemRiceSeed = new ItemSeed("itemRiceSeed", "seedRice", InitBlocks.blockRice, itemFoods, TheFoods.RICE.ordinal()); - CompatUtil.registerMFRSeed(itemRiceSeed); - itemCanolaSeed = new ItemSeed("itemCanolaSeed", "seedCanola", InitBlocks.blockCanola, itemMisc, TheMiscItems.CANOLA.ordinal()); - CompatUtil.registerMFRSeed(itemCanolaSeed); - itemFlaxSeed = new ItemSeed("itemFlaxSeed", "seedFlax", InitBlocks.blockFlax, Items.string, 0); - CompatUtil.registerMFRSeed(itemFlaxSeed); + CompatUtil.registerMFRSeed(itemRiceSeed, InitBlocks.blockRice); + itemCanolaSeed = new ItemFoodSeed("itemCanolaSeed", "seedCanola", InitBlocks.blockCanola, itemMisc, TheMiscItems.CANOLA.ordinal(), 1, 0.01F, 10).setPotionEffect(new PotionEffect(MobEffects.NAUSEA, 1000, 0), 0.2F); + CompatUtil.registerMFRSeed(itemCanolaSeed, InitBlocks.blockCanola); + itemFlaxSeed = new ItemSeed("itemFlaxSeed", "seedFlax", InitBlocks.blockFlax, Items.STRING, 0); + CompatUtil.registerMFRSeed(itemFlaxSeed, InitBlocks.blockFlax); itemCoffeeSeed = new ItemSeed("itemCoffeeSeed", "seedCoffeeBeans", InitBlocks.blockCoffee, itemCoffeeBean, 0); - CompatUtil.registerMFRSeed(itemCoffeeSeed); - itemPickaxeEmerald = new ItemPickaxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemPickaxeEmerald", EnumRarity.EPIC); - itemAxeEmerald = new ItemAxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemAxeEmerald", EnumRarity.EPIC); - itemShovelEmerald = new ItemShovelAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemShovelEmerald", EnumRarity.EPIC); - itemSwordEmerald = new ItemSwordAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemSwordEmerald", EnumRarity.EPIC); - itemHoeEmerald = new ItemHoeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "itemHoeEmerald", EnumRarity.EPIC); - itemPickaxeObsidian = new ItemPickaxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemPickaxeObsidian", EnumRarity.UNCOMMON); - itemAxeObsidian = new ItemAxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemAxeObsidian", EnumRarity.UNCOMMON); - itemShovelObsidian = new ItemShovelAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemShovelObsidian", EnumRarity.UNCOMMON); - itemSwordObsidian = new ItemSwordAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemSwordObsidian", EnumRarity.UNCOMMON); - itemHoeObsidian = new ItemHoeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "itemHoeObsidian", EnumRarity.UNCOMMON); + CompatUtil.registerMFRSeed(itemCoffeeSeed, InitBlocks.blockCoffee); + itemPickaxeEmerald = new ItemPickaxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "itemPickaxeEmerald", EnumRarity.EPIC); + itemAxeEmerald = new ItemAxeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "itemAxeEmerald", EnumRarity.EPIC); + itemShovelEmerald = new ItemShovelAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "itemShovelEmerald", EnumRarity.EPIC); + itemSwordEmerald = new ItemSwordAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "itemSwordEmerald", EnumRarity.EPIC); + itemHoeEmerald = new ItemHoeAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "itemHoeEmerald", EnumRarity.EPIC); + itemPickaxeObsidian = new ItemPickaxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "itemPickaxeObsidian", EnumRarity.UNCOMMON); + itemAxeObsidian = new ItemAxeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "itemAxeObsidian", EnumRarity.UNCOMMON); + itemShovelObsidian = new ItemShovelAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "itemShovelObsidian", EnumRarity.UNCOMMON); + itemSwordObsidian = new ItemSwordAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "itemSwordObsidian", EnumRarity.UNCOMMON); + itemHoeObsidian = new ItemHoeAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "itemHoeObsidian", EnumRarity.UNCOMMON); itemPickaxeQuartz = new ItemPickaxeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemPickaxeQuartz", EnumRarity.RARE); itemAxeQuartz = new ItemAxeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemAxeQuartz", EnumRarity.RARE); itemShovelQuartz = new ItemShovelAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemShovelQuartz", EnumRarity.RARE); itemSwordQuartz = new ItemSwordAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemSwordQuartz", EnumRarity.RARE); itemHoeQuartz = new ItemHoeAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "itemHoeQuartz", EnumRarity.RARE); woodenPaxel = new ItemAllToolAA(Item.ToolMaterial.WOOD, "plankWood", "woodenPaxel", EnumRarity.UNCOMMON, 5192733); - stonePaxel = new ItemAllToolAA(Item.ToolMaterial.STONE, new ItemStack(Blocks.cobblestone), "stonePaxel", EnumRarity.UNCOMMON, 7040621); - ironPaxel = new ItemAllToolAA(Item.ToolMaterial.IRON, new ItemStack(Items.iron_ingot), "ironPaxel", EnumRarity.RARE, 10920613); - goldPaxel = new ItemAllToolAA(Item.ToolMaterial.GOLD, new ItemStack(Items.gold_ingot), "goldPaxel", EnumRarity.RARE, 16770048); - diamondPaxel = new ItemAllToolAA(Item.ToolMaterial.EMERALD, new ItemStack(Items.diamond), "diamondPaxel", EnumRarity.EPIC, 3250376); - emeraldPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.emerald), "emeraldPaxel", EnumRarity.EPIC, 7723338); - obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.obsidian), "obsidianPaxel", EnumRarity.EPIC, 4166); + stonePaxel = new ItemAllToolAA(Item.ToolMaterial.STONE, new ItemStack(Blocks.COBBLESTONE), "stonePaxel", EnumRarity.UNCOMMON, 7040621); + ironPaxel = new ItemAllToolAA(Item.ToolMaterial.IRON, new ItemStack(Items.IRON_INGOT), "ironPaxel", EnumRarity.RARE, 10920613); + goldPaxel = new ItemAllToolAA(Item.ToolMaterial.GOLD, new ItemStack(Items.GOLD_INGOT), "goldPaxel", EnumRarity.RARE, 16770048); + diamondPaxel = new ItemAllToolAA(Item.ToolMaterial.DIAMOND, new ItemStack(Items.DIAMOND), "diamondPaxel", EnumRarity.EPIC, 3250376); + emeraldPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialEmerald, new ItemStack(Items.EMERALD), "emeraldPaxel", EnumRarity.EPIC, 7723338); + obsidianPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialObsidian, new ItemStack(Blocks.OBSIDIAN), "obsidianPaxel", EnumRarity.EPIC, 4166); quartzPaxel = new ItemAllToolAA(InitToolMaterials.toolMaterialQuartz, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), "quartzPaxel", EnumRarity.RARE, 1710103); itemPickaxeCrystalRed = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemPickaxeCrystalRed", Util.CRYSTAL_RED_RARITY); @@ -306,10 +308,10 @@ public class InitItems{ itemShovelCrystalRed = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemShovelCrystalRed", Util.CRYSTAL_RED_RARITY); itemSwordCrystalRed = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemSwordCrystalRed", Util.CRYSTAL_RED_RARITY); itemHoeCrystalRed = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemHoeCrystalRed", Util.CRYSTAL_RED_RARITY); - itemHelmCrystalRed = new ItemArmorAA("itemHelmCrystalRed", InitArmorMaterials.armorMaterialCrystalRed, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "armorCrystalRed", Util.CRYSTAL_RED_RARITY); - itemChestCrystalRed = new ItemArmorAA("itemChestCrystalRed", InitArmorMaterials.armorMaterialCrystalRed, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "armorCrystalRed", Util.CRYSTAL_RED_RARITY); - itemPantsCrystalRed = new ItemArmorAA("itemPantsCrystalRed", InitArmorMaterials.armorMaterialCrystalRed, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "armorCrystalRed", Util.CRYSTAL_RED_RARITY); - itemBootsCrystalRed = new ItemArmorAA("itemBootsCrystalRed", InitArmorMaterials.armorMaterialCrystalRed, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "armorCrystalRed", Util.CRYSTAL_RED_RARITY); + itemHelmCrystalRed = new ItemArmorAA("itemHelmCrystalRed", InitArmorMaterials.armorMaterialCrystalRed, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), Util.CRYSTAL_RED_RARITY); + itemChestCrystalRed = new ItemArmorAA("itemChestCrystalRed", InitArmorMaterials.armorMaterialCrystalRed, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), Util.CRYSTAL_RED_RARITY); + itemPantsCrystalRed = new ItemArmorAA("itemPantsCrystalRed", InitArmorMaterials.armorMaterialCrystalRed, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), Util.CRYSTAL_RED_RARITY); + itemBootsCrystalRed = new ItemArmorAA("itemBootsCrystalRed", InitArmorMaterials.armorMaterialCrystalRed, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), Util.CRYSTAL_RED_RARITY); itemPaxelCrystalRed = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalRed, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), "itemPaxelCrystalRed", Util.CRYSTAL_RED_RARITY, 16711689); itemPickaxeCrystalBlue = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "itemPickaxeCrystalBlue", Util.CRYSTAL_BLUE_RARITY); @@ -317,10 +319,10 @@ public class InitItems{ itemShovelCrystalBlue = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "itemShovelCrystalBlue", Util.CRYSTAL_BLUE_RARITY); itemSwordCrystalBlue = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "itemSwordCrystalBlue", Util.CRYSTAL_BLUE_RARITY); itemHoeCrystalBlue = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "itemHoeCrystalBlue", Util.CRYSTAL_BLUE_RARITY); - itemHelmCrystalBlue = new ItemArmorAA("itemHelmCrystalBlue", InitArmorMaterials.armorMaterialCrystalBlue, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "armorCrystalBlue", Util.CRYSTAL_BLUE_RARITY); - itemChestCrystalBlue = new ItemArmorAA("itemChestCrystalBlue", InitArmorMaterials.armorMaterialCrystalBlue, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "armorCrystalBlue", Util.CRYSTAL_BLUE_RARITY); - itemPantsCrystalBlue = new ItemArmorAA("itemPantsCrystalBlue", InitArmorMaterials.armorMaterialCrystalBlue, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "armorCrystalBlue", Util.CRYSTAL_BLUE_RARITY); - itemBootsCrystalBlue = new ItemArmorAA("itemBootsCrystalBlue", InitArmorMaterials.armorMaterialCrystalBlue, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "armorCrystalBlue", Util.CRYSTAL_BLUE_RARITY); + itemHelmCrystalBlue = new ItemArmorAA("itemHelmCrystalBlue", InitArmorMaterials.armorMaterialCrystalBlue, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), Util.CRYSTAL_BLUE_RARITY); + itemChestCrystalBlue = new ItemArmorAA("itemChestCrystalBlue", InitArmorMaterials.armorMaterialCrystalBlue, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), Util.CRYSTAL_BLUE_RARITY); + itemPantsCrystalBlue = new ItemArmorAA("itemPantsCrystalBlue", InitArmorMaterials.armorMaterialCrystalBlue, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), Util.CRYSTAL_BLUE_RARITY); + itemBootsCrystalBlue = new ItemArmorAA("itemBootsCrystalBlue", InitArmorMaterials.armorMaterialCrystalBlue, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), Util.CRYSTAL_BLUE_RARITY); itemPaxelCrystalBlue = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), "itemPaxelCrystalBlue", Util.CRYSTAL_BLUE_RARITY, 3014911); itemPickaxeCrystalLightBlue = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "itemPickaxeCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY); @@ -328,10 +330,10 @@ public class InitItems{ itemShovelCrystalLightBlue = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "itemShovelCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY); itemSwordCrystalLightBlue = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "itemSwordCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY); itemHoeCrystalLightBlue = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "itemHoeCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemHelmCrystalLightBlue = new ItemArmorAA("itemHelmCrystalLightBlue", InitArmorMaterials.armorMaterialCrystalLightBlue, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "armorCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemChestCrystalLightBlue = new ItemArmorAA("itemChestCrystalLightBlue", InitArmorMaterials.armorMaterialCrystalLightBlue, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "armorCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemPantsCrystalLightBlue = new ItemArmorAA("itemPantsCrystalLightBlue", InitArmorMaterials.armorMaterialCrystalLightBlue, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "armorCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY); - itemBootsCrystalLightBlue = new ItemArmorAA("itemBootsCrystalLightBlue", InitArmorMaterials.armorMaterialCrystalLightBlue, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "armorCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY); + itemHelmCrystalLightBlue = new ItemArmorAA("itemHelmCrystalLightBlue", InitArmorMaterials.armorMaterialCrystalLightBlue, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), Util.CRYSTAL_LIGHT_BLUE_RARITY); + itemChestCrystalLightBlue = new ItemArmorAA("itemChestCrystalLightBlue", InitArmorMaterials.armorMaterialCrystalLightBlue, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), Util.CRYSTAL_LIGHT_BLUE_RARITY); + itemPantsCrystalLightBlue = new ItemArmorAA("itemPantsCrystalLightBlue", InitArmorMaterials.armorMaterialCrystalLightBlue, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), Util.CRYSTAL_LIGHT_BLUE_RARITY); + itemBootsCrystalLightBlue = new ItemArmorAA("itemBootsCrystalLightBlue", InitArmorMaterials.armorMaterialCrystalLightBlue, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), Util.CRYSTAL_LIGHT_BLUE_RARITY); itemPaxelCrystalLightBlue = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalLightBlue, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), "itemPaxelCrystalLightBlue", Util.CRYSTAL_LIGHT_BLUE_RARITY, 4093108); itemPickaxeCrystalBlack = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "itemPickaxeCrystalBlack", Util.CRYSTAL_BLACK_RARITY); @@ -339,10 +341,10 @@ public class InitItems{ itemShovelCrystalBlack = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "itemShovelCrystalBlack", Util.CRYSTAL_BLACK_RARITY); itemSwordCrystalBlack = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "itemSwordCrystalBlack", Util.CRYSTAL_BLACK_RARITY); itemHoeCrystalBlack = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "itemHoeCrystalBlack", Util.CRYSTAL_BLACK_RARITY); - itemHelmCrystalBlack = new ItemArmorAA("itemHelmCrystalBlack", InitArmorMaterials.armorMaterialCrystalBlack, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "armorCrystalBlack", Util.CRYSTAL_BLACK_RARITY); - itemChestCrystalBlack = new ItemArmorAA("itemChestCrystalBlack", InitArmorMaterials.armorMaterialCrystalBlack, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "armorCrystalBlack", Util.CRYSTAL_BLACK_RARITY); - itemPantsCrystalBlack = new ItemArmorAA("itemPantsCrystalBlack", InitArmorMaterials.armorMaterialCrystalBlack, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "armorCrystalBlack", Util.CRYSTAL_BLACK_RARITY); - itemBootsCrystalBlack = new ItemArmorAA("itemBootsCrystalBlack", InitArmorMaterials.armorMaterialCrystalBlack, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "armorCrystalBlack", Util.CRYSTAL_BLACK_RARITY); + itemHelmCrystalBlack = new ItemArmorAA("itemHelmCrystalBlack", InitArmorMaterials.armorMaterialCrystalBlack, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), Util.CRYSTAL_BLACK_RARITY); + itemChestCrystalBlack = new ItemArmorAA("itemChestCrystalBlack", InitArmorMaterials.armorMaterialCrystalBlack, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), Util.CRYSTAL_BLACK_RARITY); + itemPantsCrystalBlack = new ItemArmorAA("itemPantsCrystalBlack", InitArmorMaterials.armorMaterialCrystalBlack, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), Util.CRYSTAL_BLACK_RARITY); + itemBootsCrystalBlack = new ItemArmorAA("itemBootsCrystalBlack", InitArmorMaterials.armorMaterialCrystalBlack, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), Util.CRYSTAL_BLACK_RARITY); itemPaxelCrystalBlack = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalBlack, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), "itemPaxelCrystalBlack", Util.CRYSTAL_BLACK_RARITY, 2631982); itemPickaxeCrystalGreen = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "itemPickaxeCrystalGreen", Util.CRYSTAL_GREEN_RARITY); @@ -350,10 +352,10 @@ public class InitItems{ itemShovelCrystalGreen = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "itemShovelCrystalGreen", Util.CRYSTAL_GREEN_RARITY); itemSwordCrystalGreen = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "itemSwordCrystalGreen", Util.CRYSTAL_GREEN_RARITY); itemHoeCrystalGreen = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "itemHoeCrystalGreen", Util.CRYSTAL_GREEN_RARITY); - itemHelmCrystalGreen = new ItemArmorAA("itemHelmCrystalGreen", InitArmorMaterials.armorMaterialCrystalGreen, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "armorCrystalGreen", Util.CRYSTAL_GREEN_RARITY); - itemChestCrystalGreen = new ItemArmorAA("itemChestCrystalGreen", InitArmorMaterials.armorMaterialCrystalGreen, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "armorCrystalGreen", Util.CRYSTAL_GREEN_RARITY); - itemPantsCrystalGreen = new ItemArmorAA("itemPantsCrystalGreen", InitArmorMaterials.armorMaterialCrystalGreen, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "armorCrystalGreen", Util.CRYSTAL_GREEN_RARITY); - itemBootsCrystalGreen = new ItemArmorAA("itemBootsCrystalGreen", InitArmorMaterials.armorMaterialCrystalGreen, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "armorCrystalGreen", Util.CRYSTAL_GREEN_RARITY); + itemHelmCrystalGreen = new ItemArmorAA("itemHelmCrystalGreen", InitArmorMaterials.armorMaterialCrystalGreen, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), Util.CRYSTAL_GREEN_RARITY); + itemChestCrystalGreen = new ItemArmorAA("itemChestCrystalGreen", InitArmorMaterials.armorMaterialCrystalGreen, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), Util.CRYSTAL_GREEN_RARITY); + itemPantsCrystalGreen = new ItemArmorAA("itemPantsCrystalGreen", InitArmorMaterials.armorMaterialCrystalGreen, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), Util.CRYSTAL_GREEN_RARITY); + itemBootsCrystalGreen = new ItemArmorAA("itemBootsCrystalGreen", InitArmorMaterials.armorMaterialCrystalGreen, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), Util.CRYSTAL_GREEN_RARITY); itemPaxelCrystalGreen = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalGreen, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), "itemPaxelCrystalGreen", Util.CRYSTAL_GREEN_RARITY, 46848); itemPickaxeCrystalWhite = new ItemPickaxeAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "itemPickaxeCrystalWhite", Util.CRYSTAL_WHITE_RARITY); @@ -361,10 +363,10 @@ public class InitItems{ itemShovelCrystalWhite = new ItemShovelAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "itemShovelCrystalWhite", Util.CRYSTAL_WHITE_RARITY); itemSwordCrystalWhite = new ItemSwordAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "itemSwordCrystalWhite", Util.CRYSTAL_WHITE_RARITY); itemHoeCrystalWhite = new ItemHoeAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "itemHoeCrystalWhite", Util.CRYSTAL_WHITE_RARITY); - itemHelmCrystalWhite = new ItemArmorAA("itemHelmCrystalWhite", InitArmorMaterials.armorMaterialCrystalWhite, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "armorCrystalWhite", Util.CRYSTAL_WHITE_RARITY); - itemChestCrystalWhite = new ItemArmorAA("itemChestCrystalWhite", InitArmorMaterials.armorMaterialCrystalWhite, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "armorCrystalWhite", Util.CRYSTAL_WHITE_RARITY); - itemPantsCrystalWhite = new ItemArmorAA("itemPantsCrystalWhite", InitArmorMaterials.armorMaterialCrystalWhite, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "armorCrystalWhite", Util.CRYSTAL_WHITE_RARITY); - itemBootsCrystalWhite = new ItemArmorAA("itemBootsCrystalWhite", InitArmorMaterials.armorMaterialCrystalWhite, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "armorCrystalWhite", Util.CRYSTAL_WHITE_RARITY); + itemHelmCrystalWhite = new ItemArmorAA("itemHelmCrystalWhite", InitArmorMaterials.armorMaterialCrystalWhite, 0, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), Util.CRYSTAL_WHITE_RARITY); + itemChestCrystalWhite = new ItemArmorAA("itemChestCrystalWhite", InitArmorMaterials.armorMaterialCrystalWhite, 1, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), Util.CRYSTAL_WHITE_RARITY); + itemPantsCrystalWhite = new ItemArmorAA("itemPantsCrystalWhite", InitArmorMaterials.armorMaterialCrystalWhite, 2, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), Util.CRYSTAL_WHITE_RARITY); + itemBootsCrystalWhite = new ItemArmorAA("itemBootsCrystalWhite", InitArmorMaterials.armorMaterialCrystalWhite, 3, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), Util.CRYSTAL_WHITE_RARITY); itemPaxelCrystalWhite = new ItemAllToolAA(InitToolMaterials.toolMaterialCrystalWhite, new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), "itemPaxelCrystalWhite", Util.CRYSTAL_WHITE_RARITY, 14606302); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java new file mode 100644 index 000000000..a18f918e8 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java @@ -0,0 +1,112 @@ +/* + * This file ("ItemAllToolAA.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; +import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; +import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.color.IItemColor; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.HashSet; +import java.util.Set; + +public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{ + + public final int color; + + public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity, int color){ + super(4.0F, -2F, toolMat, repairItem, unlocalizedName, rarity, new HashSet()); + this.color = color; + + this.setMaxDamage(this.getMaxDamage()*4); + } + + public ItemAllToolAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity, int color){ + super(4.0F, -2F, toolMat, repairItem, unlocalizedName, rarity, new HashSet()); + this.color = color; + + this.setMaxDamage(this.getMaxDamage()*4); + } + + @Override + protected void registerRendering(){ + ResourceLocation resLoc = new ResourceLocation(ModUtil.MOD_ID, "itemPaxel"); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), resLoc, "inventory"); + } + + + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){ + return Items.IRON_HOE.onItemUse(stack, playerIn, worldIn, pos, hand, side, hitX, hitY, hitZ); + } + + @Override + public boolean canHarvestBlock(IBlockState state, ItemStack stack){ + + return this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getMaterial(state).isToolNotRequired() || (state.getBlock() == Blocks.SNOW_LAYER || state.getBlock() == Blocks.SNOW || (state.getBlock() == Blocks.OBSIDIAN ? this.toolMaterial.getHarvestLevel() >= 3 : (state.getBlock() != Blocks.DIAMOND_BLOCK && state.getBlock() != Blocks.DIAMOND_ORE ? (state.getBlock() != Blocks.EMERALD_ORE && state.getBlock() != Blocks.EMERALD_BLOCK ? (state.getBlock() != Blocks.GOLD_BLOCK && state.getBlock() != Blocks.GOLD_ORE ? (state.getBlock() != Blocks.IRON_BLOCK && state.getBlock() != Blocks.IRON_ORE ? (state.getBlock() != Blocks.LAPIS_BLOCK && state.getBlock() != Blocks.LAPIS_ORE ? (state.getBlock() != Blocks.REDSTONE_ORE && state.getBlock() != Blocks.LIT_REDSTONE_ORE ? (state.getBlock().getMaterial(state) == Material.ROCK || (state.getBlock().getMaterial(state) == Material.IRON || state.getBlock().getMaterial(state) == Material.ANVIL)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2))); + } + + private boolean hasExtraWhitelist(Block block){ + String name = block.getRegistryName().toString(); + if(name != null){ + for(String list : ConfigStringListValues.PAXEL_EXTRA_MINING_WHITELIST.getValue()){ + if(list.equals(name)){ + return true; + } + } + } + return false; + } + + + @Override + public Set getToolClasses(ItemStack stack){ + HashSet hashSet = new HashSet(); + hashSet.add("pickaxe"); + hashSet.add("axe"); + hashSet.add("shovel"); + return hashSet; + } + + @Override + public float getStrVsBlock(ItemStack stack, IBlockState state){ + return this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getHarvestTool(state) == null || state.getBlock().getHarvestTool(state).isEmpty() || this.getToolClasses(stack).contains(state.getBlock().getHarvestTool(state)) ? this.efficiencyOnProperMaterial : 1.0F; + } + + @SideOnly(Side.CLIENT) + @Override + public IItemColor getColor(){ + return new IItemColor(){ + @Override + public int getColorFromItemstack(ItemStack stack, int pass){ + return pass > 0 ? ItemAllToolAA.this.color : 0xFFFFFF; + } + }; + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java new file mode 100644 index 000000000..0c31cf28a --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java @@ -0,0 +1,42 @@ +/* + * This file ("ItemAxeAA.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items; + +import com.google.common.collect.Sets; +import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.Set; + +public class ItemAxeAA extends ItemToolAA{ + + private static final Set EFFECTIVE_ON = Sets.newHashSet(Blocks.PLANKS, Blocks.BOOKSHELF, Blocks.LOG, Blocks.LOG2, Blocks.CHEST, Blocks.PUMPKIN, Blocks.LIT_PUMPKIN, Blocks.MELON_BLOCK, Blocks.LADDER, Blocks.WOODEN_BUTTON, Blocks.WOODEN_PRESSURE_PLATE); + + public ItemAxeAA(Item.ToolMaterial material, String repairItem, String unlocalizedName, EnumRarity rarity){ + super(6.0F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + } + + public ItemAxeAA(Item.ToolMaterial material, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ + super(6.0F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + } + + @Override + public float getStrVsBlock(ItemStack stack, IBlockState state){ + Material material = state.getMaterial(); + return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java index 7baf5e9d5..a1f0168e1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java @@ -1,11 +1,11 @@ /* - * This file ("ItemBattery.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemBattery.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -21,6 +21,7 @@ public class ItemBattery extends ItemEnergy{ this.setMaxStackSize(1); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java index f805811d6..9f7ad587e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java @@ -1,40 +1,43 @@ /* - * This file ("ItemBooklet.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemBooklet.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.internal.EntrySet; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.achievement.TheAchievements; import de.ellpeck.actuallyadditions.mod.blocks.IHudDisplay; import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; +import de.ellpeck.actuallyadditions.mod.booklet.entry.EntrySet; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.profiler.Profiler; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -52,76 +55,76 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{ this.setMaxDamage(0); } - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing face, float hitX, float hitY, float hitZ){ - if(player.isSneaking()){ - Block block = PosUtil.getBlock(pos, world); - ItemStack blockStack = new ItemStack(block, 1, PosUtil.getMetadata(pos, world)); - if(blockStack != null){ - BookletPage page = BookletUtils.getFirstPageForStack(blockStack); - if(page != null){ - if(world.isRemote){ - forcedEntry = new EntrySet(page, page.getChapter(), page.getChapter().getEntry(), ActuallyAdditionsAPI.bookletEntries.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1); - } - this.onItemRightClick(stack, world, player); - return true; - } - } - } - return false; - } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing face, float hitX, float hitY, float hitZ){ + if(player.isSneaking()){ + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + ItemStack blockStack = new ItemStack(block, 1, block.getMetaFromState(state)); + BookletPage page = BookletUtils.getFirstPageForStack(blockStack); + if(page != null){ + if(world.isRemote){ + forcedEntry = new EntrySet(page, page.getChapter(), page.getChapter().getEntry(), ActuallyAdditionsAPI.BOOKLET_ENTRIES.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1); + } + this.onItemRightClick(stack, world, player, hand); + return EnumActionResult.SUCCESS; + } + } + return EnumActionResult.FAIL; + } + + + @Override + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BOOK.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); if(!world.isRemote){ - player.triggerAchievement(TheAchievements.OPEN_BOOKLET.ach); + player.addStat(TheAchievements.OPEN_BOOKLET.chieve); } - return stack; + return new ActionResult(EnumActionResult.SUCCESS, stack); } - @SuppressWarnings("unchecked") @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){ - list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+"."+this.getBaseName()+".desc")); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID+"."+this.getBaseName()+".desc")); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; } @Override - public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, MovingObjectPosition posHit, Profiler profiler, ScaledResolution resolution){ + public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, Profiler profiler, ScaledResolution resolution){ if(posHit != null){ - Block block = PosUtil.getBlock(posHit.getBlockPos(), minecraft.theWorld); - if(block != null && !block.isAir(minecraft.theWorld, posHit.getBlockPos())){ - ItemStack blockStack = new ItemStack(block, 1, PosUtil.getMetadata(posHit.getBlockPos(), minecraft.theWorld)); - if(blockStack != null){ - int height = resolution.getScaledHeight()/5*3; - if(player.isSneaking()){ - BookletPage page = BookletUtils.getFirstPageForStack(blockStack); - if(page != null){ - String strg1 = page.getChapter().getLocalizedName(); - String strg2 = "Page "+page.getID(); - String strg3 = "Right-Click to open..."; + IBlockState state = minecraft.theWorld.getBlockState(posHit.getBlockPos()); + Block block = state.getBlock(); + if(block != null && !block.isAir(minecraft.theWorld.getBlockState(posHit.getBlockPos()), minecraft.theWorld, posHit.getBlockPos())){ + ItemStack blockStack = new ItemStack(block, 1, block.getMetaFromState(state)); + int height = resolution.getScaledHeight()/5*3; + if(player.isSneaking()){ + BookletPage page = BookletUtils.getFirstPageForStack(blockStack); + if(page != null){ + String strg1 = page.getChapter().getLocalizedName(); + String strg2 = "Page "+page.getID(); + String strg3 = "Right-Click to open..."; - AssetUtil.renderStackToGui(page.getChapter().getDisplayItemStack() != null ? page.getChapter().getDisplayItemStack() : new ItemStack(InitItems.itemBooklet), resolution.getScaledWidth()/2-10, height+41, 1F); - minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW+""+EnumChatFormatting.ITALIC+strg1, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg1)/2, height+20, StringUtil.DECIMAL_COLOR_WHITE); - minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.YELLOW+""+EnumChatFormatting.ITALIC+strg2, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg2)/2, height+30, StringUtil.DECIMAL_COLOR_WHITE); - minecraft.fontRendererObj.drawStringWithShadow(EnumChatFormatting.GOLD+strg3, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg3)/2, height+60, StringUtil.DECIMAL_COLOR_WHITE); - } - else{ - String strg = EnumChatFormatting.DARK_RED+"No Info available! Sorry :("; - minecraft.fontRendererObj.drawStringWithShadow(strg, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg)/2, height+60, StringUtil.DECIMAL_COLOR_WHITE); - } + AssetUtil.renderStackToGui(page.getChapter().getDisplayItemStack() != null ? page.getChapter().getDisplayItemStack() : new ItemStack(InitItems.itemBooklet), resolution.getScaledWidth()/2-10, height+41, 1F); + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.YELLOW+""+TextFormatting.ITALIC+strg1, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg1)/2, height+20, StringUtil.DECIMAL_COLOR_WHITE); + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.YELLOW+""+TextFormatting.ITALIC+strg2, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg2)/2, height+30, StringUtil.DECIMAL_COLOR_WHITE); + minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.GOLD+strg3, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg3)/2, height+60, StringUtil.DECIMAL_COLOR_WHITE); } else{ - String strg = EnumChatFormatting.DARK_GREEN+""+EnumChatFormatting.ITALIC+"Sneak!"; + String strg = TextFormatting.DARK_RED+"No Info available! Sorry :("; minecraft.fontRendererObj.drawStringWithShadow(strg, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg)/2, height+60, StringUtil.DECIMAL_COLOR_WHITE); } } + else{ + String strg = TextFormatting.DARK_GREEN+""+TextFormatting.ITALIC+"Sneak!"; + minecraft.fontRendererObj.drawStringWithShadow(strg, resolution.getScaledWidth()/2-minecraft.fontRendererObj.getStringWidth(strg)/2, height+60, StringUtil.DECIMAL_COLOR_WHITE); + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java index 41ee8bbe8..027cdfade 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java @@ -1,20 +1,19 @@ /* - * This file ("ItemChestToCrateUpgrade.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemChestToCrateUpgrade.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockChest; import net.minecraft.entity.player.EntityPlayer; @@ -22,8 +21,10 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class ItemChestToCrateUpgrade extends ItemBase{ @@ -32,11 +33,12 @@ public class ItemChestToCrateUpgrade extends ItemBase{ super(name); } + @Override - public boolean onItemUse(ItemStack heldStack, EntityPlayer player, World world, BlockPos pos, EnumFacing facing, float par8, float par9, float par10){ + public EnumActionResult onItemUse(ItemStack heldStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float par8, float par9, float par10){ if(player.isSneaking()){ TileEntity tileHit = world.getTileEntity(pos); - Block block = PosUtil.getBlock(pos, world); + Block block = world.getBlockState(pos).getBlock(); if(block instanceof BlockChest && tileHit instanceof TileEntityChest){ if(!world.isRemote){ TileEntityChest chest = (TileEntityChest)tileHit; @@ -52,10 +54,10 @@ public class ItemChestToCrateUpgrade extends ItemBase{ } //Set New Block - if(!ConfigValues.lessBlockBreakingEffects){ - world.playAuxSFX(2001, pos, Block.getStateId(world.getBlockState(pos))); + if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ + world.playEvent(2001, pos, Block.getStateId(world.getBlockState(pos))); } - PosUtil.setBlock(pos, world, InitBlocks.blockGiantChest, 0, 2); + world.setBlockState(pos, InitBlocks.blockGiantChest.getDefaultState(), 2); //Copy Items into new Chest TileEntity newTileHit = world.getTileEntity(pos); @@ -74,13 +76,14 @@ public class ItemChestToCrateUpgrade extends ItemBase{ heldStack.stackSize--; } } - return true; + return EnumActionResult.SUCCESS; } } - return super.onItemUse(heldStack, player, world, pos, facing, par8, par9, par10); + return super.onItemUse(heldStack, player, world, pos, hand, facing, par8, par9, par10); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java index 492f9f6d1..5cb1db173 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffee.java @@ -1,31 +1,31 @@ /* - * This file ("ItemCoffee.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemCoffee.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeBrewing; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; +import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; import de.ellpeck.actuallyadditions.mod.items.base.ItemFoodBase; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; +import net.minecraft.init.MobEffects; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.StringUtils; import net.minecraft.world.World; @@ -45,7 +45,7 @@ public class ItemCoffee extends ItemFoodBase{ } public static void initIngredients(){ - ActuallyAdditionsAPI.addCoffeeMachineIngredient(new MilkIngredient(new ItemStack(Items.milk_bucket))); + ActuallyAdditionsAPI.addCoffeeMachineIngredient(new MilkIngredient(new ItemStack(Items.MILK_BUCKET))); //Pam's Soy Milk (For Jemx because he's lactose intolerant. YER HAPPY NAO!?) if(Loader.isModLoaded("harvestcraft")){ Item item = ItemUtil.getItemFromName("harvestcraft:soymilkItem"); @@ -54,17 +54,17 @@ public class ItemCoffee extends ItemFoodBase{ } } - ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.sugar), new PotionEffect[]{new PotionEffect(Potion.moveSpeed.getId(), 30, 0)}, 4)); - ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.magma_cream), new PotionEffect[]{new PotionEffect(Potion.fireResistance.getId(), 20, 0)}, 2)); - ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.fish, 1, 3), new PotionEffect[]{new PotionEffect(Potion.waterBreathing.getId(), 10, 0)}, 2)); - ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.golden_carrot), new PotionEffect[]{new PotionEffect(Potion.nightVision.getId(), 30, 0)}, 2)); - ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.ghast_tear), new PotionEffect[]{new PotionEffect(Potion.regeneration.getId(), 5, 0)}, 3)); - ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.blaze_powder), new PotionEffect[]{new PotionEffect(Potion.damageBoost.getId(), 15, 0)}, 4)); - ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.fermented_spider_eye), new PotionEffect[]{new PotionEffect(Potion.invisibility.getId(), 25, 0)}, 2)); + ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.SUGAR), new PotionEffect[]{new PotionEffect(MobEffects.SPEED, 30, 0)}, 4)); + ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.MAGMA_CREAM), new PotionEffect[]{new PotionEffect(MobEffects.FIRE_RESISTANCE, 20, 0)}, 2)); + ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.FISH, 1, 3), new PotionEffect[]{new PotionEffect(MobEffects.WATER_BREATHING, 10, 0)}, 2)); + ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.GOLDEN_CARROT), new PotionEffect[]{new PotionEffect(MobEffects.NIGHT_VISION, 30, 0)}, 2)); + ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.GHAST_TEAR), new PotionEffect[]{new PotionEffect(MobEffects.REGENERATION, 5, 0)}, 3)); + ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.BLAZE_POWDER), new PotionEffect[]{new PotionEffect(MobEffects.STRENGTH, 15, 0)}, 4)); + ActuallyAdditionsAPI.addCoffeeMachineIngredient(new CoffeeIngredient(new ItemStack(Items.FERMENTED_SPIDER_EYE), new PotionEffect[]{new PotionEffect(MobEffects.INVISIBILITY, 25, 0)}, 2)); } public static CoffeeIngredient getIngredientFromStack(ItemStack stack){ - for(CoffeeIngredient ingredient : ActuallyAdditionsAPI.coffeeMachineIngredients){ + for(CoffeeIngredient ingredient : ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS){ if(ingredient.ingredient.copy().isItemEqual(stack)){ return ingredient; } @@ -72,17 +72,17 @@ public class ItemCoffee extends ItemFoodBase{ return null; } - public static void applyPotionEffectsFromStack(ItemStack stack, EntityPlayer player){ - PotionEffect[] effects = CoffeeBrewing.getEffectsFromStack(stack); + public static void applyPotionEffectsFromStack(ItemStack stack, EntityLivingBase player){ + PotionEffect[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack); if(effects != null && effects.length > 0){ for(PotionEffect effect : effects){ - player.addPotionEffect(new PotionEffect(effect.getPotionID(), effect.getDuration()*20, effect.getAmplifier())); + player.addPotionEffect(new PotionEffect(effect.getPotion(), effect.getDuration()*20, effect.getAmplifier())); } } } @Override - public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player){ + public ItemStack onItemUseFinish(ItemStack stack, World world, EntityLivingBase player){ ItemStack theStack = stack.copy(); super.onItemUseFinish(stack, world, player); applyPotionEffectsFromStack(stack, player); @@ -95,6 +95,7 @@ public class ItemCoffee extends ItemFoodBase{ } } + @Override public EnumAction getItemUseAction(ItemStack stack){ return EnumAction.DRINK; @@ -110,10 +111,9 @@ public class ItemCoffee extends ItemFoodBase{ return true; } - @SuppressWarnings("unchecked") @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){ - PotionEffect[] effects = CoffeeBrewing.getEffectsFromStack(stack); + PotionEffect[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack); if(effects != null){ for(PotionEffect effect : effects){ list.add(StringUtil.localize(effect.getEffectName())+" "+(effect.getAmplifier()+1)+", "+StringUtils.ticksToElapsedTime(effect.getDuration()*20)); @@ -124,6 +124,7 @@ public class ItemCoffee extends ItemFoodBase{ } } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; @@ -137,18 +138,18 @@ public class ItemCoffee extends ItemFoodBase{ @Override public boolean effect(ItemStack stack){ - PotionEffect[] effects = CoffeeBrewing.getEffectsFromStack(stack); + PotionEffect[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack); ArrayList effectsNew = new ArrayList(); if(effects != null && effects.length > 0){ for(PotionEffect effect : effects){ if(effect.getAmplifier() > 0){ - effectsNew.add(new PotionEffect(effect.getPotionID(), effect.getDuration()+120, effect.getAmplifier()-1)); + effectsNew.add(new PotionEffect(effect.getPotion(), effect.getDuration()+120, effect.getAmplifier()-1)); } } stack.setTagCompound(new NBTTagCompound()); if(effectsNew.size() > 0){ this.effects = effectsNew.toArray(new PotionEffect[effectsNew.size()]); - CoffeeBrewing.addEffectToStack(stack, this); + ActuallyAdditionsAPI.methodHandler.addEffectToStack(stack, this); } } this.effects = null; @@ -157,7 +158,7 @@ public class ItemCoffee extends ItemFoodBase{ @Override public String getExtraText(){ - return StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.extra.milk"); + return StringUtil.localize("container.nei."+ModUtil.MOD_ID+".coffee.extra.milk"); } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffeeBean.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffeeBean.java index 9e65ea4f8..3da5de4d6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffeeBean.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCoffeeBean.java @@ -1,11 +1,11 @@ /* - * This file ("ItemCoffeeBean.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemCoffeeBean.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -21,6 +21,7 @@ public class ItemCoffeeBean extends ItemFoodBase{ this.setMaxDamage(0); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java index 5fd23d1d7..c83422dd3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java @@ -1,11 +1,11 @@ /* - * This file ("ItemCrafterOnAStick.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemCrafterOnAStick.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -16,6 +16,9 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; public class ItemCrafterOnAStick extends ItemBase{ @@ -25,14 +28,16 @@ public class ItemCrafterOnAStick extends ItemBase{ this.setMaxStackSize(1); } + @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ if(!world.isRemote){ player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); } - return stack; + return new ActionResult(EnumActionResult.SUCCESS, stack); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java index 3640fd7e9..d14a9e45c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java @@ -1,11 +1,11 @@ /* - * This file ("ItemCrystal.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemCrystal.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.BlockCrystal; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; @@ -38,32 +37,31 @@ public class ItemCrystal extends ItemBase{ return damage; } + @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= BlockCrystal.allCrystals.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+BlockCrystal.allCrystals[stack.getItemDamage()].name; + return stack.getItemDamage() >= BlockCrystal.ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+BlockCrystal.ALL_CRYSTALS[stack.getItemDamage()].name; } + @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= BlockCrystal.allCrystals.length ? EnumRarity.COMMON : BlockCrystal.allCrystals[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= BlockCrystal.ALL_CRYSTALS.length ? EnumRarity.COMMON : BlockCrystal.ALL_CRYSTALS[stack.getItemDamage()].rarity; } - @SuppressWarnings("all") + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < BlockCrystal.allCrystals.length; j++){ + for(int j = 0; j < BlockCrystal.ALL_CRYSTALS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[BlockCrystal.allCrystals.length]; - for(int i = 0; i < BlockCrystal.allCrystals.length; i++){ - String name = this.getBaseName()+BlockCrystal.allCrystals[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + for(int i = 0; i < BlockCrystal.ALL_CRYSTALS.length; i++){ + String name = this.getRegistryName()+BlockCrystal.ALL_CRYSTALS[i].name; + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(name), "inventory"); } - ActuallyAdditions.proxy.addRenderVariant(this, resLocs); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java index 6421dda39..bf9deedff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java @@ -1,11 +1,11 @@ /* - * This file ("ItemDrill.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemDrill.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -14,18 +14,18 @@ import cofh.api.energy.IEnergyContainerItem; import com.google.common.collect.Multimap; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; +import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -33,12 +33,16 @@ import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.Enchantments; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import net.minecraft.util.*; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.TextComponentString; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.fml.relauncher.Side; @@ -48,11 +52,10 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -@SuppressWarnings("unchecked") public class ItemDrill extends ItemEnergy{ private static final int ENERGY_USE = 100; - private static final int HARVEST_LEVEL = 4; + public static final int HARVEST_LEVEL = 4; public ItemDrill(String name){ super(500000, 5000, name); @@ -69,9 +72,36 @@ public class ItemDrill extends ItemEnergy{ this.setHarvestLevel("pickaxe", HARVEST_LEVEL); } + /** + * Gets all of the Slots from NBT + * + * @param stack The Drill + */ + public static void loadSlotsFromNBT(ItemStack[] slots, ItemStack stack){ + NBTTagCompound compound = stack.getTagCompound(); + if(compound != null){ + TileEntityInventoryBase.loadSlots(slots, compound); + } + } + + /** + * Writes all of the Slots to NBT + * + * @param slots The Slots + * @param stack The Drill + */ + public static void writeSlotsToNBT(ItemStack[] slots, ItemStack stack){ + NBTTagCompound compound = stack.getTagCompound(); + if(compound == null){ + compound = new NBTTagCompound(); + } + TileEntityInventoryBase.saveSlots(slots, compound); + stack.setTagCompound(compound); + } + @Override //Places Blocks if the Placing Upgrade is installed - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ){ + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){ ItemStack upgrade = this.getHasUpgradeAsStack(stack, ItemDrillUpgrade.UpgradeType.PLACER); if(upgrade != null){ int slot = ItemDrillUpgrade.getSlotToPlaceFrom(upgrade); @@ -83,28 +113,28 @@ public class ItemDrill extends ItemEnergy{ //tryPlaceItemIntoWorld could throw an Exception try{ //Places the Block into the World - if(equip.onItemUse(player, world, pos, side, hitX, hitY, hitZ)){ + if(equip.onItemUse(player, world, pos, hand, side, hitX, hitY, hitZ) != EnumActionResult.FAIL){ if(!player.capabilities.isCreativeMode){ player.inventory.setInventorySlotContents(slot, equip.stackSize <= 0 ? null : equip.copy()); } //Synchronizes the Client player.inventoryContainer.detectAndSendChanges(); - return true; + return EnumActionResult.SUCCESS; } } //Notify the Player and log the Exception catch(Exception e){ - player.addChatComponentMessage(new ChatComponentText("Ouch! That really hurt! You must have done something wrong, don't do that again please!")); - ModUtil.LOGGER.error("Player "+player.getName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.getDimensionId()+" threw an Exception! Don't let that happen again!"); + player.addChatComponentMessage(new TextComponentString("Ouch! That really hurt! You must have done something wrong, don't do that again please!")); + ModUtil.LOGGER.error("Player "+player.getName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.getDimension()+" threw an Exception! Don't let that happen again!"); } } else{ - return true; + return EnumActionResult.SUCCESS; } } } } - return false; + return EnumActionResult.FAIL; } /** @@ -120,7 +150,8 @@ public class ItemDrill extends ItemEnergy{ return null; } - ItemStack[] slots = this.getSlotsFromNBT(stack); + ItemStack[] slots = new ItemStack[ContainerDrill.SLOT_AMOUNT]; + loadSlotsFromNBT(slots, stack); if(slots != null && slots.length > 0){ for(ItemStack slotStack : slots){ if(slotStack != null && slotStack.getItem() instanceof ItemDrillUpgrade){ @@ -133,40 +164,12 @@ public class ItemDrill extends ItemEnergy{ return null; } - /** - * Gets all of the Slots from NBT - * - * @param stack The Drill - * @return All of the Slots - */ - public ItemStack[] getSlotsFromNBT(ItemStack stack){ - NBTTagCompound compound = stack.getTagCompound(); - if(compound == null){ - return null; - } - - int slotAmount = compound.getInteger("SlotAmount"); - ItemStack[] slots = new ItemStack[slotAmount]; - - if(slots.length > 0){ - NBTTagList tagList = compound.getTagList("Items", 10); - for(int i = 0; i < tagList.tagCount(); i++){ - NBTTagCompound tagCompound = tagList.getCompoundTagAt(i); - byte slotIndex = tagCompound.getByte("Slot"); - if(slotIndex >= 0 && slotIndex < slots.length){ - slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound); - } - } - } - return slots; - } - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ - if(!world.isRemote && player.isSneaking() && stack == player.getCurrentEquippedItem()){ + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ + if(!world.isRemote && player.isSneaking()){ player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); } - return stack; + return new ActionResult(EnumActionResult.PASS, stack); } @Override @@ -186,7 +189,8 @@ public class ItemDrill extends ItemEnergy{ //Checks for Energy Containers in the Upgrade Slots and charges the Drill from them @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ - ItemStack[] slots = this.getSlotsFromNBT(stack); + ItemStack[] slots = new ItemStack[ContainerDrill.SLOT_AMOUNT]; + loadSlotsFromNBT(slots, stack); if(slots != null && slots.length > 0){ for(ItemStack slotStack : slots){ if(slotStack != null && slotStack.getItem() instanceof IEnergyContainerItem){ @@ -211,14 +215,19 @@ public class ItemDrill extends ItemEnergy{ } @Override - public Multimap getAttributeModifiers(ItemStack stack){ - Multimap map = super.getAttributeModifiers(stack); - map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Drill Modifier", this.getEnergyStored(stack) >= ENERGY_USE ? 8.0F : 0.1F, 0)); + public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){ + Multimap map = super.getAttributeModifiers(slot, stack); + + if(slot == EntityEquipmentSlot.MAINHAND){ + map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Drill Modifier", this.getEnergyStored(stack) >= ENERGY_USE ? 8.0F : 0.1F, 0)); + map.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool Modifier", -2.5F, 0)); + } + return map; } @Override - public float getDigSpeed(ItemStack stack, IBlockState state){ + public float getStrVsBlock(ItemStack stack, IBlockState state){ return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) ? (this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getHarvestTool(state) == null || state.getBlock().getHarvestTool(state).isEmpty() || this.getToolClasses(stack).contains(state.getBlock().getHarvestTool(state)) ? this.getEfficiencyFromUpgrade(stack) : 1.0F) : 0.1F; } @@ -229,11 +238,11 @@ public class ItemDrill extends ItemEnergy{ if(this.getEnergyStored(stack) >= use){ //Enchants the Drill depending on the Upgrades it has if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)){ - ItemUtil.addEnchantment(stack, Enchantment.silkTouch, 1); + ItemUtil.addEnchantment(stack, Enchantments.SILK_TOUCH, 1); } else{ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)){ - ItemUtil.addEnchantment(stack, Enchantment.fortune, this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II) ? 3 : 1); + ItemUtil.addEnchantment(stack, Enchantments.FORTUNE, this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II) ? 3 : 1); } } @@ -251,16 +260,17 @@ public class ItemDrill extends ItemEnergy{ } //Removes Enchantments added above - ItemUtil.removeEnchantment(stack, Enchantment.silkTouch); - ItemUtil.removeEnchantment(stack, Enchantment.fortune); + ItemUtil.removeEnchantment(stack, Enchantments.SILK_TOUCH); + ItemUtil.removeEnchantment(stack, Enchantments.FORTUNE); } return toReturn; } @Override - public boolean canHarvestBlock(Block block, ItemStack stack){ + public boolean canHarvestBlock(IBlockState state, ItemStack stack){ int harvestLevel = this.getHarvestLevel(stack, ""); - return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) && (this.hasExtraWhitelist(block) || block.getMaterial().isToolNotRequired() || (block == Blocks.snow_layer || block == Blocks.snow || (block == Blocks.obsidian ? harvestLevel >= 3 : (block != Blocks.diamond_block && block != Blocks.diamond_ore ? (block != Blocks.emerald_ore && block != Blocks.emerald_block ? (block != Blocks.gold_block && block != Blocks.gold_ore ? (block != Blocks.iron_block && block != Blocks.iron_ore ? (block != Blocks.lapis_block && block != Blocks.lapis_ore ? (block != Blocks.redstone_ore && block != Blocks.lit_redstone_ore ? (block.getMaterial() == Material.rock || (block.getMaterial() == Material.iron || block.getMaterial() == Material.anvil)) : harvestLevel >= 2) : harvestLevel >= 1) : harvestLevel >= 1) : harvestLevel >= 2) : harvestLevel >= 2) : harvestLevel >= 2)))); + Block block = state.getBlock(); + return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) && (this.hasExtraWhitelist(block) || block.getMaterial(state).isToolNotRequired() || (block == Blocks.SNOW_LAYER || block == Blocks.SNOW || (block == Blocks.OBSIDIAN ? harvestLevel >= 3 : (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE ? (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK ? (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE ? (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE ? (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE ? (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE ? (block.getMaterial(state) == Material.ROCK || (block.getMaterial(state) == Material.IRON || block.getMaterial(state) == Material.ANVIL)) : harvestLevel >= 2) : harvestLevel >= 1) : harvestLevel >= 1) : harvestLevel >= 2) : harvestLevel >= 2) : harvestLevel >= 2)))); } @Override @@ -333,17 +343,13 @@ public class ItemDrill extends ItemEnergy{ @Override protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[16]; for(int i = 0; i < 16; i++){ - String name = this.getBaseName()+TheColoredLampColors.values()[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + String name = this.getRegistryName()+TheColoredLampColors.values()[i].name; + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(name), "inventory"); } - ActuallyAdditions.proxy.addRenderVariant(this, resLocs); } @Override - @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List list){ for(int i = 0; i < 16; i++){ @@ -382,35 +388,13 @@ public class ItemDrill extends ItemEnergy{ efficiency += 8.0F; } } - return efficiency; - } - - /** - * Writes all of the Slots to NBT - * - * @param slots The Slots - * @param stack The Drill - */ - public void writeSlotsToNBT(ItemStack[] slots, ItemStack stack){ - NBTTagCompound compound = stack.getTagCompound(); - if(compound == null){ - compound = new NBTTagCompound(); - } - - if(slots != null && slots.length > 0){ - compound.setInteger("SlotAmount", slots.length); - NBTTagList tagList = new NBTTagList(); - for(int currentIndex = 0; currentIndex < slots.length; currentIndex++){ - if(slots[currentIndex] != null){ - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte)currentIndex); - slots[currentIndex].writeToNBT(tagCompound); - tagList.appendTag(tagCompound); - } + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){ + efficiency *= 0.5F; + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){ + efficiency *= 0.35F; } - compound.setTag("Items", tagList); } - stack.setTagCompound(compound); + return efficiency; } /** @@ -428,7 +412,7 @@ public class ItemDrill extends ItemEnergy{ int zRange = 0; //Block hit - MovingObjectPosition pos = WorldUtil.getNearestBlockWithDefaultReachDistance(world, player); + RayTraceResult pos = WorldUtil.getNearestBlockWithDefaultReachDistance(world, player); if(pos == null){ return false; } @@ -445,7 +429,8 @@ public class ItemDrill extends ItemEnergy{ } //Not defined later because main Block is getting broken below - float mainHardness = PosUtil.getBlock(aPos, world).getBlockHardness(world, aPos); + IBlockState state = world.getBlockState(aPos); + float mainHardness = state.getBlockHardness(world, aPos); //Break Middle Block first int use = this.getEnergyUsePerBlock(stack); @@ -467,7 +452,8 @@ public class ItemDrill extends ItemEnergy{ if(this.getEnergyStored(stack) >= use){ //Only break Blocks around that are (about) as hard or softer BlockPos thePos = new BlockPos(xPos, yPos, zPos); - if(PosUtil.getBlock(thePos, world).getBlockHardness(world, thePos) <= mainHardness+5.0F){ + IBlockState theState = world.getBlockState(thePos); + if(theState.getBlockHardness(world, thePos) <= mainHardness+5.0F){ this.tryHarvestBlock(world, thePos, true, stack, player, use); } } @@ -494,9 +480,10 @@ public class ItemDrill extends ItemEnergy{ * @param use The Energy that should be extracted per Block */ private boolean tryHarvestBlock(World world, BlockPos pos, boolean isExtra, ItemStack stack, EntityPlayer player, int use){ - Block block = PosUtil.getBlock(pos, world); - float hardness = block.getBlockHardness(world, pos); - boolean canHarvest = (ForgeHooks.canHarvestBlock(block, player, world, pos) || this.canHarvestBlock(block, stack)) && (!isExtra || this.getDigSpeed(stack, world.getBlockState(pos)) > 1.0F); + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + float hardness = block.getBlockHardness(state, world, pos); + boolean canHarvest = (ForgeHooks.canHarvestBlock(block, player, world, pos) || this.canHarvestBlock(state, stack)) && (!isExtra || this.getStrVsBlock(stack, world.getBlockState(pos)) > 1.0F); if(hardness >= 0.0F && (!isExtra || (canHarvest && !block.hasTileEntity(world.getBlockState(pos))))){ this.extractEnergy(stack, use, false); //Break the Block @@ -506,9 +493,9 @@ public class ItemDrill extends ItemEnergy{ } private boolean hasExtraWhitelist(Block block){ - String name = block.getRegistryName(); + String name = block.getRegistryName().toString(); if(name != null){ - for(String list : ConfigValues.drillExtraminingWhitelist){ + for(String list : ConfigStringListValues.DRILL_EXTRA_MINING_WHITELIST.getValue()){ if(list.equals(name)){ return true; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrillUpgrade.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrillUpgrade.java index 54088ca7b..9be78d3b0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrillUpgrade.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrillUpgrade.java @@ -1,11 +1,11 @@ /* - * This file ("ItemDrillUpgrade.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemDrillUpgrade.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -14,11 +14,14 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; public class ItemDrillUpgrade extends ItemBase{ - public UpgradeType type; + public final UpgradeType type; public ItemDrillUpgrade(UpgradeType type, String unlocName){ super(unlocName); @@ -34,12 +37,14 @@ public class ItemDrillUpgrade extends ItemBase{ return -1; } + @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ if(!world.isRemote && this.type == UpgradeType.PLACER){ this.setSlotToPlaceFrom(stack, player.inventory.currentItem); + return new ActionResult(EnumActionResult.SUCCESS, stack); } - return stack; + return new ActionResult(EnumActionResult.FAIL, stack); } public void setSlotToPlaceFrom(ItemStack stack, int slot){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java index 1ba612d18..0d40df918 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java @@ -1,11 +1,11 @@ /* - * This file ("ItemDust.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemDust.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -13,21 +13,21 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.metalists.TheDusts; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; -public class ItemDust extends ItemBase{ +public class ItemDust extends ItemBase implements IColorProvidingItem{ - public static final TheDusts[] allDusts = TheDusts.values(); + public static final TheDusts[] ALL_DUSTS = TheDusts.values(); public ItemDust(String name){ super(name); @@ -39,34 +39,41 @@ public class ItemDust extends ItemBase{ return damage; } - @Override - public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allDusts.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allDusts[stack.getItemDamage()].name; - } @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass){ - return stack.getItemDamage() >= allDusts.length ? 0 : allDusts[stack.getItemDamage()].color; + public String getUnlocalizedName(ItemStack stack){ + return stack.getItemDamage() >= ALL_DUSTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_DUSTS[stack.getItemDamage()].name; } + @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allDusts.length ? EnumRarity.COMMON : allDusts[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_DUSTS.length ? EnumRarity.COMMON : ALL_DUSTS[stack.getItemDamage()].rarity; } - @SuppressWarnings("all") + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allDusts.length; j++){ + for(int j = 0; j < ALL_DUSTS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ - for(int i = 0; i < allDusts.length; i++){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + for(int i = 0; i < ALL_DUSTS.length; i++){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), "inventory"); } } + + @SideOnly(Side.CLIENT) + @Override + public IItemColor getColor(){ + return new IItemColor(){ + @Override + public int getColorFromItemstack(ItemStack stack, int pass){ + return stack.getItemDamage() >= ALL_DUSTS.length ? 0xFFFFFF : ALL_DUSTS[stack.getItemDamage()].color; + } + }; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFertilizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFertilizer.java index 0a43ead28..f95a4ff15 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFertilizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFertilizer.java @@ -1,41 +1,49 @@ /* - * This file ("ItemFertilizer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemFertilizer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; +import de.ellpeck.actuallyadditions.mod.misc.DispenserHandlerFertilize; +import net.minecraft.block.BlockDispenser; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemDye; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class ItemFertilizer extends ItemBase{ public ItemFertilizer(String name){ super(name); + + BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(this, new DispenserHandlerFertilize()); } + @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float par8, float par9, float par10){ + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float par8, float par9, float par10){ if(ItemDye.applyBonemeal(stack, world, pos, player)){ if(!world.isRemote){ - world.playAuxSFX(2005, pos, 0); + world.playEvent(2005, pos, 0); } - return true; + return EnumActionResult.SUCCESS; } - return super.onItemUse(stack, player, world, pos, side, par8, par9, par10); + return super.onItemUse(stack, player, world, pos, hand, side, par8, par9, par10); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.RARE; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java new file mode 100644 index 000000000..6a5343bc5 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java @@ -0,0 +1,59 @@ +/* + * This file ("ItemFilter.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter; +import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; +import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.world.World; + +import java.util.List; + +public class ItemFilter extends ItemBase{ + + public ItemFilter(String name){ + super(name); + this.setMaxStackSize(1); + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.UNCOMMON; + } + + @Override + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ + if(!world.isRemote){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FILTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); + } + return new ActionResult(EnumActionResult.PASS, stack); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced){ + ItemStack[] slots = new ItemStack[ContainerFilter.SLOT_AMOUNT]; + ItemDrill.loadSlotsFromNBT(slots, stack); + if(slots != null && slots.length > 0){ + for(ItemStack slot : slots){ + if(slot != null && slot.getItem() != null){ + tooltip.add(slot.getItem().getItemStackDisplayName(slot)); + } + } + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java index 43448210e..a6542daa1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java @@ -1,11 +1,11 @@ /* - * This file ("ItemFoods.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemFoods.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -13,16 +13,16 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.items.base.ItemFoodBase; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -31,7 +31,7 @@ import java.util.List; public class ItemFoods extends ItemFoodBase{ - public static final TheFoods[] allFoods = TheFoods.values(); + public static final TheFoods[] ALL_FOODS = TheFoods.values(); public ItemFoods(String name){ super(0, 0.0F, false, name); @@ -41,11 +41,11 @@ public class ItemFoods extends ItemFoodBase{ } @Override - public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player){ + public ItemStack onItemUseFinish(ItemStack stack, World world, EntityLivingBase player){ ItemStack stackToReturn = super.onItemUseFinish(stack, world, player); - ItemStack returnItem = stack.getItemDamage() >= allFoods.length ? null : allFoods[stack.getItemDamage()].returnItem; - if(returnItem != null){ - if(!player.inventory.addItemStackToInventory(returnItem.copy())){ + ItemStack returnItem = stack.getItemDamage() >= ALL_FOODS.length ? null : ALL_FOODS[stack.getItemDamage()].returnItem; + if(returnItem != null && player instanceof EntityPlayer){ + if(!((EntityPlayer)player).inventory.addItemStackToInventory(returnItem.copy())){ if(!world.isRemote){ EntityItem entityItem = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, returnItem.copy()); entityItem.setPickupDelay(0); @@ -58,22 +58,22 @@ public class ItemFoods extends ItemFoodBase{ @Override public int getMaxItemUseDuration(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? 0 : allFoods[stack.getItemDamage()].useDuration; + return stack.getItemDamage() >= ALL_FOODS.length ? 0 : ALL_FOODS[stack.getItemDamage()].useDuration; } @Override public EnumAction getItemUseAction(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? EnumAction.EAT : (allFoods[stack.getItemDamage()].getsDrunken ? EnumAction.DRINK : EnumAction.EAT); + return stack.getItemDamage() >= ALL_FOODS.length ? EnumAction.EAT : (ALL_FOODS[stack.getItemDamage()].getsDrunken ? EnumAction.DRINK : EnumAction.EAT); } @Override public int getHealAmount(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? 0 : allFoods[stack.getItemDamage()].healAmount; + return stack.getItemDamage() >= ALL_FOODS.length ? 0 : ALL_FOODS[stack.getItemDamage()].healAmount; } @Override public float getSaturationModifier(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? 0 : allFoods[stack.getItemDamage()].saturation; + return stack.getItemDamage() >= ALL_FOODS.length ? 0 : ALL_FOODS[stack.getItemDamage()].saturation; } @Override @@ -81,32 +81,31 @@ public class ItemFoods extends ItemFoodBase{ return damage; } + @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allFoods[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_FOODS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_FOODS[stack.getItemDamage()].name; } + @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? EnumRarity.COMMON : allFoods[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_FOODS.length ? EnumRarity.COMMON : ALL_FOODS[stack.getItemDamage()].rarity; } - @SuppressWarnings("all") + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allFoods.length; j++){ + for(int j = 0; j < ALL_FOODS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[allFoods.length]; - for(int i = 0; i < allFoods.length; i++){ - String name = this.getBaseName()+allFoods[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + for(int i = 0; i < ALL_FOODS.length; i++){ + String name = this.getRegistryName()+ALL_FOODS[i].name; + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ModelResourceLocation(name), "inventory"); } - ActuallyAdditions.proxy.addRenderVariant(this, resLocs); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGeneric.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGeneric.java index 3b1c5e464..86238564e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGeneric.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGeneric.java @@ -1,11 +1,11 @@ /* - * This file ("ItemGeneric.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemGeneric.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -21,6 +21,7 @@ public class ItemGeneric extends ItemBase{ this.setMaxDamage(0); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.UNCOMMON; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java index f4b1922a1..9f96b6507 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java @@ -1,32 +1,32 @@ /* - * This file ("ItemGrowthRing.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemGrowthRing.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.Block; import net.minecraft.block.BlockGrass; import net.minecraft.block.IGrowable; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; import java.util.ArrayList; +import java.util.List; public class ItemGrowthRing extends ItemEnergy{ @@ -41,19 +41,14 @@ public class ItemGrowthRing extends ItemEnergy{ } EntityPlayer player = (EntityPlayer)entity; - ItemStack equipped = player.getCurrentEquippedItem(); + ItemStack equipped = player.getHeldItemMainhand(); int energyUse = 300; if(equipped != null && equipped == stack && this.getEnergyStored(stack) >= energyUse){ - ArrayList blocks = new ArrayList(); - - if(stack.getTagCompound() == null){ - stack.setTagCompound(new NBTTagCompound()); - } - int waitTime = stack.getTagCompound().getInteger("WaitTime"); + List blocks = new ArrayList(); //Adding all possible Blocks - if(waitTime >= 30){ + if(player.worldObj.getTotalWorldTime()%30 == 0){ int range = 3; for(int x = -range; x < range+1; x++){ for(int z = -range; z < range+1; z++){ @@ -62,7 +57,7 @@ public class ItemGrowthRing extends ItemEnergy{ int theY = MathHelper.floor_double(player.posY+y); int theZ = MathHelper.floor_double(player.posZ+z); BlockPos posInQuestion = new BlockPos(theX, theY, theZ); - Block theBlock = PosUtil.getBlock(posInQuestion, world); + Block theBlock = world.getBlockState(posInQuestion).getBlock(); if((theBlock instanceof IGrowable || theBlock instanceof IPlantable) && !(theBlock instanceof BlockGrass)){ blocks.add(posInQuestion); } @@ -76,12 +71,15 @@ public class ItemGrowthRing extends ItemEnergy{ if(this.getEnergyStored(stack) >= energyUse){ BlockPos pos = blocks.get(Util.RANDOM.nextInt(blocks.size())); - int metaBefore = PosUtil.getMetadata(pos, world); - PosUtil.getBlock(pos, world).updateTick(world, pos, world.getBlockState(pos), Util.RANDOM); + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + int metaBefore = block.getMetaFromState(state); + block.updateTick(world, pos, world.getBlockState(pos), Util.RANDOM); //Show Particles if Metadata changed - if(PosUtil.getMetadata(pos, world) != metaBefore){ - world.playAuxSFX(2005, pos, 0); + IBlockState newState = world.getBlockState(pos); + if(newState.getBlock().getMetaFromState(newState) != metaBefore){ + world.playEvent(2005, pos, 0); } if(!player.capabilities.isCreativeMode){ @@ -93,15 +91,11 @@ public class ItemGrowthRing extends ItemEnergy{ } } } - - stack.getTagCompound().setInteger("WaitTime", 0); - } - else{ - stack.getTagCompound().setInteger("WaitTime", waitTime+1); } } } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java index 0d4785dc2..c7598f0dd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java @@ -1,34 +1,60 @@ /* - * This file ("ItemHairyBall.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemHairyBall.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.recipe.BallOfFurReturn; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.passive.EntityOcelot; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; +import net.minecraft.util.*; import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.UUID; public class ItemHairyBall extends ItemBase{ public ItemHairyBall(String name){ super(name); + + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event){ + //Ocelots dropping Hair Balls + if(event.getEntityLiving() != null){ + if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote){ + if((event.getEntityLiving() instanceof EntityOcelot && ((EntityOcelot)event.getEntityLiving()).isTamed()) || (event.getEntityLiving() instanceof EntityPlayer && event.getEntityLiving().getUniqueID().equals(/*KittyVanCat*/ UUID.fromString("681d4e20-10ef-40c9-a0a5-ba2f1995ef44")))){ + if(ConfigBoolValues.DO_CAT_DROPS.isEnabled()){ + if(Util.RANDOM.nextInt(5000)+1 == 1){ + EntityItem item = new EntityItem(event.getEntityLiving().worldObj, event.getEntityLiving().posX+0.5, event.getEntityLiving().posY+0.5, event.getEntityLiving().posZ+0.5, new ItemStack(InitItems.itemHairyBall)); + event.getEntityLiving().worldObj.spawnEntityInWorld(item); + } + } + } + } + } } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ if(!world.isRemote){ ItemStack returnItem = this.getRandomReturnItem(); if(!player.inventory.addItemStackToInventory(returnItem)){ @@ -37,15 +63,17 @@ public class ItemHairyBall extends ItemBase{ player.worldObj.spawnEntityInWorld(entityItem); } stack.stackSize--; - world.playSoundAtEntity(player, "random.pop", 0.2F, Util.RANDOM.nextFloat()*0.1F+0.9F); + + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, Util.RANDOM.nextFloat()*0.1F+0.9F); } - return stack; + return new ActionResult(EnumActionResult.SUCCESS, stack); } public ItemStack getRandomReturnItem(){ - return ((BallOfFurReturn)WeightedRandom.getRandomItem(Util.RANDOM, ActuallyAdditionsAPI.ballOfFurReturnItems)).returnItem.copy(); + return WeightedRandom.getRandomItem(Util.RANDOM, ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS).returnItem.copy(); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java index f64c2eea5..5dfd93ffe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java @@ -1,11 +1,11 @@ /* - * This file ("ItemJams.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemJams.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -13,26 +13,28 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.items.base.ItemFoodBase; import de.ellpeck.actuallyadditions.mod.items.metalists.TheJams; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; -public class ItemJams extends ItemFoodBase{ +public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ - public static final TheJams[] allJams = TheJams.values(); + public static final TheJams[] ALL_JAMS = TheJams.values(); public ItemJams(String name){ super(0, 0.0F, false, name); @@ -46,43 +48,39 @@ public class ItemJams extends ItemFoodBase{ return damage; } - @Override - public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allJams.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allJams[stack.getItemDamage()].name; - } @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass){ - return pass > 0 ? (stack.getItemDamage() >= allJams.length ? 0 : allJams[stack.getItemDamage()].color) : super.getColorFromItemStack(stack, pass); + public String getUnlocalizedName(ItemStack stack){ + return stack.getItemDamage() >= ALL_JAMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_JAMS[stack.getItemDamage()].name; } + @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allJams.length ? EnumRarity.COMMON : allJams[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_JAMS.length ? EnumRarity.COMMON : ALL_JAMS[stack.getItemDamage()].rarity; } - @SuppressWarnings("all") + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allJams.length; j++){ + for(int j = 0; j < ALL_JAMS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override - public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player){ + public ItemStack onItemUseFinish(ItemStack stack, World world, EntityLivingBase player){ ItemStack stackToReturn = super.onItemUseFinish(stack, world, player); - if(!world.isRemote && stack.getItemDamage() < allJams.length){ - PotionEffect firstEffectToGet = new PotionEffect(allJams[stack.getItemDamage()].firstEffectToGet, 200); + if(player instanceof EntityPlayer && !world.isRemote && stack.getItemDamage() < ALL_JAMS.length){ + PotionEffect firstEffectToGet = new PotionEffect(Potion.getPotionById(ALL_JAMS[stack.getItemDamage()].firstEffectToGet), 200); player.addPotionEffect(firstEffectToGet); - PotionEffect secondEffectToGet = new PotionEffect(allJams[stack.getItemDamage()].secondEffectToGet, 600); + PotionEffect secondEffectToGet = new PotionEffect(Potion.getPotionById(ALL_JAMS[stack.getItemDamage()].secondEffectToGet), 600); player.addPotionEffect(secondEffectToGet); - ItemStack returnItem = new ItemStack(Items.glass_bottle); - if(!player.inventory.addItemStackToInventory(returnItem.copy())){ + ItemStack returnItem = new ItemStack(Items.GLASS_BOTTLE); + if(!((EntityPlayer)player).inventory.addItemStackToInventory(returnItem.copy())){ EntityItem entityItem = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, returnItem.copy()); entityItem.setPickupDelay(0); player.worldObj.spawnEntityInWorld(entityItem); @@ -93,18 +91,29 @@ public class ItemJams extends ItemFoodBase{ @Override public int getHealAmount(ItemStack stack){ - return stack.getItemDamage() >= allJams.length ? 0 : allJams[stack.getItemDamage()].healAmount; + return stack.getItemDamage() >= ALL_JAMS.length ? 0 : ALL_JAMS[stack.getItemDamage()].healAmount; } @Override public float getSaturationModifier(ItemStack stack){ - return stack.getItemDamage() >= allJams.length ? 0 : allJams[stack.getItemDamage()].saturation; + return stack.getItemDamage() >= ALL_JAMS.length ? 0 : ALL_JAMS[stack.getItemDamage()].saturation; } @Override protected void registerRendering(){ - for(int i = 0; i < allJams.length; i++){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + for(int i = 0; i < ALL_JAMS.length; i++){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), "inventory"); } } + + @Override + @SideOnly(Side.CLIENT) + public IItemColor getColor(){ + return new IItemColor(){ + @Override + public int getColorFromItemstack(ItemStack stack, int pass){ + return pass > 0 ? (stack.getItemDamage() >= ALL_JAMS.length ? 0xFFFFFF : ALL_JAMS[stack.getItemDamage()].color) : 0xFFFFFF; + } + }; + } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java index ecaad022b..2becdff1a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java @@ -1,11 +1,11 @@ /* - * This file ("ItemKnife.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemKnife.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -14,6 +14,7 @@ import com.google.common.collect.Multimap; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; @@ -32,19 +33,23 @@ public class ItemKnife extends ItemBase{ return true; } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; } - @SuppressWarnings("unchecked") + @Override - public Multimap getAttributeModifiers(ItemStack stack){ - Multimap map = super.getAttributeModifiers(stack); - map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(itemModifierUUID, "Knife Modifier", 3, 0)); + public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){ + Multimap map = super.getAttributeModifiers(slot, stack); + if(slot == EntityEquipmentSlot.MAINHAND){ + map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Knife Modifier", 3, 0)); + } return map; } + @Override public ItemStack getContainerItem(ItemStack stack){ ItemStack theStack = stack.copy(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java index 18f914a88..a2318f1d7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java @@ -1,29 +1,37 @@ /* - * This file ("ItemLaserWrench.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemLaserWrench.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; +import de.ellpeck.actuallyadditions.mod.data.PlayerData; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; +import de.ellpeck.actuallyadditions.mod.network.PacketHandler; +import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -38,32 +46,59 @@ public class ItemLaserWrench extends ItemBase{ } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing par7, float par8, float par9, float par10){ - if(!world.isRemote){ - TileEntity tile = world.getTileEntity(pos); - if(tile instanceof TileEntityLaserRelay){ + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing par7, float par8, float par9, float par10){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityLaserRelay){ + if(!world.isRemote){ if(ItemPhantomConnector.getStoredPosition(stack) == null){ ItemPhantomConnector.storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world); - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".laser.stored.desc"))); + player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.stored.desc")); } else{ BlockPos savedPos = ItemPhantomConnector.getStoredPosition(stack); - if(ItemPhantomConnector.getStoredWorld(stack) == world && world.getTileEntity(savedPos) instanceof TileEntityLaserRelay && LaserRelayConnectionHandler.getInstance().addConnection(savedPos, pos)){ - ItemPhantomConnector.clearStorage(stack); + if(savedPos != null){ + TileEntity savedTile = world.getTileEntity(savedPos); + if(ItemPhantomConnector.getStoredWorld(stack) == world && savedTile instanceof TileEntityLaserRelay && ((TileEntityLaserRelay)savedTile).isItem == ((TileEntityLaserRelay)tile).isItem && LaserRelayConnectionHandler.addConnection(savedPos, pos, world)){ + ItemPhantomConnector.clearStorage(stack); - ((TileEntityLaserRelay)world.getTileEntity(savedPos)).sendUpdate(); - ((TileEntityLaserRelay)world.getTileEntity(pos)).sendUpdate(); + ((TileEntityLaserRelay)world.getTileEntity(savedPos)).sendUpdate(); + ((TileEntityLaserRelay)world.getTileEntity(pos)).sendUpdate(); - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".laser.connected.desc"))); - } - else{ - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".laser.cantConnect.desc"))); - ItemPhantomConnector.clearStorage(stack); + player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.connected.desc")); + } + else{ + player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.cantConnect.desc")); + ItemPhantomConnector.clearStorage(stack); + } } } } + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.FAIL; + } + + @Override + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ + if(!world.isRemote && player.isSneaking()){ + PlayerData.PlayerSave save = PlayerData.getDataFromPlayer(player); + + int currMode = save.theCompound.getInteger("LaserWrenchMode"); + if(currMode+1 >= WrenchMode.values().length){ + currMode = 0; + } + else{ + currMode++; + } + save.theCompound.setInteger("LaserWrenchMode", currMode); + + if(player instanceof EntityPlayerMP){ + PacketHandler.theNetwork.sendTo(new PacketServerToClient(save.theCompound, PacketHandler.PLAYER_DATA_TO_CLIENT_HANDLER), (EntityPlayerMP)player); + } + + player.addChatComponentMessage(new TextComponentString("Mode changed to "+WrenchMode.values()[currMode].name+"!")); + } + return new ActionResult(EnumActionResult.SUCCESS, stack); } @Override @@ -79,16 +114,15 @@ public class ItemLaserWrench extends ItemBase{ } @Override - @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ BlockPos coords = ItemPhantomConnector.getStoredPosition(stack); if(coords != null){ - list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".boundTo.desc")+":"); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID+".boundTo.desc")+":"); list.add("X: "+coords.getX()); list.add("Y: "+coords.getY()); list.add("Z: "+coords.getZ()); - list.add(EnumChatFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".clearStorage.desc")); + list.add(TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".clearStorage.desc")); } } @@ -96,4 +130,16 @@ public class ItemLaserWrench extends ItemBase{ public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; } + + public enum WrenchMode{ + ALWAYS_PARTICLES("always show particles"), + NO_PARTICLES("never show particles"), + HOLDING_PARTICLES("show particles when holding a Laser Wrench"); + + public final String name; + + WrenchMode(String name){ + this.name = name; + } + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java index 82ac810a9..46c506985 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java @@ -1,33 +1,40 @@ /* - * This file ("ItemLeafBlower.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemLeafBlower.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; +import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockBush; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumAction; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import java.util.ArrayList; import java.util.Collections; -public class ItemLeafBlower extends ItemBase{ +public class ItemLeafBlower extends ItemBase implements IDisplayStandItem{ private final boolean isAdvanced; @@ -37,12 +44,14 @@ public class ItemLeafBlower extends ItemBase{ this.setMaxStackSize(1); } + @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ - player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); - return stack; + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ + player.setActiveHand(hand); + return new ActionResult(EnumActionResult.SUCCESS, stack); } + @Override public EnumAction getItemUseAction(ItemStack stack){ return EnumAction.BOW; @@ -54,23 +63,30 @@ public class ItemLeafBlower extends ItemBase{ return Integer.MAX_VALUE; } + @Override public EnumRarity getRarity(ItemStack stack){ return this.isAdvanced ? EnumRarity.EPIC : EnumRarity.RARE; } @Override - public void onUsingTick(ItemStack stack, EntityPlayer player, int time){ - if(!player.worldObj.isRemote){ - if(time <= getMaxItemUseDuration(stack) && (this.isAdvanced || time%3 == 0)){ + public void onUsingTick(ItemStack stack, EntityLivingBase player, int time){ + this.doUpdate(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), time, stack); + } + + private boolean doUpdate(World world, int x, int y, int z, int time, ItemStack stack){ + if(!world.isRemote){ + if(time <= this.getMaxItemUseDuration(stack) && (this.isAdvanced || time%3 == 0)){ //Breaks the Blocks - this.breakStuff(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)); + boolean broke = this.breakStuff(world, x, y, z); //Plays a Minecart sounds (It really sounds like a Leaf Blower!) - if(!ConfigValues.lessSound){ - player.worldObj.playSoundAtEntity(player, "minecart.base", 0.3F, 0.001F); + if(!ConfigBoolValues.LESS_SOUND.isEnabled()){ + world.playSound(null, x, y, z, SoundEvents.ENTITY_MINECART_RIDING, SoundCategory.PLAYERS, 0.3F, 0.001F); } + return broke; } } + return false; } /** @@ -81,7 +97,7 @@ public class ItemLeafBlower extends ItemBase{ * @param y The Y Position of the Player * @param z The Z Position of the Player */ - public void breakStuff(World world, int x, int y, int z){ + public boolean breakStuff(World world, int x, int y, int z){ ArrayList breakPositions = new ArrayList(); int rangeSides = 5; @@ -91,8 +107,8 @@ public class ItemLeafBlower extends ItemBase{ for(int reachY = (this.isAdvanced ? -rangeSides : -rangeUp); reachY < (this.isAdvanced ? rangeSides : rangeUp)+1; reachY++){ //The current Block to break BlockPos pos = new BlockPos(x+reachX, y+reachY, z+reachZ); - Block block = PosUtil.getBlock(pos, world); - if(block != null && (block instanceof BlockBush || (this.isAdvanced && block.isLeaves(world, pos)))){ + Block block = world.getBlockState(pos).getBlock(); + if(block != null && (block instanceof BlockBush || (this.isAdvanced && block.isLeaves(world.getBlockState(pos), world, pos)))){ breakPositions.add(pos); } } @@ -103,15 +119,15 @@ public class ItemLeafBlower extends ItemBase{ Collections.shuffle(breakPositions); BlockPos theCoord = breakPositions.get(0); - Block theBlock = PosUtil.getBlock(theCoord, world); + Block theBlock = world.getBlockState(theCoord).getBlock(); ArrayList drops = new ArrayList(); //Gets all of the Drops the Block should have drops.addAll(theBlock.getDrops(world, theCoord, world.getBlockState(theCoord), 0)); //Plays the Breaking Sound - if(!ConfigValues.lessBlockBreakingEffects){ - world.playAuxSFX(2001, theCoord, Block.getStateId(world.getBlockState(theCoord))); + if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ + world.playEvent(2001, theCoord, Block.getStateId(world.getBlockState(theCoord))); } //Deletes the Block @@ -121,6 +137,18 @@ public class ItemLeafBlower extends ItemBase{ //Drops the Items into the World world.spawnEntityInWorld(new EntityItem(world, theCoord.getX()+0.5, theCoord.getY()+0.5, theCoord.getZ()+0.5, theDrop)); } + return true; } + return false; + } + + @Override + public boolean update(ItemStack stack, TileEntity tile, int elapsedTicks){ + return this.doUpdate(tile.getWorld(), tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ(), elapsedTicks, stack); + } + + @Override + public int getUsePerTick(ItemStack stack, TileEntity tile, int elapsedTicks){ + return 60; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java index 0f4422e89..777b035d8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMagnetRing.java @@ -1,11 +1,11 @@ /* - * This file ("ItemMagnetRing.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemMagnetRing.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -16,8 +16,8 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import java.util.ArrayList; @@ -28,20 +28,19 @@ public class ItemMagnetRing extends ItemEnergy{ super(3000000, 5000, name); } - @SuppressWarnings("unchecked") @Override public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5){ int energyUse = 10; if(!entity.isSneaking()){ //Get all the Items in the area int range = 5; - ArrayList items = (ArrayList)world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.fromBounds(entity.posX-range, entity.posY-range, entity.posZ-range, entity.posX+range, entity.posY+range, entity.posZ+range)); + ArrayList items = (ArrayList)world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(entity.posX-range, entity.posY-range, entity.posZ-range, entity.posX+range, entity.posY+range, entity.posZ+range)); if(!items.isEmpty()){ for(EntityItem item : items){ if(this.getEnergyStored(stack) >= energyUse){ //If the Item is near enough to get picked up //(So it doesn't bounce around until it notices itself..) - if(new Vec3(entity.posX, entity.posY, entity.posZ).distanceTo(new Vec3(item.posX, item.posY, item.posZ)) <= 1.5){ + if(new Vec3d(entity.posX, entity.posY, entity.posZ).distanceTo(new Vec3d(item.posX, item.posY, item.posZ)) <= 1.5){ item.onCollideWithPlayer((EntityPlayer)entity); } else{ @@ -64,6 +63,7 @@ public class ItemMagnetRing extends ItemEnergy{ } } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java index 474e97826..49f9c5063 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java @@ -1,11 +1,11 @@ /* - * This file ("ItemMisc.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemMisc.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; @@ -27,7 +26,7 @@ import java.util.List; public class ItemMisc extends ItemBase{ - public static final TheMiscItems[] allMiscItems = TheMiscItems.values(); + public static final TheMiscItems[] ALL_MISC_ITEMS = TheMiscItems.values(); public ItemMisc(String name){ super(name); @@ -41,30 +40,30 @@ public class ItemMisc extends ItemBase{ @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allMiscItems.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allMiscItems[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_MISC_ITEMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_MISC_ITEMS[stack.getItemDamage()].name; } + @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allMiscItems.length ? EnumRarity.COMMON : allMiscItems[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_MISC_ITEMS.length ? EnumRarity.COMMON : ALL_MISC_ITEMS[stack.getItemDamage()].rarity; } - @SuppressWarnings("all") + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allMiscItems.length; j++){ - list.add(new ItemStack(this, 1, j)); + for(int j = 0; j < ALL_MISC_ITEMS.length; j++){ + if(j != TheMiscItems.YOUTUBE_ICON.ordinal()){ + list.add(new ItemStack(this, 1, j)); + } } } @Override protected void registerRendering(){ - ResourceLocation[] resLocs = new ResourceLocation[allMiscItems.length]; - for(int i = 0; i < allMiscItems.length; i++){ - String name = this.getBaseName()+allMiscItems[i].name; - resLocs[i] = new ResourceLocation(ModUtil.MOD_ID_LOWER, name); - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, name)); + for(int i = 0; i < ALL_MISC_ITEMS.length; i++){ + String name = this.getRegistryName()+ALL_MISC_ITEMS[i].name; + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(name), "inventory"); } - ActuallyAdditions.proxy.addRenderVariant(this, resLocs); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java index 6ae2a195e..89d423448 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java @@ -1,11 +1,11 @@ /* - * This file ("ItemPhantomConnector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemPhantomConnector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -21,10 +21,12 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fml.relauncher.Side; @@ -73,13 +75,14 @@ public class ItemPhantomConnector extends ItemBase{ tag.setInteger("XCoordOfTileStored", x); tag.setInteger("YCoordOfTileStored", y); tag.setInteger("ZCoordOfTileStored", z); - tag.setInteger("WorldOfTileStored", world.provider.getDimensionId()); + tag.setInteger("WorldOfTileStored", world.provider.getDimension()); stack.setTagCompound(tag); } + @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing par7, float par8, float par9, float par10){ + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing par7, float par8, float par9, float par10){ if(!world.isRemote){ //Passing Data to Phantoms TileEntity tile = world.getTileEntity(pos); @@ -92,17 +95,17 @@ public class ItemPhantomConnector extends ItemBase{ ((TileEntityBase)tile).sendUpdate(); } clearStorage(stack); - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connected.desc"))); - return true; + player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.connected.desc")); + return EnumActionResult.SUCCESS; } - return false; + return EnumActionResult.FAIL; } } //Storing Connections storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world); - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.stored.desc"))); + player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.stored.desc")); } - return true; + return EnumActionResult.SUCCESS; } public boolean checkHasConnection(ItemStack stack, EntityPlayer player, TileEntity tile){ @@ -113,7 +116,7 @@ public class ItemPhantomConnector extends ItemBase{ if(tile instanceof IPhantomTile){ ((IPhantomTile)tile).setBoundPosition(null); } - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.unbound.desc"))); + player.addChatComponentMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.unbound.desc")); return false; } } @@ -131,19 +134,19 @@ public class ItemPhantomConnector extends ItemBase{ } @Override - @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ BlockPos coords = getStoredPosition(stack); if(coords != null){ - list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".boundTo.desc")+":"); + list.add(StringUtil.localize("tooltip."+ModUtil.MOD_ID+".boundTo.desc")+":"); list.add("X: "+coords.getX()); list.add("Y: "+coords.getY()); list.add("Z: "+coords.getZ()); - list.add(EnumChatFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".clearStorage.desc")); + list.add(TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".clearStorage.desc")); } } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java new file mode 100644 index 000000000..79019a955 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java @@ -0,0 +1,83 @@ +/* + * This file ("ItemPickaxeAA.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items; + +import com.google.common.collect.Sets; +import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.Set; + +public class ItemPickaxeAA extends ItemToolAA{ + + private static final Set EFFECTIVE_ON = Sets.newHashSet(Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL, Blocks.GOLD_BLOCK, Blocks.GOLD_ORE, Blocks.ICE, Blocks.IRON_BLOCK, Blocks.IRON_ORE, Blocks.LAPIS_BLOCK, Blocks.LAPIS_ORE, Blocks.LIT_REDSTONE_ORE, Blocks.MOSSY_COBBLESTONE, Blocks.NETHERRACK, Blocks.PACKED_ICE, Blocks.RAIL, Blocks.REDSTONE_ORE, Blocks.SANDSTONE, Blocks.RED_SANDSTONE, Blocks.STONE, Blocks.STONE_SLAB, Blocks.STONE_BUTTON, Blocks.STONE_PRESSURE_PLATE); + + public ItemPickaxeAA(Item.ToolMaterial material, String repairItem, String unlocalizedName, EnumRarity rarity){ + super(1.0F, -2.8F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + } + + public ItemPickaxeAA(Item.ToolMaterial material, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ + super(1.0F, -2.8F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + } + + @Override + public boolean canHarvestBlock(IBlockState blockIn){ + Block block = blockIn.getBlock(); + + if(block == Blocks.OBSIDIAN){ + return this.toolMaterial.getHarvestLevel() == 3; + } + else if(block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE){ + if(block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK){ + if(block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE){ + if(block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE){ + if(block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE){ + if(block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE){ + Material material = blockIn.getMaterial(); + return material == Material.ROCK || (material == Material.IRON || material == Material.ANVIL); + } + else{ + return this.toolMaterial.getHarvestLevel() >= 2; + } + } + else{ + return this.toolMaterial.getHarvestLevel() >= 1; + } + } + else{ + return this.toolMaterial.getHarvestLevel() >= 1; + } + } + else{ + return this.toolMaterial.getHarvestLevel() >= 2; + } + } + else{ + return this.toolMaterial.getHarvestLevel() >= 2; + } + } + else{ + return this.toolMaterial.getHarvestLevel() >= 2; + } + } + + @Override + public float getStrVsBlock(ItemStack stack, IBlockState state){ + Material material = state.getMaterial(); + return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java index 5728b0a3b..325bea2aa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java @@ -1,39 +1,46 @@ /* - * This file ("ItemPotionRing.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemPotionRing.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; +import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.metalists.ThePotionRings; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem; import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.ResourceLocation; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import java.util.Collections; import java.util.List; -public class ItemPotionRing extends ItemBase{ +public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDisplayStandItem{ - public static final ThePotionRings[] allRings = ThePotionRings.values(); + public static final ThePotionRings[] ALL_RINGS = ThePotionRings.values(); - private boolean isAdvanced; + private final boolean isAdvanced; public ItemPotionRing(boolean isAdvanced, String name){ super(name); @@ -47,38 +54,21 @@ public class ItemPotionRing extends ItemBase{ return damage; } + @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allRings.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allRings[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_RINGS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_RINGS[stack.getItemDamage()].name; } @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass){ - return stack.getItemDamage() >= allRings.length ? 0 : allRings[stack.getItemDamage()].color; - } - - @Override - @SuppressWarnings("unchecked") public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5){ super.onUpdate(stack, world, player, par4, par5); - if(!world.isRemote && stack.getItemDamage() < allRings.length){ + if(!world.isRemote && stack.getItemDamage() < ALL_RINGS.length){ if(player instanceof EntityPlayer){ EntityPlayer thePlayer = (EntityPlayer)player; - ItemStack equippedStack = ((EntityPlayer)player).getCurrentEquippedItem(); - - ThePotionRings effect = ThePotionRings.values()[stack.getItemDamage()]; - if(!effect.needsWaitBeforeActivating || !thePlayer.isPotionActive(effect.effectID)){ - if(!((ItemPotionRing)stack.getItem()).isAdvanced){ - if(equippedStack != null && stack == equippedStack){ - thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.normalAmplifier, true, false)); - } - } - else{ - thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.advancedAmplifier, true, false)); - } - } + ItemStack equippedStack = thePlayer.getHeldItemMainhand(); + this.effectEntity(thePlayer, stack, equippedStack != null && stack == equippedStack); } } } @@ -86,30 +76,103 @@ public class ItemPotionRing extends ItemBase{ @Override public String getItemStackDisplayName(ItemStack stack){ String standardName = StringUtil.localize(this.getUnlocalizedName()+".name"); - if(stack.getItemDamage() < allRings.length){ - String effect = StringUtil.localize(allRings[stack.getItemDamage()].name); + if(stack.getItemDamage() < ALL_RINGS.length){ + String effect = StringUtil.localize(ALL_RINGS[stack.getItemDamage()].name); return standardName+" "+effect; } return standardName; } + @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allRings.length ? EnumRarity.COMMON : allRings[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_RINGS.length ? EnumRarity.COMMON : ALL_RINGS[stack.getItemDamage()].rarity; } - @SuppressWarnings("all") + @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allRings.length; j++){ + for(int j = 0; j < ALL_RINGS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ - for(int i = 0; i < allRings.length; i++){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + for(int i = 0; i < ALL_RINGS.length; i++){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), "inventory"); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IItemColor getColor(){ + return new IItemColor(){ + @Override + public int getColorFromItemstack(ItemStack stack, int tintIndex){ + return stack.getItemDamage() >= ALL_RINGS.length ? 0xFFFFFF : ALL_RINGS[stack.getItemDamage()].color; + } + }; + } + + @Override + public boolean update(ItemStack stack, TileEntity tile, int elapsedTicks){ + boolean advanced = ((ItemPotionRing)stack.getItem()).isAdvanced; + int range = advanced ? 96 : 16; + List entities = tile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(tile.getPos().getX()-range, tile.getPos().getY()-range, tile.getPos().getZ()-range, tile.getPos().getX()+range, tile.getPos().getY()+range, tile.getPos().getZ()+range)); + if(entities != null && !entities.isEmpty()){ + if(advanced){ + //Give all entities the effect + for(EntityLivingBase entity : entities){ + this.effectEntity(entity, stack, true); + } + return true; + } + else{ + Potion potion = Potion.getPotionById(ThePotionRings.values()[stack.getItemDamage()].effectID); + for(EntityLivingBase entity : entities){ + if(entity.isPotionActive(potion)){ + //Sometimes make the effect switch to someone else + if(Util.RANDOM.nextInt(100) <= 0){ + entity.removePotionEffect(potion); + break; + } + else{ + //Continue giving the entity that already has the potion effect the effect + //Otherwise, it will randomly switch around to other entities + this.effectEntity(entity, stack, true); + return true; + } + } + } + + //Give the effect to someone new if no one had it or it randomly switched + Collections.shuffle(entities); + this.effectEntity(entities.get(0), stack, true); + return true; + } + } + return false; + } + + @Override + public int getUsePerTick(ItemStack stack, TileEntity tile, int elapsedTicks){ + return 325; + } + + private void effectEntity(EntityLivingBase thePlayer, ItemStack stack, boolean canUseBasic){ + ThePotionRings effect = ThePotionRings.values()[stack.getItemDamage()]; + Potion potion = Potion.getPotionById(effect.effectID); + PotionEffect activeEffect = thePlayer.getActivePotionEffect(potion); + if(!effect.needsWaitBeforeActivating || (activeEffect == null || activeEffect.getDuration() <= 1)){ + if(!((ItemPotionRing)stack.getItem()).isAdvanced){ + if(canUseBasic){ + thePlayer.addPotionEffect(new PotionEffect(potion, effect.activeTime, effect.normalAmplifier, true, false)); + } + } + else{ + thePlayer.addPotionEffect(new PotionEffect(potion, effect.activeTime, effect.advancedAmplifier, true, false)); + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemResonantRice.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemResonantRice.java index 91f7f35a9..08e8ccce1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemResonantRice.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemResonantRice.java @@ -1,11 +1,11 @@ /* - * This file ("ItemResonantRice.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemResonantRice.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -14,6 +14,9 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; public class ItemResonantRice extends ItemBase{ @@ -22,15 +25,17 @@ public class ItemResonantRice extends ItemBase{ super(name); } + @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ if(!world.isRemote){ stack.stackSize--; world.createExplosion(null, player.posX, player.posY, player.posZ, 0.5F, true); } - return stack; + return new ActionResult(EnumActionResult.SUCCESS, stack); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java new file mode 100644 index 000000000..cfaa63932 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemShovelAA.java @@ -0,0 +1,54 @@ +/* + * This file ("ItemShovelAA.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items; + +import com.google.common.collect.Sets; +import de.ellpeck.actuallyadditions.mod.items.base.ItemToolAA; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.Set; + +public class ItemShovelAA extends ItemToolAA{ + + private static final Set EFFECTIVE_ON = Sets.newHashSet(Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH); + + public ItemShovelAA(Item.ToolMaterial material, String repairItem, String unlocalizedName, EnumRarity rarity){ + super(1.5F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + } + + public ItemShovelAA(Item.ToolMaterial material, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ + super(1.5F, -3.0F, material, repairItem, unlocalizedName, rarity, EFFECTIVE_ON); + } + + @Override + public boolean canHarvestBlock(IBlockState blockIn){ + Block block = blockIn.getBlock(); + return block == Blocks.SNOW_LAYER || block == Blocks.SNOW; + } + + + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ + return Items.IRON_SHOVEL.onItemUse(stack, playerIn, worldIn, pos, hand, facing, hitX, hitY, hitZ); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java index 22ff464e0..05afa683f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java @@ -1,21 +1,32 @@ /* - * This file ("ItemSolidifiedExperience.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemSolidifiedExperience.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; +import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.entity.EntityCreature; import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntitySpider; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class ItemSolidifiedExperience extends ItemBase{ @@ -23,10 +34,24 @@ public class ItemSolidifiedExperience extends ItemBase{ public ItemSolidifiedExperience(String name){ super(name); + + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onEntityDropEvent(LivingDropsEvent event){ + if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ + //Drop Solidified XP + if(event.getEntityLiving() instanceof EntityCreature){ + if(Util.RANDOM.nextInt(10) <= event.getLootingLevel()*2){ + event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, Util.RANDOM.nextInt(2+event.getLootingLevel())+1), 0); + } + } + } } @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ if(!world.isRemote){ if(!player.isSneaking()){ world.spawnEntityInWorld(new EntityXPOrb(world, player.posX+0.5, player.posY+0.5, player.posZ+0.5, SOLID_XP_AMOUNT)); @@ -41,9 +66,10 @@ public class ItemSolidifiedExperience extends ItemBase{ } } } - return stack; + return new ActionResult(EnumActionResult.SUCCESS, stack); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.UNCOMMON; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java new file mode 100644 index 000000000..79f56ebb3 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java @@ -0,0 +1,145 @@ +/* + * This file ("ItemSpawnerChanger.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items; + +import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; +import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; +import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import java.util.List; + +public class ItemSpawnerChanger extends ItemBase{ + + public ItemSpawnerChanger(String name){ + super(name); + this.setMaxStackSize(1); + + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onBlockBreakEvent(BlockEvent.HarvestDropsEvent event){ + IBlockState state = event.getState(); + if(state != null && state.getBlock() == Blocks.MOB_SPAWNER){ + event.getDrops().add(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal())); + } + } + + @Override + public EnumActionResult onItemUse(ItemStack aStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ){ + if(!world.isRemote){ + ItemStack stack = player.getHeldItemMainhand(); + if(player.canPlayerEdit(pos.offset(facing), facing, stack)){ + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityMobSpawner){ + String entity = this.getStoredEntity(stack); + if(entity != null){ + MobSpawnerBaseLogic logic = ((TileEntityMobSpawner)tile).getSpawnerBaseLogic(); + logic.setEntityName(entity); + + tile.markDirty(); + + IBlockState state = world.getBlockState(pos); + world.notifyBlockUpdate(pos, state, state, 3); + + ItemPhantomConnector.clearStorage(stack); + + if(!player.capabilities.isCreativeMode){ + stack.stackSize--; + } + + return EnumActionResult.SUCCESS; + } + } + } + } + return EnumActionResult.FAIL; + } + + @Override + public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer player, EntityLivingBase entity, EnumHand hand){ + if(!player.worldObj.isRemote){ + ItemStack stack = player.getHeldItemMainhand(); + if(this.getStoredEntity(stack) == null){ + if(this.storeClickedEntity(stack, entity)){ + entity.setDead(); + } + } + return true; + } + return false; + } + + private boolean storeClickedEntity(ItemStack stack, EntityLivingBase entity){ + if(!stack.hasTagCompound()){ + stack.setTagCompound(new NBTTagCompound()); + } + + if(!(entity instanceof EntityPlayer)){ + String entityName = EntityList.getEntityString(entity); + if(entityName != null && !entityName.isEmpty()){ + for(String name : ConfigStringListValues.SPAWNER_CHANGER_BLACKLIST.getValue()){ + if(entityName.equals(name)){ + return false; + } + } + + stack.getTagCompound().setString("Entity", entityName); + return true; + } + } + return false; + } + + private String getStoredEntity(ItemStack stack){ + if(stack.hasTagCompound()){ + String entity = stack.getTagCompound().getString("Entity"); + if(entity != null && !entity.isEmpty()){ + return entity; + } + } + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + String entity = this.getStoredEntity(stack); + if(entity != null){ + list.add("Entity: "+entity); + list.add(TextFormatting.ITALIC+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".clearStorage.desc")); + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemTeleStaff.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemTeleStaff.java index f22a94cca..58e806e7c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemTeleStaff.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemTeleStaff.java @@ -1,11 +1,11 @@ /* - * This file ("ItemTeleStaff.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemTeleStaff.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; @@ -15,11 +15,16 @@ import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.SoundEvents; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.Vec3; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public class ItemTeleStaff extends ItemEnergy{ @@ -28,34 +33,36 @@ public class ItemTeleStaff extends ItemEnergy{ super(500000, 10000, name); } + @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ if(!world.isRemote){ if(this.getWaitTime(stack) <= 0){ - MovingObjectPosition pos = WorldUtil.getNearestPositionWithAir(world, player, 100); - if(pos != null && (pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK || player.rotationPitch >= -5)){ + RayTraceResult pos = WorldUtil.getNearestPositionWithAir(world, player, 100); + if(pos != null && (pos.typeOfHit == RayTraceResult.Type.BLOCK || player.rotationPitch >= -5)){ int side = pos.sideHit.ordinal(); if(side != -1){ double x = pos.hitVec.xCoord-(side == 4 ? 0.5 : 0)+(side == 5 ? 0.5 : 0); double y = pos.hitVec.yCoord-(side == 0 ? 2.0 : 0)+(side == 1 ? 0.5 : 0); double z = pos.hitVec.zCoord-(side == 2 ? 0.5 : 0)+(side == 3 ? 0.5 : 0); int baseUse = 200; - int use = baseUse+(int)(baseUse*pos.hitVec.distanceTo(new Vec3(player.posX, player.posY+(player.getEyeHeight()-player.getDefaultEyeHeight()), player.posZ))); + int use = baseUse+(int)(baseUse*pos.hitVec.distanceTo(new Vec3d(player.posX, player.posY+(player.getEyeHeight()-player.getDefaultEyeHeight()), player.posZ))); if(this.getEnergyStored(stack) >= use){ - ((EntityPlayerMP)player).playerNetServerHandler.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch); - player.mountEntity(null); - world.playSoundAtEntity(player, "mob.endermen.portal", 1.0F, 1.0F); + ((EntityPlayerMP)player).connection.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch); + player.dismountRidingEntity(); + world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1.0F, 1.0F); if(!player.capabilities.isCreativeMode){ this.extractEnergy(stack, use, false); this.setWaitTime(stack, 50); } + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } } } } } - player.swingItem(); - return stack; + player.swingArm(hand); + return ActionResult.newResult(EnumActionResult.FAIL, stack); } @Override @@ -66,6 +73,7 @@ public class ItemTeleStaff extends ItemEnergy{ } } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java new file mode 100644 index 000000000..ec63fce58 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java @@ -0,0 +1,142 @@ +/* + * This file ("ItemWaterBowl.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items; + +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; +import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.ItemStack; +import net.minecraft.util.*; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class ItemWaterBowl extends ItemBase{ + + public ItemWaterBowl(String name){ + super(name); + this.setMaxStackSize(1); + + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onPlayerInteractEvent(PlayerInteractEvent event){ + if(event.getWorld() != null){ + if(ConfigBoolValues.WATER_BOWL.isEnabled()){ + if(event.getItemStack() != null && event.getItemStack().getItem() == Items.BOWL){ + RayTraceResult trace = WorldUtil.getNearestBlockWithDefaultReachDistance(event.getWorld(), event.getEntityPlayer(), true, false, false); + ActionResult result = ForgeEventFactory.onBucketUse(event.getEntityPlayer(), event.getWorld(), event.getItemStack(), trace); + if(result == null && trace != null && trace.getBlockPos() != null){ + if(event.getEntityPlayer().canPlayerEdit(trace.getBlockPos().offset(trace.sideHit), trace.sideHit, event.getItemStack())){ + IBlockState state = event.getWorld().getBlockState(trace.getBlockPos()); + Material material = state.getMaterial(); + + if(material == Material.WATER && state.getValue(BlockLiquid.LEVEL) == 0){ + event.getEntityPlayer().playSound(SoundEvents.ITEM_BUCKET_FILL, 1.0F, 1.0F); + + if(!event.getWorld().isRemote){ + event.getWorld().setBlockState(trace.getBlockPos(), Blocks.AIR.getDefaultState(), 11); + event.getItemStack().stackSize--; + + ItemStack bowl = new ItemStack(InitItems.itemWaterBowl); + if(!event.getEntityPlayer().inventory.addItemStackToInventory(bowl.copy())){ + EntityItem entityItem = new EntityItem(event.getWorld(), event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, bowl.copy()); + entityItem.setPickupDelay(0); + event.getWorld().spawnEntityInWorld(entityItem); + } + } + } + } + } + } + } + } + } + + @Override + public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ + RayTraceResult trace = WorldUtil.getNearestBlockWithDefaultReachDistance(world, player); + ActionResult result = ForgeEventFactory.onBucketUse(player, world, stack, trace); + if(result != null){ + return result; + } + + if(trace == null){ + return new ActionResult(EnumActionResult.PASS, stack); + } + else if(trace.typeOfHit != RayTraceResult.Type.BLOCK){ + return new ActionResult(EnumActionResult.PASS, stack); + } + else{ + BlockPos pos = trace.getBlockPos(); + + if(!world.isBlockModifiable(player, pos)){ + return new ActionResult(EnumActionResult.FAIL, stack); + } + else{ + BlockPos pos1 = world.getBlockState(pos).getBlock().isReplaceable(world, pos) && trace.sideHit == EnumFacing.UP ? pos : pos.offset(trace.sideHit); + + if(!player.canPlayerEdit(pos1, trace.sideHit, stack)){ + return new ActionResult(EnumActionResult.FAIL, stack); + } + else if(this.tryPlaceContainedLiquid(player, world, pos1)){ + return !player.capabilities.isCreativeMode ? new ActionResult(EnumActionResult.SUCCESS, new ItemStack(Items.BOWL)) : new ActionResult(EnumActionResult.SUCCESS, stack); + } + else{ + return new ActionResult(EnumActionResult.FAIL, stack); + } + } + } + } + + public boolean tryPlaceContainedLiquid(EntityPlayer player, World world, BlockPos pos){ + IBlockState state = world.getBlockState(pos); + Material material = state.getMaterial(); + boolean nonSolid = !material.isSolid(); + boolean replaceable = state.getBlock().isReplaceable(world, pos); + + if(!world.isAirBlock(pos) && !nonSolid && !replaceable){ + return false; + } + else{ + if(world.provider.doesWaterVaporize()){ + world.playSound(player, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F+(world.rand.nextFloat()-world.rand.nextFloat())*0.8F); + + for(int k = 0; k < 8; k++){ + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)pos.getX()+Math.random(), (double)pos.getY()+Math.random(), (double)pos.getZ()+Math.random(), 0.0D, 0.0D, 0.0D); + } + } + else{ + if(!world.isRemote && (nonSolid || replaceable) && !material.isLiquid()){ + world.destroyBlock(pos, true); + } + + world.playSound(player, pos, SoundEvents.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F); + world.setBlockState(pos, Blocks.FLOWING_WATER.getDefaultState(), 3); + } + + return true; + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterRemovalRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterRemovalRing.java index 4609a552b..21f0fb2a5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterRemovalRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterRemovalRing.java @@ -1,26 +1,25 @@ /* - * This file ("ItemWaterRemovalRing.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemWaterRemovalRing.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; public class ItemWaterRemovalRing extends ItemEnergy{ @@ -36,7 +35,7 @@ public class ItemWaterRemovalRing extends ItemEnergy{ } EntityPlayer player = (EntityPlayer)entity; - ItemStack equipped = player.getCurrentEquippedItem(); + ItemStack equipped = player.getHeldItemMainhand(); int energyUse = 350; if(equipped != null && equipped == stack && this.getEnergyStored(stack) >= energyUse){ @@ -52,8 +51,8 @@ public class ItemWaterRemovalRing extends ItemEnergy{ //Remove Water BlockPos pos = new BlockPos(theX, theY, theZ); - Block block = PosUtil.getBlock(pos, world); - if((block == Blocks.water || block == Blocks.flowing_water) && this.getEnergyStored(stack) >= energyUse){ + Block block = world.getBlockState(pos).getBlock(); + if((block == Blocks.WATER || block == Blocks.FLOWING_WATER) && this.getEnergyStored(stack) >= energyUse){ world.setBlockToAir(pos); if(!player.capabilities.isCreativeMode){ @@ -61,7 +60,7 @@ public class ItemWaterRemovalRing extends ItemEnergy{ } } //Remove Lava - else if((block == Blocks.lava || block == Blocks.flowing_lava) && this.getEnergyStored(stack) >= energyUse*2){ + else if((block == Blocks.LAVA || block == Blocks.FLOWING_LAVA) && this.getEnergyStored(stack) >= energyUse*2){ world.setBlockToAir(pos); if(!player.capabilities.isCreativeMode){ @@ -74,6 +73,7 @@ public class ItemWaterRemovalRing extends ItemEnergy{ } } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java index 50dca5adb..0fb8f9c4c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java @@ -1,19 +1,32 @@ /* - * This file ("ItemWingsOfTheBats.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemWingsOfTheBats.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; +import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.passive.EntityBat; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.event.entity.living.LivingEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.PlayerEvent; import java.util.ArrayList; @@ -29,11 +42,66 @@ public class ItemWingsOfTheBats extends ItemBase{ *

* (Partially excerpted from Botania's Wing System by Vazkii (as I had fiddled around with the system and couldn't make it work) with permission, thanks!) */ - public static ArrayList wingedPlayers = new ArrayList(); + public static final ArrayList WINGED_PLAYERS = new ArrayList(); public ItemWingsOfTheBats(String name){ super(name); this.setMaxStackSize(1); + + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onLogOutEvent(PlayerEvent.PlayerLoggedOutEvent event){ + //Remove Player from Wings' Fly Permission List + ItemWingsOfTheBats.removeWingsFromPlayer(event.player, true); + ItemWingsOfTheBats.removeWingsFromPlayer(event.player, false); + } + + @SubscribeEvent + public void onEntityDropEvent(LivingDropsEvent event){ + if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ + //Drop Wings from Bats + if(ConfigBoolValues.DO_BAT_DROPS.isEnabled() && event.getEntityLiving() instanceof EntityBat){ + if(Util.RANDOM.nextInt(15) <= event.getLootingLevel()*2){ + event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemMisc, Util.RANDOM.nextInt(2+event.getLootingLevel())+1, TheMiscItems.BAT_WING.ordinal()), 0); + } + } + } + } + + @SubscribeEvent + public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event){ + if(event.getEntityLiving() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer)event.getEntityLiving(); + boolean wingsEquipped = ItemWingsOfTheBats.getWingItem(player) != null; + + //If Player isn't (really) winged + if(!ItemWingsOfTheBats.isPlayerWinged(player)){ + if(wingsEquipped){ + //Make the Player actually winged + ItemWingsOfTheBats.addWingsToPlayer(player); + } + } + //If Player is (or should be) winged + else{ + if(wingsEquipped){ + //Allow the Player to fly when he has Wings equipped + player.capabilities.allowFlying = true; + } + else{ + //Make the Player not winged + ItemWingsOfTheBats.removeWingsFromPlayer(player); + //Reset Player's Values + if(!player.capabilities.isCreativeMode){ + player.capabilities.allowFlying = false; + player.capabilities.isFlying = false; + //Enables Fall Damage again (Automatically gets disabled for some reason) + player.capabilities.disableDamage = false; + } + } + } + } } /** @@ -43,7 +111,7 @@ public class ItemWingsOfTheBats extends ItemBase{ * @return Winged? */ public static boolean isPlayerWinged(EntityPlayer player){ - return wingedPlayers.contains(player.getUniqueID()+(player.worldObj.isRemote ? "-Remote" : "")); + return WINGED_PLAYERS.contains(player.getUniqueID()+(player.worldObj.isRemote ? "-Remote" : "")); } /** @@ -60,7 +128,7 @@ public class ItemWingsOfTheBats extends ItemBase{ * @param worldRemote If the World the Player is in is remote */ public static void removeWingsFromPlayer(EntityPlayer player, boolean worldRemote){ - wingedPlayers.remove(player.getUniqueID()+(worldRemote ? "-Remote" : "")); + WINGED_PLAYERS.remove(player.getUniqueID()+(worldRemote ? "-Remote" : "")); } /** @@ -69,7 +137,7 @@ public class ItemWingsOfTheBats extends ItemBase{ * @param player The Player */ public static void addWingsToPlayer(EntityPlayer player){ - wingedPlayers.add(player.getUniqueID()+(player.worldObj.isRemote ? "-Remote" : "")); + WINGED_PLAYERS.add(player.getUniqueID()+(player.worldObj.isRemote ? "-Remote" : "")); } /** @@ -87,6 +155,7 @@ public class ItemWingsOfTheBats extends ItemBase{ return null; } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAllToolAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAllToolAA.java deleted file mode 100644 index 8c794b77b..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAllToolAA.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * This file ("ItemAllToolAA.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.items.base; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import net.minecraft.block.Block; -import net.minecraft.block.BlockDirt; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemTool; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.event.ForgeEventFactory; -import net.minecraftforge.fml.common.registry.GameRegistry; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.HashSet; -import java.util.Set; - -@SuppressWarnings("unchecked") -public class ItemAllToolAA extends ItemTool{ - - private int color; - - private String name; - private EnumRarity rarity; - private ItemStack repairItem; - private String repairOredict; - - public ItemAllToolAA(ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity, int color){ - this(toolMat, (ItemStack)null, unlocalizedName, rarity, color); - this.repairOredict = repairItem; - } - - public ItemAllToolAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity, int color){ - super(4.0F, toolMat, new HashSet()); - - this.repairItem = repairItem; - this.name = unlocalizedName; - this.rarity = rarity; - this.color = color; - - this.setMaxDamage(this.getMaxDamage()*4); - - this.register(); - } - - private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } - - this.registerRendering(); - } - - protected String getBaseName(){ - return this.name; - } - - public boolean shouldAddCreative(){ - return true; - } - - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel")); - ActuallyAdditions.proxy.addRenderVariant(this, new ResourceLocation(ModUtil.MOD_ID_LOWER, "itemPaxel")); - } - - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ){ - if(!playerIn.canPlayerEdit(pos.offset(side), side, stack)){ - return false; - } - else{ - int hook = ForgeEventFactory.onHoeUse(stack, playerIn, worldIn, pos); - if(hook != 0){ - return hook > 0; - } - - IBlockState state = worldIn.getBlockState(pos); - Block block = state.getBlock(); - - if(side != EnumFacing.DOWN && worldIn.isAirBlock(pos.up())){ - if(block == Blocks.grass){ - return this.useHoe(stack, playerIn, worldIn, pos, Blocks.farmland.getDefaultState()); - } - - if(block == Blocks.dirt){ - switch(state.getValue(BlockDirt.VARIANT)){ - case DIRT: - return this.useHoe(stack, playerIn, worldIn, pos, Blocks.farmland.getDefaultState()); - case COARSE_DIRT: - return this.useHoe(stack, playerIn, worldIn, pos, Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT)); - } - } - } - - return false; - } - } - - private boolean useHoe(ItemStack stack, EntityPlayer player, World worldIn, BlockPos target, IBlockState newState){ - worldIn.playSoundEffect((double)((float)target.getX()+0.5F), (double)((float)target.getY()+0.5F), (double)((float)target.getZ()+0.5F), newState.getBlock().stepSound.getStepSound(), (newState.getBlock().stepSound.getVolume()+1.0F)/2.0F, newState.getBlock().stepSound.getFrequency()*0.8F); - - if(worldIn.isRemote){ - return true; - } - else{ - worldIn.setBlockState(target, newState); - stack.damageItem(1, player); - return true; - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass){ - return pass > 0 ? this.color : super.getColorFromItemStack(stack, pass); - } - - @Override - public EnumRarity getRarity(ItemStack stack){ - return this.rarity; - } - - @Override - public boolean canHarvestBlock(Block block, ItemStack stack){ - return this.hasExtraWhitelist(block) || block.getMaterial().isToolNotRequired() || (block == Blocks.snow_layer || block == Blocks.snow || (block == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() >= 3 : (block != Blocks.diamond_block && block != Blocks.diamond_ore ? (block != Blocks.emerald_ore && block != Blocks.emerald_block ? (block != Blocks.gold_block && block != Blocks.gold_ore ? (block != Blocks.iron_block && block != Blocks.iron_ore ? (block != Blocks.lapis_block && block != Blocks.lapis_ore ? (block != Blocks.redstone_ore && block != Blocks.lit_redstone_ore ? (block.getMaterial() == Material.rock || (block.getMaterial() == Material.iron || block.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2))); - } - - private boolean hasExtraWhitelist(Block block){ - String name = block.getRegistryName(); - if(name != null){ - for(String list : ConfigValues.paxelExtraMiningWhitelist){ - if(list.equals(name)){ - return true; - } - } - } - return false; - } - - @Override - public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ - if(this.repairItem != null){ - return ItemUtil.areItemsEqual(this.repairItem, stack, false); - } - else if(this.repairOredict != null){ - int[] idsStack = OreDictionary.getOreIDs(stack); - for(int id : idsStack){ - if(OreDictionary.getOreName(id).equals(this.repairOredict)){ - return true; - } - } - } - return false; - } - - @Override - public Set getToolClasses(ItemStack stack){ - HashSet hashSet = new HashSet(); - hashSet.add("pickaxe"); - hashSet.add("axe"); - hashSet.add("shovel"); - return hashSet; - } - - @Override - public float getDigSpeed(ItemStack stack, IBlockState state){ - return this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getHarvestTool(state) == null || state.getBlock().getHarvestTool(state).isEmpty() || this.getToolClasses(stack).contains(state.getBlock().getHarvestTool(state)) ? this.efficiencyOnProperMaterial : 1.0F; - } -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemArmorAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemArmorAA.java index 02c77af81..9cc783e69 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemArmorAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemArmorAA.java @@ -1,37 +1,34 @@ /* - * This file ("ItemArmorAA.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemArmorAA.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; +import de.ellpeck.actuallyadditions.mod.inventory.ContainerEnergizer; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemArmorAA extends ItemArmor{ - private ItemStack repairItem; - private String name; - private EnumRarity rarity; + private final ItemStack repairItem; + private final String name; + private final EnumRarity rarity; - public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase){ - this(name, material, type, repairItem, textureBase, EnumRarity.RARE); + public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem){ + this(name, material, type, repairItem, EnumRarity.RARE); } - public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, String textureBase, EnumRarity rarity){ - super(material, 0, type); + public ItemArmorAA(String name, ArmorMaterial material, int type, ItemStack repairItem, EnumRarity rarity){ + super(material, 0, ContainerEnergizer.VALID_EQUIPMENT_SLOTS[type]); this.repairItem = repairItem; this.name = name; this.rarity = rarity; @@ -40,14 +37,7 @@ public class ItemArmorAA extends ItemArmor{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -61,9 +51,10 @@ public class ItemArmorAA extends ItemArmor{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } + @Override public EnumRarity getRarity(ItemStack stack){ return this.rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAxeAA.java deleted file mode 100644 index 88dcd4e7b..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemAxeAA.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file ("ItemAxeAA.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.items.base; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemAxe; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; - -public class ItemAxeAA extends ItemAxe{ - - private String name; - private EnumRarity rarity; - private ItemStack repairItem; - - public ItemAxeAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ - super(toolMat); - - this.repairItem = repairItem; - this.name = unlocalizedName; - this.rarity = rarity; - - this.register(); - } - - private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } - - this.registerRendering(); - } - - protected String getBaseName(){ - return this.name; - } - - public boolean shouldAddCreative(){ - return true; - } - - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - - @Override - public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ - return ItemUtil.areItemsEqual(this.repairItem, stack, false); - } - - @Override - public EnumRarity getRarity(ItemStack stack){ - return this.rarity; - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBase.java index f54470f57..136b0fceb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBase.java @@ -1,27 +1,24 @@ /* - * This file ("ItemBase.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemBase.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemBase extends Item{ - private String name; + private final String name; public ItemBase(String name){ this.name = name; @@ -30,14 +27,7 @@ public class ItemBase extends Item{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -51,6 +41,6 @@ public class ItemBase extends Item{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBucketAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBucketAA.java deleted file mode 100644 index 509c89a7c..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemBucketAA.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file ("ItemBucketAA.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.items.base; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import net.minecraft.block.Block; -import net.minecraft.init.Items; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemBucket; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; - -public class ItemBucketAA extends ItemBucket{ - - private String name; - - public ItemBucketAA(Block block, String unlocName){ - super(block); - this.name = unlocName; - this.setContainerItem(Items.bucket); - - this.register(); - } - - private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } - - this.registerRendering(); - } - - protected String getBaseName(){ - return this.name; - } - - public boolean shouldAddCreative(){ - return true; - } - - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - - @Override - public EnumRarity getRarity(ItemStack stack){ - return EnumRarity.UNCOMMON; - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java index 129ebc385..35f0d50c8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemEnergy.java @@ -1,27 +1,24 @@ /* - * This file ("ItemEnergy.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemEnergy.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.base; import cofh.api.energy.ItemEnergyContainer; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -29,7 +26,7 @@ import java.util.List; public abstract class ItemEnergy extends ItemEnergyContainer{ - private String name; + private final String name; public ItemEnergy(int maxPower, int transfer, String name){ super(maxPower, transfer); @@ -41,14 +38,7 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -62,7 +52,7 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } @Override @@ -75,7 +65,6 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ this.setEnergy(stack, 0); } - @SuppressWarnings("unchecked") @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){ list.add(this.getEnergyStored(stack)+"/"+this.getMaxEnergyStored(stack)+" RF"); @@ -88,7 +77,6 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ } @Override - @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List list){ ItemStack stackFull = new ItemStack(this); @@ -107,8 +95,8 @@ public abstract class ItemEnergy extends ItemEnergyContainer{ @Override public double getDurabilityForDisplay(ItemStack stack){ - double energyDif = getMaxEnergyStored(stack)-getEnergyStored(stack); - double maxAmount = getMaxEnergyStored(stack); + double energyDif = this.getMaxEnergyStored(stack)-this.getEnergyStored(stack); + double maxAmount = this.getMaxEnergyStored(stack); return energyDif/maxAmount; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodBase.java index a185c9f5d..38db32413 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodBase.java @@ -1,27 +1,24 @@ /* - * This file ("ItemFoodBase.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemFoodBase.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemFoodBase extends ItemFood{ - private String name; + private final String name; public ItemFoodBase(int heal, float saturation, boolean wolfFood, String name){ super(heal, saturation, wolfFood); @@ -31,14 +28,7 @@ public class ItemFoodBase extends ItemFood{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -52,6 +42,6 @@ public class ItemFoodBase extends ItemFood{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodSeed.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodSeed.java new file mode 100644 index 000000000..f6a279443 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemFoodSeed.java @@ -0,0 +1,81 @@ +/* + * This file ("ItemFoodSeed.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items.base; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemSeedFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class ItemFoodSeed extends ItemSeedFood{ + + public final Block plant; + public final String name; + public final String oredictName; + private final int maxUseDuration; + + public ItemFoodSeed(String name, String oredictName, Block plant, Item returnItem, int returnMeta, int healAmount, float saturation, int maxUseDuration){ + super(healAmount, saturation, plant, Blocks.FARMLAND); + this.name = name; + this.oredictName = oredictName; + this.plant = plant; + this.maxUseDuration = maxUseDuration; + + if(plant instanceof BlockPlant){ + ((BlockPlant)plant).doStuff(this, returnItem, returnMeta); + } + + this.register(); + } + + private void register(){ + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); + + this.registerRendering(); + } + + @Override + public int getMaxItemUseDuration(ItemStack stack){ + return this.maxUseDuration; + } + + protected String getBaseName(){ + return this.name; + } + + public boolean shouldAddCreative(){ + return true; + } + + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.RARE; + } + + @Override + public IBlockState getPlant(IBlockAccess world, BlockPos pos){ + return this.plant.getDefaultState(); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemHoeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemHoeAA.java index 03ed69239..a3e5fa8b4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemHoeAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemHoeAA.java @@ -1,31 +1,27 @@ /* - * This file ("ItemHoeAA.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemHoeAA.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemHoe; import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemHoeAA extends ItemHoe{ - private String name; - private EnumRarity rarity; - private ItemStack repairItem; + private final String name; + private final EnumRarity rarity; + private final ItemStack repairItem; public ItemHoeAA(Item.ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ super(toolMat); @@ -38,14 +34,7 @@ public class ItemHoeAA extends ItemHoe{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -59,9 +48,10 @@ public class ItemHoeAA extends ItemHoe{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } + @Override public EnumRarity getRarity(ItemStack stack){ return this.rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemPickaxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemPickaxeAA.java deleted file mode 100644 index a9d084248..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemPickaxeAA.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file ("ItemPickaxeAA.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.items.base; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemPickaxe; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; - -public class ItemPickaxeAA extends ItemPickaxe{ - - private String name; - private EnumRarity rarity; - private ItemStack repairItem; - - public ItemPickaxeAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ - super(toolMat); - - this.repairItem = repairItem; - this.name = unlocalizedName; - this.rarity = rarity; - - this.register(); - } - - private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } - - this.registerRendering(); - } - - protected String getBaseName(){ - return this.name; - } - - public boolean shouldAddCreative(){ - return true; - } - - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - - @Override - public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ - return ItemUtil.areItemsEqual(this.repairItem, stack, false); - } - - @Override - public EnumRarity getRarity(ItemStack stack){ - return this.rarity; - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSeed.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSeed.java index 0a02f544d..d67a9a8e1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSeed.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSeed.java @@ -1,19 +1,18 @@ /* - * This file ("ItemSeed.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemSeed.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; @@ -21,38 +20,30 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemSeeds; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; -import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemSeed extends ItemSeeds{ - public Block plant; - public String name; - public String oredictName; + public final Block plant; + public final String name; + public final String oredictName; public ItemSeed(String name, String oredictName, Block plant, Item returnItem, int returnMeta){ - super(plant, Blocks.farmland); + super(plant, Blocks.FARMLAND); this.name = name; this.oredictName = oredictName; this.plant = plant; if(plant instanceof BlockPlant){ - ((BlockPlant)this.plant).seedItem = this; - ((BlockPlant)this.plant).returnItem = returnItem; - ((BlockPlant)this.plant).returnMeta = returnMeta; + ((BlockPlant)plant).doStuff(this, returnItem, returnMeta); } this.register(); } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -66,7 +57,7 @@ public class ItemSeed extends ItemSeeds{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemShovelAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemShovelAA.java deleted file mode 100644 index 8fb0a68ea..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemShovelAA.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This file ("ItemShovelAA.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.items.base; - -import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemSpade; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; - -public class ItemShovelAA extends ItemSpade{ - - private String name; - private EnumRarity rarity; - private ItemStack repairItem; - - public ItemShovelAA(Item.ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ - super(toolMat); - - this.repairItem = repairItem; - this.name = unlocalizedName; - this.rarity = rarity; - - this.register(); - } - - private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } - - this.registerRendering(); - } - - protected String getBaseName(){ - return this.name; - } - - public boolean shouldAddCreative(){ - return true; - } - - protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); - } - - @Override - public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ - return ItemUtil.areItemsEqual(this.repairItem, stack, false); - } - - @Override - public EnumRarity getRarity(ItemStack stack){ - return this.rarity; - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSwordAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSwordAA.java index 90ec82529..f0b2c0b9c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSwordAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemSwordAA.java @@ -1,31 +1,27 @@ /* - * This file ("ItemSwordAA.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemSwordAA.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.base; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; -import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.common.registry.GameRegistry; public class ItemSwordAA extends ItemSword{ - private String name; - private EnumRarity rarity; - private ItemStack repairItem; + private final String name; + private final EnumRarity rarity; + private final ItemStack repairItem; public ItemSwordAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ super(toolMat); @@ -38,14 +34,7 @@ public class ItemSwordAA extends ItemSword{ } private void register(){ - this.setUnlocalizedName(ModUtil.MOD_ID_LOWER+"."+this.getBaseName()); - GameRegistry.registerItem(this, this.getBaseName()); - if(this.shouldAddCreative()){ - this.setCreativeTab(CreativeTab.instance); - } - else{ - this.setCreativeTab(null); - } + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); this.registerRendering(); } @@ -59,7 +48,7 @@ public class ItemSwordAA extends ItemSword{ } protected void registerRendering(){ - ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), new ResourceLocation(ModUtil.MOD_ID_LOWER, this.getBaseName())); + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); } protected Class getItemBlock(){ @@ -71,6 +60,7 @@ public class ItemSwordAA extends ItemSword{ return ItemUtil.areItemsEqual(this.repairItem, stack, false); } + @Override public EnumRarity getRarity(ItemStack stack){ return this.rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemToolAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemToolAA.java new file mode 100644 index 000000000..032e3f14a --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/base/ItemToolAA.java @@ -0,0 +1,84 @@ +/* + * This file ("ItemToolAA.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items.base; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; +import net.minecraft.block.Block; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.Set; + +public class ItemToolAA extends ItemTool{ + + private final String name; + private final EnumRarity rarity; + private final ItemStack repairItem; + private String repairOredict; + + public ItemToolAA(float attack, float speed, ToolMaterial toolMat, String repairItem, String unlocalizedName, EnumRarity rarity, Set effectiveStuff){ + this(attack, speed, toolMat, (ItemStack)null, unlocalizedName, rarity, effectiveStuff); + this.repairOredict = repairItem; + } + + public ItemToolAA(float attack, float speed, ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity, Set effectiveStuff){ + super(attack, speed, toolMat, effectiveStuff); + + this.repairItem = repairItem; + this.name = unlocalizedName; + this.rarity = rarity; + + this.register(); + } + + private void register(){ + ItemUtil.registerItem(this, this.getBaseName(), this.shouldAddCreative()); + + this.registerRendering(); + } + + protected String getBaseName(){ + return this.name; + } + + public boolean shouldAddCreative(){ + return true; + } + + protected void registerRendering(){ + ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); + } + + + @Override + public EnumRarity getRarity(ItemStack stack){ + return this.rarity; + } + + @Override + public boolean getIsRepairable(ItemStack itemToRepair, ItemStack stack){ + if(this.repairItem != null){ + return ItemUtil.areItemsEqual(this.repairItem, stack, false); + } + else if(this.repairOredict != null){ + int[] idsStack = OreDictionary.getOreIDs(stack); + for(int id : idsStack){ + if(OreDictionary.getOreName(id).equals(this.repairOredict)){ + return true; + } + } + } + return false; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java index 5ba2e0d6c..4c06fb290 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/ItemLens.java @@ -1,11 +1,11 @@ /* - * This file ("ItemLens.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemLens.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.lens; @@ -18,7 +18,7 @@ import net.minecraft.item.ItemStack; public class ItemLens extends ItemBase implements ILensItem{ - private Lens type; + private final Lens type; public ItemLens(String name, Lens type){ super(name); @@ -27,6 +27,7 @@ public class ItemLens extends ItemBase implements ILensItem{ this.setMaxStackSize(1); } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.UNCOMMON; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensColor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensColor.java index 5bab22e1e..5f63cf9e4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensColor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensColor.java @@ -1,46 +1,39 @@ /* - * This file ("LensColor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("LensColor.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.lens; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.lens.Lens; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import java.util.ArrayList; +import java.util.Map; public class LensColor extends Lens{ public static final int ENERGY_USE = 200; - public static final Object[] CONVERTABLE_BLOCKS = new Object[]{ - Items.dye, - Blocks.wool, - Blocks.stained_glass, - Blocks.stained_glass_pane, - Blocks.stained_hardened_clay, - Blocks.carpet, - InitBlocks.blockColoredLamp, - InitBlocks.blockColoredLampOn - }; + //Thanks to xdjackiexd for this, as I couldn't be bothered - private static final float[][] possibleColorLensColors = { + private static final float[][] POSSIBLE_COLORS = { {158F, 43F, 39F}, //Red {234F, 126F, 53F}, //Orange {194F, 181F, 28F}, //Yellow @@ -55,34 +48,26 @@ public class LensColor extends Lens{ {86F, 51F, 28F}, //Brown }; - @SuppressWarnings("unchecked") @Override - public boolean invoke(BlockPos hitBlock, IAtomicReconstructor tile){ + public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ if(hitBlock != null){ - if(Util.arrayContains(CONVERTABLE_BLOCKS, PosUtil.getBlock(hitBlock, tile.getWorldObject())) >= 0 && tile.getEnergy() >= ENERGY_USE){ - int meta = PosUtil.getMetadata(hitBlock, tile.getWorldObject()); - if(meta >= 15){ - PosUtil.setMetadata(hitBlock, tile.getWorldObject(), 0, 2); + if(tile.getEnergy() >= ENERGY_USE){ + IBlockState state = tile.getWorldObject().getBlockState(hitBlock); + Block block = state.getBlock(); + int meta = block.getMetaFromState(state); + ItemStack returnStack = this.tryConvert(new ItemStack(block, 1, meta), hitState, hitBlock, tile); + if(returnStack != null && returnStack.getItem() instanceof ItemBlock){ + tile.getWorldObject().setBlockState(hitBlock, Block.getBlockFromItem(returnStack.getItem()).getStateFromMeta(returnStack.getItemDamage()), 2); + + tile.extractEnergy(ENERGY_USE); } - else{ - PosUtil.setMetadata(hitBlock, tile.getWorldObject(), meta+1, 2); - } - tile.extractEnergy(ENERGY_USE); } - ArrayList items = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.fromBounds(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); + ArrayList items = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); for(EntityItem item : items){ if(!item.isDead && item.getEntityItem() != null && tile.getEnergy() >= ENERGY_USE){ - if(Util.arrayContains(CONVERTABLE_BLOCKS, item.getEntityItem().getItem()) >= 0 || Util.arrayContains(CONVERTABLE_BLOCKS, Block.getBlockFromItem(item.getEntityItem().getItem())) >= 0){ - ItemStack newStack = item.getEntityItem().copy(); - int meta = newStack.getItemDamage(); - if(meta >= 15){ - newStack.setItemDamage(0); - } - else{ - newStack.setItemDamage(meta+1); - } - + ItemStack newStack = this.tryConvert(item.getEntityItem(), hitState, hitBlock, tile); + if(newStack != null){ item.setDead(); EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, newStack); @@ -96,9 +81,24 @@ public class LensColor extends Lens{ return false; } + private ItemStack tryConvert(ItemStack stack, IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ + if(stack != null){ + Item item = stack.getItem(); + if(item != null){ + for(Map.Entry changer : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_COLOR_CHANGERS.entrySet()){ + if(item == changer.getKey()){ + return changer.getValue().modifyItem(stack, hitState, hitBlock, tile); + } + } + } + } + + return null; + } + @Override public float[] getColor(){ - float[] colors = possibleColorLensColors[Util.RANDOM.nextInt(possibleColorLensColors.length)]; + float[] colors = POSSIBLE_COLORS[Util.RANDOM.nextInt(POSSIBLE_COLORS.length)]; return new float[]{colors[0]/255F, colors[1]/255F, colors[2]/255F}; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDeath.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDeath.java index 35e3166b2..0fd6f8e0f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDeath.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDeath.java @@ -1,11 +1,11 @@ /* - * This file ("LensDeath.java") is part of the Actually Additions Mod for Minecraft. + * This file ("LensDeath.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.lens; @@ -13,29 +13,28 @@ package de.ellpeck.actuallyadditions.mod.items.lens; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.mod.misc.DamageSources; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; import java.util.ArrayList; public class LensDeath extends Lens{ - @SuppressWarnings("unchecked") @Override - public boolean invoke(BlockPos hitBlock, IAtomicReconstructor tile){ + public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ int use = 150; //Per Block (because it doesn't only activate when something is hit like the other lenses!) if(tile.getEnergy() >= use){ tile.extractEnergy(use); - ArrayList entities = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.fromBounds(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); + ArrayList entities = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), hitBlock.getX()+1, hitBlock.getY()+1, hitBlock.getZ()+1)); for(EntityLivingBase entity : entities){ entity.attackEntityFrom(DamageSources.DAMAGE_ATOMIC_RECONSTRUCTOR, 20F); } } - return hitBlock != null && !PosUtil.getBlock(hitBlock, tile.getWorldObject()).isAir(tile.getWorldObject(), hitBlock); + return hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDetonation.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDetonation.java index 83b556617..125e802fa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDetonation.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDetonation.java @@ -1,25 +1,25 @@ /* - * This file ("LensDetonation.java") is part of the Actually Additions Mod for Minecraft. + * This file ("LensDetonation.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.lens; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.lens.Lens; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import net.minecraft.util.BlockPos; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; public class LensDetonation extends Lens{ @Override - public boolean invoke(BlockPos hitBlock, IAtomicReconstructor tile){ - if(hitBlock != null && !PosUtil.getBlock(hitBlock, tile.getWorldObject()).isAir(tile.getWorldObject(), hitBlock)){ + public boolean invoke(IBlockState state, BlockPos hitBlock, IAtomicReconstructor tile){ + if(hitBlock != null && !state.getBlock().isAir(state, tile.getWorldObject(), hitBlock)){ int use = 250000; if(tile.getEnergy() >= use){ tile.getWorldObject().newExplosion(null, hitBlock.getX()+0.5, hitBlock.getY()+0.5, hitBlock.getZ()+0.5, 10F, true, true); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisruption.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisruption.java new file mode 100644 index 000000000..b98f212e4 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisruption.java @@ -0,0 +1,80 @@ +/* + * This file ("LensDisruption.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items.lens; + +import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; +import de.ellpeck.actuallyadditions.api.lens.Lens; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; + +import java.util.ArrayList; + +public class LensDisruption extends Lens{ + + @Override + public boolean invoke(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ + int energyUse = 150000; + if(tile.getEnergy() >= energyUse && hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock)){ + int range = 2; + ArrayList items = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX()-range, hitBlock.getY()-range, hitBlock.getZ()-range, hitBlock.getX()+range, hitBlock.getY()+range, hitBlock.getZ()+range)); + for(EntityItem item : items){ + ItemStack stack = item.getEntityItem(); + if(!item.isDead && stack != null){ + if(!stack.hasTagCompound() || !stack.getTagCompound().getBoolean(ModUtil.MOD_ID+"DisruptedAlready")){ + ItemStack newStack = null; + + while(newStack == null || newStack.getItem() == null){ + if(Util.RANDOM.nextBoolean()){ + newStack = new ItemStack(Item.REGISTRY.getRandomObject(Util.RANDOM)); + } + else{ + newStack = new ItemStack(Block.REGISTRY.getRandomObject(Util.RANDOM)); + } + } + newStack.stackSize = stack.stackSize; + + if(!newStack.hasTagCompound()){ + newStack.setTagCompound(new NBTTagCompound()); + } + newStack.getTagCompound().setBoolean(ModUtil.MOD_ID+"DisruptedAlready", true); + + item.setDead(); + + EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, newStack); + tile.getWorldObject().spawnEntityInWorld(newItem); + + tile.extractEnergy(energyUse); + } + } + } + return true; + } + return false; + } + + @Override + public float[] getColor(){ + return new float[]{246F/255F, 255F/255F, 183F/255F}; + } + + @Override + public int getDistance(){ + return 3; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java deleted file mode 100644 index c3c277920..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNone.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * This file ("LensNone.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.items.lens; - - -import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; -import de.ellpeck.actuallyadditions.api.lens.Lens; -import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import net.minecraft.block.Block; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.BlockPos; - -import java.util.ArrayList; -import java.util.List; - -public class LensNone extends Lens{ - - @SuppressWarnings("unchecked") - @Override - public boolean invoke(BlockPos hitBlock, IAtomicReconstructor tile){ - if(hitBlock != null && !PosUtil.getBlock(hitBlock, tile.getWorldObject()).isAir(tile.getWorldObject(), hitBlock)){ - int range = 2; - - //Converting the Blocks - for(int reachX = -range; reachX < range+1; reachX++){ - for(int reachZ = -range; reachZ < range+1; reachZ++){ - for(int reachY = -range; reachY < range+1; reachY++){ - BlockPos pos = new BlockPos(hitBlock.getX()+reachX, hitBlock.getY()+reachY, hitBlock.getZ()+reachZ); - List recipes = LensNoneRecipeHandler.getRecipesFor(new ItemStack(PosUtil.getBlock(pos, tile.getWorldObject()), 1, PosUtil.getMetadata(pos, tile.getWorldObject()))); - for(LensNoneRecipe recipe : recipes){ - if(recipe != null && tile.getEnergy() >= recipe.energyUse){ - List outputs = recipe.getOutputs(); - if(outputs != null && !outputs.isEmpty()){ - ItemStack output = outputs.get(0); - if(output.getItem() instanceof ItemBlock){ - if(!ConfigValues.lessBlockBreakingEffects){ - tile.getWorldObject().playAuxSFX(2001, pos, Block.getStateId(tile.getWorldObject().getBlockState(pos))); - } - PosUtil.setBlock(pos, tile.getWorldObject(), Block.getBlockFromItem(output.getItem()), output.getItemDamage(), 2); - } - else{ - EntityItem item = new EntityItem(tile.getWorldObject(), pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, output.copy()); - tile.getWorldObject().spawnEntityInWorld(item); - } - tile.extractEnergy(recipe.energyUse); - break; - } - } - } - } - } - } - - //Converting the Items - ArrayList items = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.fromBounds(hitBlock.getX()-range, hitBlock.getY()-range, hitBlock.getZ()-range, hitBlock.getX()+range, hitBlock.getY()+range, hitBlock.getZ()+range)); - for(EntityItem item : items){ - ItemStack stack = item.getEntityItem(); - if(!item.isDead && stack != null){ - List recipes = LensNoneRecipeHandler.getRecipesFor(stack); - for(LensNoneRecipe recipe : recipes){ - if(recipe != null && tile.getEnergy() >= recipe.energyUse){ - List outputs = recipe.getOutputs(); - if(outputs != null && !outputs.isEmpty()){ - ItemStack outputCopy = outputs.get(0).copy(); - outputCopy.stackSize = stack.stackSize; - - item.setDead(); - - EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, outputCopy); - tile.getWorldObject().spawnEntityInWorld(newItem); - - tile.extractEnergy(recipe.energyUse); - break; - } - } - } - } - } - return true; - } - return false; - } - - @Override - public float[] getColor(){ - return new float[]{27F/255F, 109F/255F, 1F}; - } - - @Override - public int getDistance(){ - return 10; - } - -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNoneRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNoneRecipeHandler.java deleted file mode 100644 index e3f8e4145..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensNoneRecipeHandler.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * This file ("LensNoneRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.items.lens; - -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; - -import java.util.ArrayList; - -public class LensNoneRecipeHandler{ - - public static ArrayList mainPageRecipes = new ArrayList(); - public static LensNoneRecipe recipeColorLens; - public static LensNoneRecipe recipeSoulSand; - public static LensNoneRecipe recipeGreenWall; - public static LensNoneRecipe recipeWhiteWall; - public static LensNoneRecipe recipeExplosionLens; - public static LensNoneRecipe recipeDamageLens; - public static LensNoneRecipe recipeLeather; - public static LensNoneRecipe recipeNetherWart; - - public static void init(){ - //Crystal Blocks - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.redstone_block), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.REDSTONE.ordinal()), 400); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.lapis_block), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()), 400); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.diamond_block), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), 600); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.emerald_block), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.EMERALD.ordinal()), 1000); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.coal_block), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 600); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.iron_block), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 800); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - - //Crystal Items - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.redstone), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 40); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.dye, 1, 4), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 40); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.diamond), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 60); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.emerald), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), 100); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.coal), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 60); - mainPageRecipes.add(Util.GetRecipes.lastReconstructorRecipe()); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.iron_ingot), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 80); - - //Lenses - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new ItemStack(InitItems.itemColorLens), 5000); - recipeColorLens = Util.GetRecipes.lastReconstructorRecipe(); - - if(ConfigCrafting.RECONSTRUCTOR_EXPLOSION_LENS.isEnabled()){ - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(InitItems.itemColorLens), new ItemStack(InitItems.itemExplosionLens), 5000); - recipeExplosionLens = Util.GetRecipes.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(InitItems.itemExplosionLens), new ItemStack(InitItems.itemDamageLens), 5000); - } - else{ - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(InitItems.itemColorLens), new ItemStack(InitItems.itemDamageLens), 5000); - } - recipeDamageLens = Util.GetRecipes.lastReconstructorRecipe(); - - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(InitItems.itemDamageLens), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 5000); - - //Misc - if(ConfigCrafting.RECONSTRUCTOR_MISC.isEnabled()){ - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.sand), new ItemStack(Blocks.soul_sand), 20000); - recipeSoulSand = Util.GetRecipes.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Items.rotten_flesh), new ItemStack(Items.leather), 8000); - recipeLeather = Util.GetRecipes.lastReconstructorRecipe(); - - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.red_mushroom), new ItemStack(Items.nether_wart), 150000); - recipeNetherWart = Util.GetRecipes.lastReconstructorRecipe(); - } - - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.quartz_block), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10); - recipeWhiteWall = Util.GetRecipes.lastReconstructorRecipe(); - ActuallyAdditionsAPI.addReconstructorLensNoneRecipe(new ItemStack(Blocks.quartz_block, 1, 1), new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 10); - recipeGreenWall = Util.GetRecipes.lastReconstructorRecipe(); - } - - public static ArrayList getRecipesFor(ItemStack input){ - ArrayList possibleRecipes = new ArrayList(); - for(LensNoneRecipe recipe : ActuallyAdditionsAPI.reconstructorLensNoneRecipes){ - if(ItemUtil.contains(recipe.getInputs(), input, true)){ - possibleRecipes.add(recipe); - } - } - return possibleRecipes; - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java new file mode 100644 index 000000000..44e94a84a --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java @@ -0,0 +1,124 @@ +/* + * This file ("LensRecipeHandler.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.items.lens; + +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.api.recipe.ColorLensChangerByDyeMeta; +import de.ellpeck.actuallyadditions.api.recipe.IColorLensChanger; +import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; +import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; +import de.ellpeck.actuallyadditions.mod.items.InitItems; +import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; +import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +import de.ellpeck.actuallyadditions.mod.util.ItemUtil; +import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; + +public final class LensRecipeHandler{ + + public static final ArrayList MAIN_PAGE_RECIPES = new ArrayList(); + public static LensConversionRecipe recipeColorLens; + public static LensConversionRecipe recipeSoulSand; + public static LensConversionRecipe recipeGreenWall; + public static LensConversionRecipe recipeWhiteWall; + public static LensConversionRecipe recipeExplosionLens; + public static LensConversionRecipe recipeDamageLens; + public static LensConversionRecipe recipeLeather; + public static LensConversionRecipe recipeNetherWart; + + public static void init(){ + //Crystal Blocks + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.REDSTONE_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.REDSTONE.ordinal()), 400); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.LAPIS_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()), 400); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.DIAMOND_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), 600); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.EMERALD_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.EMERALD.ordinal()), 1000); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.COAL_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 600); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.IRON_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 800); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + + //Crystal Items + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.REDSTONE), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 40); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DYE, 1, 4), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 40); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DIAMOND), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 60); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.EMERALD), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), 100); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.COAL), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 60); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.IRON_INGOT), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 80); + + //Lenses + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new ItemStack(InitItems.itemColorLens), 5000); + recipeColorLens = RecipeUtil.lastReconstructorRecipe(); + + if(ConfigCrafting.RECONSTRUCTOR_EXPLOSION_LENS.isEnabled()){ + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemColorLens), new ItemStack(InitItems.itemExplosionLens), 5000); + recipeExplosionLens = RecipeUtil.lastReconstructorRecipe(); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemExplosionLens), new ItemStack(InitItems.itemDamageLens), 5000); + } + else{ + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemColorLens), new ItemStack(InitItems.itemDamageLens), 5000); + } + recipeDamageLens = RecipeUtil.lastReconstructorRecipe(); + + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(InitItems.itemDamageLens), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), 5000); + + //Misc + if(ConfigCrafting.RECONSTRUCTOR_MISC.isEnabled()){ + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.SAND), new ItemStack(Blocks.SOUL_SAND), 20000); + recipeSoulSand = RecipeUtil.lastReconstructorRecipe(); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.ROTTEN_FLESH), new ItemStack(Items.LEATHER), 8000); + recipeLeather = RecipeUtil.lastReconstructorRecipe(); + + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.RED_MUSHROOM), new ItemStack(Items.NETHER_WART), 150000); + recipeNetherWart = RecipeUtil.lastReconstructorRecipe(); + } + + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK), new ItemStack(InitBlocks.blockTestifiBucksWhiteWall), 10); + recipeWhiteWall = RecipeUtil.lastReconstructorRecipe(); + ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 1, 1), new ItemStack(InitBlocks.blockTestifiBucksGreenWall), 10); + recipeGreenWall = RecipeUtil.lastReconstructorRecipe(); + + IColorLensChanger changer = new ColorLensChangerByDyeMeta(); + ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Items.DYE, changer); + ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.WOOL), changer); + ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_GLASS), changer); + ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_GLASS_PANE), changer); + ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.STAINED_HARDENED_CLAY), changer); + ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(Blocks.CARPET), changer); + ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLamp), changer); + ActuallyAdditionsAPI.addReconstructorLensColorChangeItem(Item.getItemFromBlock(InitBlocks.blockColoredLampOn), changer); + + } + + public static ArrayList getRecipesFor(ItemStack input){ + ArrayList possibleRecipes = new ArrayList(); + for(LensConversionRecipe recipe : ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES){ + if(ItemUtil.contains(recipe.getInputs(), input, true)){ + possibleRecipes.add(recipe); + } + } + return possibleRecipes; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java index f09d0c45d..aca4cb11e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java @@ -1,21 +1,25 @@ /* - * This file ("Lenses.java") is part of the Actually Additions Mod for Minecraft. + * This file ("Lenses.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.lens; -import de.ellpeck.actuallyadditions.api.lens.Lens; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.api.lens.LensConversion; -public class Lenses{ +public final class Lenses{ - public static final Lens LENS_NONE = new LensNone(); - public static final Lens LENS_DETONATION = new LensDetonation(); - public static final Lens LENS_DEATH = new LensDeath(); - public static final Lens LENS_COLOR = new LensColor(); + public static void init(){ + ActuallyAdditionsAPI.lensDefaultConversion = new LensConversion(); + ActuallyAdditionsAPI.lensDetonation = new LensDetonation(); + ActuallyAdditionsAPI.lensDeath = new LensDeath(); + ActuallyAdditionsAPI.lensColor = new LensColor(); + ActuallyAdditionsAPI.lensDisruption = new LensDisruption(); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java index ab719ca13..27c235633 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheCrystals.java @@ -1,11 +1,11 @@ /* - * This file ("TheCrystals.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheCrystals.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.metalists; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheDusts.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheDusts.java index c54c6bea7..1ffc2e117 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheDusts.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheDusts.java @@ -1,11 +1,11 @@ /* - * This file ("TheDusts.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheDusts.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.metalists; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheFoods.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheFoods.java index 89fc96e3a..998143dbd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheFoods.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheFoods.java @@ -1,11 +1,11 @@ /* - * This file ("TheFoods.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheFoods.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.metalists; @@ -57,9 +57,9 @@ public enum TheFoods{ } public static void setReturnItems(){ - SPAGHETTI.returnItem = new ItemStack(Items.bowl); - PUMPKIN_STEW.returnItem = new ItemStack(Items.bowl); - CARROT_JUICE.returnItem = new ItemStack(Items.glass_bottle); + SPAGHETTI.returnItem = new ItemStack(Items.BOWL); + PUMPKIN_STEW.returnItem = new ItemStack(Items.BOWL); + CARROT_JUICE.returnItem = new ItemStack(Items.GLASS_BOTTLE); FRENCH_FRIES.returnItem = new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()); FISH_N_CHIPS.returnItem = new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheJams.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheJams.java index 2056c0a79..4e44b5cb5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheJams.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheJams.java @@ -1,11 +1,11 @@ /* - * This file ("TheJams.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheJams.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.metalists; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheMiscItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheMiscItems.java index 609effc57..944806dae 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheMiscItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/TheMiscItems.java @@ -1,15 +1,16 @@ /* - * This file ("TheMiscItems.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TheMiscItems.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.metalists; +import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.item.EnumRarity; public enum TheMiscItems{ @@ -32,7 +33,12 @@ public enum TheMiscItems{ BAT_WING("BatWing", EnumRarity.RARE), DRILL_CORE("DrillCore", EnumRarity.UNCOMMON), BLACK_DYE("BlackDye", EnumRarity.EPIC), - LENS("Lens", EnumRarity.UNCOMMON); + LENS("Lens", EnumRarity.UNCOMMON), + ENDER_STAR("EnderStar", EnumRarity.EPIC), + SPAWNER_SHARD("SpawnerShard", EnumRarity.EPIC), + BIOMASS("Biomass", EnumRarity.UNCOMMON), + BIOCOAL("Biocoal", EnumRarity.RARE), + YOUTUBE_ICON("YoutubeIcon", Util.FALLBACK_RARITY); public final String name; public final EnumRarity rarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/ThePotionRings.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/ThePotionRings.java index e134e8a90..863df3032 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/ThePotionRings.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/metalists/ThePotionRings.java @@ -1,39 +1,40 @@ /* - * This file ("ThePotionRings.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ThePotionRings.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.items.metalists; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.init.MobEffects; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; public enum ThePotionRings{ - SPEED(Potion.moveSpeed.getName(), 8171462, Potion.moveSpeed.getId(), 0, 1, 10, false, EnumRarity.UNCOMMON, new ItemStack(Items.sugar)), + SPEED(MobEffects.SPEED.getName(), 8171462, MobEffects.SPEED, 0, 1, 10, false, EnumRarity.UNCOMMON, new ItemStack(Items.SUGAR)), //Slowness - HASTE(Potion.digSpeed.getName(), 14270531, Potion.digSpeed.getId(), 0, 1, 10, false, EnumRarity.EPIC, new ItemStack(Items.repeater)), + HASTE(MobEffects.HASTE.getName(), 14270531, MobEffects.HASTE, 0, 1, 10, false, EnumRarity.EPIC, new ItemStack(Items.REPEATER)), //Mining Fatigue - STRENGTH(Potion.damageBoost.getName(), 9643043, Potion.damageBoost.getId(), 0, 1, 10, false, EnumRarity.RARE, new ItemStack(Items.blaze_powder)), + STRENGTH(MobEffects.STRENGTH.getName(), 9643043, MobEffects.STRENGTH, 0, 1, 10, false, EnumRarity.RARE, new ItemStack(Items.BLAZE_POWDER)), //Health (Not Happening) //Damage - JUMP_BOOST(Potion.jump.getName(), 7889559, Potion.jump.getId(), 0, 1, 10, false, EnumRarity.RARE, new ItemStack(Blocks.piston)), + JUMP_BOOST(MobEffects.JUMP_BOOST.getName(), 7889559, MobEffects.JUMP_BOOST, 0, 1, 10, false, EnumRarity.RARE, new ItemStack(Blocks.PISTON)), //Nausea - REGEN(Potion.regeneration.getName(), 13458603, Potion.regeneration.getId(), 0, 1, 50, true, EnumRarity.RARE, new ItemStack(Items.ghast_tear)), - RESISTANCE(Potion.resistance.getName(), 10044730, Potion.resistance.getId(), 0, 1, 10, false, EnumRarity.EPIC, new ItemStack(Items.slime_ball)), - FIRE_RESISTANCE(Potion.fireResistance.getName(), 14981690, Potion.fireResistance.getId(), 0, 0, 10, false, EnumRarity.UNCOMMON, new ItemStack(Items.magma_cream)), - WATER_BREATHING(Potion.waterBreathing.getName(), 3035801, Potion.waterBreathing.getId(), 0, 0, 10, false, EnumRarity.RARE, new ItemStack(Items.fish, 1, 3)), - INVISIBILITY(Potion.invisibility.getName(), 8356754, Potion.invisibility.getId(), 0, 0, 10, false, EnumRarity.EPIC, new ItemStack(Items.fermented_spider_eye)), + REGEN(MobEffects.REGENERATION.getName(), 13458603, MobEffects.REGENERATION, 0, 1, 50, true, EnumRarity.RARE, new ItemStack(Items.GHAST_TEAR)), + RESISTANCE(MobEffects.RESISTANCE.getName(), 10044730, MobEffects.RESISTANCE, 0, 1, 10, false, EnumRarity.EPIC, new ItemStack(Items.SLIME_BALL)), + FIRE_RESISTANCE(MobEffects.FIRE_RESISTANCE.getName(), 14981690, MobEffects.FIRE_RESISTANCE, 0, 0, 10, false, EnumRarity.UNCOMMON, new ItemStack(Items.MAGMA_CREAM)), + WATER_BREATHING(MobEffects.WATER_BREATHING.getName(), 3035801, MobEffects.WATER_BREATHING, 0, 0, 10, false, EnumRarity.RARE, new ItemStack(Items.FISH, 1, 3)), + INVISIBILITY(MobEffects.INVISIBILITY.getName(), 8356754, MobEffects.INVISIBILITY, 0, 0, 10, false, EnumRarity.EPIC, new ItemStack(Items.FERMENTED_SPIDER_EYE)), //Blindness - NIGHT_VISION(Potion.nightVision.getName(), 2039713, Potion.nightVision.getId(), 0, 0, 300, false, EnumRarity.RARE, new ItemStack(Items.golden_carrot)); + NIGHT_VISION(MobEffects.NIGHT_VISION.getName(), 2039713, MobEffects.NIGHT_VISION, 0, 0, 300, false, EnumRarity.RARE, new ItemStack(Items.GOLDEN_CARROT)); //Hunger //Weakness //Poison @@ -51,11 +52,11 @@ public enum ThePotionRings{ public final boolean needsWaitBeforeActivating; public final ItemStack craftingItem; - ThePotionRings(String name, int color, int effectID, int normalAmplifier, int advancedAmplifier, int activeTime, boolean needsWaitBeforeActivating, EnumRarity rarity, ItemStack craftingItem){ + ThePotionRings(String name, int color, Potion effect, int normalAmplifier, int advancedAmplifier, int activeTime, boolean needsWaitBeforeActivating, EnumRarity rarity, ItemStack craftingItem){ this.name = name; this.color = color; this.rarity = rarity; - this.effectID = effectID; + this.effectID = Potion.getIdFromPotion(effect); this.normalAmplifier = normalAmplifier; this.advancedAmplifier = advancedAmplifier; this.activeTime = activeTime; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java index 695977f42..ed4176981 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/JEIActuallyAdditionsPlugin.java @@ -1,21 +1,23 @@ /* - * This file ("JEIActuallyAdditionsPlugin.java") is part of the Actually Additions Mod for Minecraft. + * This file ("JEIActuallyAdditionsPlugin.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.inventory.ContainerCrafter; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder; import de.ellpeck.actuallyadditions.mod.items.InitItems; +import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.booklet.BookletRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineRecipeCategory; @@ -24,34 +26,24 @@ import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler; -import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe; import de.ellpeck.actuallyadditions.mod.util.Util; import mezz.jei.api.*; import mezz.jei.api.recipe.VanillaRecipeCategoryUid; +import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry; import net.minecraft.item.ItemStack; @JEIPlugin public class JEIActuallyAdditionsPlugin implements IModPlugin{ - private IJeiHelpers helpers; - - @Override - public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers){ - this.helpers = jeiHelpers; - } - - @Override - public void onItemRegistryAvailable(IItemRegistry itemRegistry){ - - } - @Override public void register(IModRegistry registry){ + IJeiHelpers helpers = registry.getJeiHelpers(); + registry.addRecipeCategories( - new BookletRecipeCategory(this.helpers.getGuiHelper()), - new CoffeeMachineRecipeCategory(this.helpers.getGuiHelper()), - new CrusherRecipeCategory(this.helpers.getGuiHelper()), - new ReconstructorRecipeCategory(this.helpers.getGuiHelper()) + new BookletRecipeCategory(helpers.getGuiHelper()), + new CoffeeMachineRecipeCategory(helpers.getGuiHelper()), + new CrusherRecipeCategory(helpers.getGuiHelper()), + new ReconstructorRecipeCategory(helpers.getGuiHelper()) ); registry.addRecipeHandlers( @@ -61,40 +53,35 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{ new ReconstructorRecipeHandler() ); - registry.addRecipes(ActuallyAdditionsAPI.bookletPagesWithItemStackData); - registry.addRecipes(ActuallyAdditionsAPI.coffeeMachineIngredients); - registry.addRecipes(ActuallyAdditionsAPI.crusherRecipes); - registry.addRecipes(ActuallyAdditionsAPI.reconstructorLensNoneRecipes); + registry.addRecipes(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_DATA); + registry.addRecipes(ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS); + registry.addRecipes(ActuallyAdditionsAPI.CRUSHER_RECIPES); + registry.addRecipes(ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES); - registry.addRecipeClickArea(GuiCoffeeMachine.class, 53, 42, 22, 16, NEICoffeeMachineRecipe.NAME); + registry.addRecipeClickArea(GuiCoffeeMachine.class, 53, 42, 22, 16, CoffeeMachineRecipeCategory.NAME); registry.addRecipeClickArea(GuiGrinder.class, 80, 40, 24, 22, CrusherRecipeCategory.NAME); registry.addRecipeClickArea(GuiGrinder.GuiGrinderDouble.class, 51, 40, 74, 22, CrusherRecipeCategory.NAME); registry.addRecipeClickArea(GuiFurnaceDouble.class, 51, 40, 74, 22, VanillaRecipeCategoryUid.SMELTING); - INbtIgnoreList ignoreList = this.helpers.getNbtIgnoreList(); - ignoreList.ignoreNbtTagNames(InitItems.itemDrill, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemTeleStaff, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemGrowthRing, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemMagnetRing, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemWaterRemovalRing, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemBattery, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemBatteryDouble, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemBatteryTriple, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy"); - ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy"); - - IItemBlacklist blacklist = this.helpers.getItemBlacklist(); + IItemBlacklist blacklist = helpers.getItemBlacklist(); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockRice)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCanola)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockFlax)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCoffee)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockWildPlant, 1, Util.WILDCARD)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD)); - } + blacklist.addItemToBlacklist(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal())); - @Override - public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry){ + IRecipeTransferRegistry transfer = registry.getRecipeTransferRegistry(); + transfer.addRecipeTransferHandler(ContainerCrafter.class, VanillaRecipeCategoryUid.CRAFTING, 1, 9, 10, 36); + registry.addRecipeCategoryCraftingItem(new ItemStack(InitItems.itemCrafterOnAStick), VanillaRecipeCategoryUid.CRAFTING); + registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockFurnaceDouble), VanillaRecipeCategoryUid.SMELTING); + registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockGrinder), CrusherRecipeCategory.NAME); + registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockGrinderDouble), CrusherRecipeCategory.NAME); + registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockCoffeeMachine), CoffeeMachineRecipeCategory.NAME); + registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockAtomicReconstructor), ReconstructorRecipeCategory.NAME); + registry.addRecipeCategoryCraftingItem(new ItemStack(InitItems.itemBooklet), BookletRecipeCategory.NAME); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java index d55566354..3cb451863 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java @@ -1,11 +1,11 @@ /* - * This file ("RecipeWrapperWithButton.java") is part of the Actually Additions Mod for Minecraft. + * This file ("RecipeWrapperWithButton.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei; @@ -21,7 +21,7 @@ import net.minecraft.client.Minecraft; public abstract class RecipeWrapperWithButton{ - protected TexturedButton theButton; + protected final TexturedButton theButton; public RecipeWrapperWithButton(){ this.theButton = new TexturedButton(23782, this.getButtonX(), this.getButtonY(), 146, 154, 20, 20){ @@ -29,7 +29,7 @@ public abstract class RecipeWrapperWithButton{ public void drawButton(Minecraft minecraft, int x, int y){ super.drawButton(minecraft, x, y); if(this.visible && this.hovered){ - String text = StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe"); + String text = StringUtil.localize("booklet."+ModUtil.MOD_ID+".clickToSeeRecipe"); Minecraft.getMinecraft().fontRendererObj.drawString(text, this.xPosition-Minecraft.getMinecraft().fontRendererObj.getStringWidth(text)-1, this.yPosition+this.height/2-Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT/2, StringUtil.DECIMAL_COLOR_WHITE, true); } } @@ -48,7 +48,7 @@ public abstract class RecipeWrapperWithButton{ if(page != null){ GuiBooklet book = new GuiBooklet(Minecraft.getMinecraft().currentScreen, false, true); Minecraft.getMinecraft().displayGuiScreen(book); - BookletUtils.openIndexEntry(book, page.getChapter().getEntry(), ActuallyAdditionsAPI.bookletEntries.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true); + BookletUtils.openIndexEntry(book, page.getChapter().getEntry(), ActuallyAdditionsAPI.BOOKLET_ENTRIES.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true); BookletUtils.openChapter(book, page.getChapter(), page); return true; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java index fc456a852..8a7c36300 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeCategory.java @@ -1,16 +1,15 @@ /* - * This file ("BookletRecipeCategory.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletRecipeCategory.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.booklet; -import de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; @@ -19,30 +18,31 @@ import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; -import javax.annotation.Nonnull; import java.util.Arrays; public class BookletRecipeCategory implements IRecipeCategory{ - private IDrawable background; + public static final String NAME = "actuallyadditions.booklet"; + + private final IDrawable background; public BookletRecipeCategory(IGuiHelper helper){ this.background = helper.createBlankDrawable(160, 100); } - @Nonnull + @Override public String getUid(){ - return NEIBookletRecipe.NAME; + return NAME; } - @Nonnull + @Override public String getTitle(){ - return StringUtil.localize("container.nei."+NEIBookletRecipe.NAME+".name"); + return StringUtil.localize("container.nei."+NAME+".name"); } - @Nonnull + @Override public IDrawable getBackground(){ return this.background; @@ -59,11 +59,10 @@ public class BookletRecipeCategory implements IRecipeCategory{ } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper){ + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ if(recipeWrapper instanceof BookletRecipeWrapper){ BookletRecipeWrapper wrapper = (BookletRecipeWrapper)recipeWrapper; - - recipeLayout.getItemStacks().init(0, true, 62, -3); + recipeLayout.getItemStacks().init(0, true, 70, -4); recipeLayout.getItemStacks().set(0, Arrays.asList(wrapper.thePage.getItemStacksForPage())); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java index ddae626ff..eedd70b6a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeHandler.java @@ -1,44 +1,45 @@ /* - * This file ("BookletRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletRecipeHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.booklet; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; -import javax.annotation.Nonnull; - public class BookletRecipeHandler implements IRecipeHandler{ - @Nonnull + @Override public Class getRecipeClass(){ return BookletPage.class; } - @Nonnull @Override - public String getRecipeCategoryUid(){ - return NEIBookletRecipe.NAME; + public String getRecipeCategoryUid(BookletPage recipe){ + return this.getRecipeCategoryUid(); } - @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull BookletPage recipe){ + public String getRecipeCategoryUid(){ + return BookletRecipeCategory.NAME; + } + + + @Override + public IRecipeWrapper getRecipeWrapper(BookletPage recipe){ return new BookletRecipeWrapper(recipe); } @Override - public boolean isRecipeValid(@Nonnull BookletPage recipe){ + public boolean isRecipeValid(BookletPage recipe){ return true; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java index 8c7f099c3..d92771ba8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java @@ -1,11 +1,11 @@ /* - * This file ("BookletRecipeWrapper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("BookletRecipeWrapper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.booklet; @@ -18,10 +18,9 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; @@ -29,7 +28,7 @@ import java.util.List; public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{ - public BookletPage thePage; + public final BookletPage thePage; public BookletRecipeWrapper(BookletPage page){ this.thePage = page; @@ -56,13 +55,8 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe } @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - - } - - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ - List header = minecraft.fontRendererObj.listFormattedStringToWidth(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.header").replaceAll("", EnumChatFormatting.BLUE+"").replaceAll("", EnumChatFormatting.BLACK+""), 150); + public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ + List header = minecraft.fontRendererObj.listFormattedStringToWidth(StringUtil.localize("container.nei."+ModUtil.MOD_ID+".booklet.header").replaceAll("", TextFormatting.BLUE+"").replaceAll("", TextFormatting.BLACK+""), 150); for(int i = 0; i < header.size(); i++){ minecraft.fontRendererObj.drawString((String)header.get(i), 0, 17+i*(minecraft.fontRendererObj.FONT_HEIGHT+1), 0, false); } @@ -70,18 +64,18 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe int maxLines = 4; IBookletChapter chapter = this.thePage.getChapter(); String aText = (chapter.getPages()[0] instanceof PagePicture && chapter.getPages().length > 1 ? chapter.getPages()[1] : chapter.getPages()[0]).getText(); - List text = minecraft.fontRendererObj.listFormattedStringToWidth(aText != null ? aText : EnumChatFormatting.DARK_RED+StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.noText"), 150); + List text = minecraft.fontRendererObj.listFormattedStringToWidth(aText != null ? aText : TextFormatting.DARK_RED+StringUtil.localize("container.nei."+ModUtil.MOD_ID+".booklet.noText"), 150); for(int i = 0; i < Math.min(maxLines, text.size()); i++){ - minecraft.fontRendererObj.drawString(text.get(i)+(i == maxLines-1 && text.size() > maxLines ? EnumChatFormatting.RESET+""+EnumChatFormatting.BLACK+"..." : ""), 0, 16+25+i*(minecraft.fontRendererObj.FONT_HEIGHT+1), 0, false); + minecraft.fontRendererObj.drawString(text.get(i)+(i == maxLines-1 && text.size() > maxLines ? TextFormatting.RESET+""+TextFormatting.BLACK+"..." : ""), 0, 16+25+i*(minecraft.fontRendererObj.FONT_HEIGHT+1), 0, false); } - minecraft.fontRendererObj.drawString(EnumChatFormatting.ITALIC+chapter.getLocalizedName(), 25, 85, 0, false); - minecraft.fontRendererObj.drawString(EnumChatFormatting.ITALIC+"Page "+this.thePage.getID(), 25, 95, 0, false); + minecraft.fontRendererObj.drawString(TextFormatting.ITALIC+chapter.getLocalizedName(), 25, 85, 0, false); + minecraft.fontRendererObj.drawString(TextFormatting.ITALIC+"Page "+this.thePage.getID(), 25, 95, 0, false); this.updateButton(minecraft, mouseX, mouseY); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ + public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight){ } @@ -92,7 +86,7 @@ public class BookletRecipeWrapper extends RecipeWrapperWithButton implements IRe } @Override - public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ + public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ return this.handleClick(minecraft, mouseX, mouseY); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java index 95c20d762..0104db896 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeCategory.java @@ -1,16 +1,15 @@ /* - * This file ("CoffeeMachineRecipeCategory.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CoffeeMachineRecipeCategory.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.coffee; -import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.IGuiHelper; @@ -20,29 +19,29 @@ import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; -import javax.annotation.Nonnull; - public class CoffeeMachineRecipeCategory implements IRecipeCategory{ - private IDrawable background; + public static final String NAME = "actuallyadditions.coffee"; + + private final IDrawable background; public CoffeeMachineRecipeCategory(IGuiHelper helper){ this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiNEICoffeeMachine"), 0, 0, 126, 88); } - @Nonnull + @Override public String getUid(){ - return NEICoffeeMachineRecipe.NAME; + return NAME; } - @Nonnull + @Override public String getTitle(){ - return StringUtil.localize("container.nei."+NEICoffeeMachineRecipe.NAME+".name"); + return StringUtil.localize("container.nei."+NAME+".name"); } - @Nonnull + @Override public IDrawable getBackground(){ return this.background; @@ -59,7 +58,7 @@ public class CoffeeMachineRecipeCategory implements IRecipeCategory{ } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper){ + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ if(recipeWrapper instanceof CoffeeMachineRecipeWrapper){ CoffeeMachineRecipeWrapper wrapper = (CoffeeMachineRecipeWrapper)recipeWrapper; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeHandler.java index 04f208f1b..8f59b37a4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeHandler.java @@ -1,44 +1,45 @@ /* - * This file ("CoffeeMachineRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CoffeeMachineRecipeHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.coffee; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; -import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe; +import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; -import javax.annotation.Nonnull; - public class CoffeeMachineRecipeHandler implements IRecipeHandler{ - @Nonnull + @Override public Class getRecipeClass(){ return CoffeeIngredient.class; } - @Nonnull @Override - public String getRecipeCategoryUid(){ - return NEICoffeeMachineRecipe.NAME; + public String getRecipeCategoryUid(CoffeeIngredient recipe){ + return this.getRecipeCategoryUid(); } - @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull CoffeeIngredient recipe){ + public String getRecipeCategoryUid(){ + return CoffeeMachineRecipeCategory.NAME; + } + + + @Override + public IRecipeWrapper getRecipeWrapper(CoffeeIngredient recipe){ return new CoffeeMachineRecipeWrapper(recipe); } @Override - public boolean isRecipeValid(@Nonnull CoffeeIngredient recipe){ + public boolean isRecipeValid(CoffeeIngredient recipe){ return true; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java index 11086038f..ea9550d59 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java @@ -1,18 +1,18 @@ /* - * This file ("CoffeeMachineRecipeWrapper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CoffeeMachineRecipeWrapper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.coffee; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeBrewing; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; +import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; import de.ellpeck.actuallyadditions.mod.items.InitItems; @@ -25,7 +25,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; @@ -33,16 +32,16 @@ import java.util.List; public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{ - public CoffeeIngredient theIngredient; - public ItemStack theOutput; - public ItemStack cup = new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()); - public ItemStack coffeeBeans = new ItemStack(InitItems.itemCoffeeBean); + public final CoffeeIngredient theIngredient; + public final ItemStack theOutput; + public final ItemStack cup = new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()); + public final ItemStack coffeeBeans = new ItemStack(InitItems.itemCoffeeBean); public CoffeeMachineRecipeWrapper(CoffeeIngredient ingredient){ this.theIngredient = ingredient; this.theOutput = new ItemStack(InitItems.itemCoffee); - CoffeeBrewing.addEffectToStack(this.theOutput, this.theIngredient); + ActuallyAdditionsAPI.methodHandler.addEffectToStack(this.theOutput, this.theIngredient); } @Override @@ -70,26 +69,21 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen } @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - - } - - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ + public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ this.updateButton(minecraft, mouseX, mouseY); if(this.theIngredient.getExtraText() != null){ - minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); minecraft.fontRendererObj.drawString(this.theIngredient.getExtraText(), 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } if(this.theIngredient.maxAmplifier > 0){ - minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.maxAmount")+": "+this.theIngredient.maxAmplifier, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + minecraft.fontRendererObj.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID+".coffee.maxAmount")+": "+this.theIngredient.maxAmplifier, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ + public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight){ } @@ -100,7 +94,7 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton implemen } @Override - public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ + public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ return this.handleClick(minecraft, mouseX, mouseY); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java index d00501956..b94999ecd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeCategory.java @@ -1,11 +1,11 @@ /* - * This file ("CrusherRecipeCategor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CrusherRecipeCategory.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.crusher; @@ -20,32 +20,31 @@ import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -import javax.annotation.Nonnull; import java.util.List; public class CrusherRecipeCategory implements IRecipeCategory{ public static final String NAME = "actuallyadditions.crushing"; - private IDrawable background; + private final IDrawable background; public CrusherRecipeCategory(IGuiHelper helper){ this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiGrinder"), 60, 13, 56, 79); } - @Nonnull + @Override public String getUid(){ return NAME; } - @Nonnull + @Override public String getTitle(){ return StringUtil.localize("container.nei."+NAME+".name"); } - @Nonnull + @Override public IDrawable getBackground(){ return this.background; @@ -62,7 +61,7 @@ public class CrusherRecipeCategory implements IRecipeCategory{ } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper){ + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ if(recipeWrapper instanceof CrusherRecipeWrapper){ CrusherRecipeWrapper wrapper = (CrusherRecipeWrapper)recipeWrapper; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeHandler.java index 698e59d7a..3d1b3032c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeHandler.java @@ -1,43 +1,47 @@ /* - * This file ("CrusherRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CrusherRecipeHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.crusher; import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; +import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; -import javax.annotation.Nonnull; - public class CrusherRecipeHandler implements IRecipeHandler{ - @Nonnull + @Override public Class getRecipeClass(){ return CrusherRecipe.class; } - @Nonnull + @Override public String getRecipeCategoryUid(){ return CrusherRecipeCategory.NAME; } - @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull CrusherRecipe recipe){ + public String getRecipeCategoryUid(CrusherRecipe recipe){ + return this.getRecipeCategoryUid(); + } + + + @Override + public IRecipeWrapper getRecipeWrapper(CrusherRecipe recipe){ return new CrusherRecipeWrapper(recipe); } @Override - public boolean isRecipeValid(@Nonnull CrusherRecipe recipe){ + public boolean isRecipeValid(CrusherRecipe recipe){ return true; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java index 7191d2ffe..da896422a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java @@ -1,11 +1,11 @@ /* - * This file ("CrusherRecipeWrapper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CrusherRecipeWrapper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.crusher; @@ -21,14 +21,13 @@ import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{ - public CrusherRecipe theRecipe; + public final CrusherRecipe theRecipe; public CrusherRecipeWrapper(CrusherRecipe recipe){ this.theRecipe = recipe; @@ -63,12 +62,7 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRe } @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - - } - - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ + public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ this.updateButton(minecraft, mouseX, mouseY); List outputTwos = this.theRecipe.getRecipeOutputTwos(); @@ -78,7 +72,7 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRe } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ + public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight){ } @@ -89,7 +83,7 @@ public class CrusherRecipeWrapper extends RecipeWrapperWithButton implements IRe } @Override - public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ + public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ return this.handleClick(minecraft, mouseX, mouseY); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java index 6608d1111..695f579fa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java @@ -1,17 +1,16 @@ /* - * This file ("ReconstructorRecipeCategory.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ReconstructorRecipeCategory.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.reconstructor; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.IGuiHelper; @@ -22,30 +21,30 @@ import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -import javax.annotation.Nonnull; - public class ReconstructorRecipeCategory implements IRecipeCategory{ + public static final String NAME = "actuallyadditions.reconstructor"; + private static final ItemStack RECONSTRUCTOR = new ItemStack(InitBlocks.blockAtomicReconstructor); - private IDrawable background; + private final IDrawable background; public ReconstructorRecipeCategory(IGuiHelper helper){ this.background = helper.createDrawable(AssetUtil.getGuiLocation("guiNEIAtomicReconstructor"), 0, 0, 96, 60); } - @Nonnull + @Override public String getUid(){ - return NEIReconstructorRecipe.NAME; + return NAME; } - @Nonnull + @Override public String getTitle(){ - return StringUtil.localize("container.nei."+NEIReconstructorRecipe.NAME+".name"); + return StringUtil.localize("container.nei."+NAME+".name"); } - @Nonnull + @Override public IDrawable getBackground(){ return this.background; @@ -62,7 +61,7 @@ public class ReconstructorRecipeCategory implements IRecipeCategory{ } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper){ + public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper){ if(recipeWrapper instanceof ReconstructorRecipeWrapper){ ReconstructorRecipeWrapper wrapper = (ReconstructorRecipeWrapper)recipeWrapper; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeHandler.java index 1d22fec60..a33ffe9c3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeHandler.java @@ -1,44 +1,43 @@ /* - * This file ("ReconstructorRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ReconstructorRecipeHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.reconstructor; -import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; -import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe; +import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; -import javax.annotation.Nonnull; +public class ReconstructorRecipeHandler implements IRecipeHandler{ -public class ReconstructorRecipeHandler implements IRecipeHandler{ - - @Nonnull @Override public Class getRecipeClass(){ - return LensNoneRecipe.class; + return LensConversionRecipe.class; } - @Nonnull @Override public String getRecipeCategoryUid(){ - return NEIReconstructorRecipe.NAME; + return ReconstructorRecipeCategory.NAME; } - @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull LensNoneRecipe recipe){ + public String getRecipeCategoryUid(LensConversionRecipe recipe){ + return this.getRecipeCategoryUid(); + } + + @Override + public IRecipeWrapper getRecipeWrapper(LensConversionRecipe recipe){ return new ReconstructorRecipeWrapper(recipe); } @Override - public boolean isRecipeValid(@Nonnull LensNoneRecipe recipe){ + public boolean isRecipeValid(LensConversionRecipe recipe){ return true; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java index 8813147f6..2da33022c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java @@ -1,17 +1,17 @@ /* - * This file ("ReconstructorRecipeWrapper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ReconstructorRecipeWrapper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.jei.reconstructor; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; -import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; +import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; @@ -20,16 +20,15 @@ import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implements IRecipeWrapper{ - public LensNoneRecipe theRecipe; + public final LensConversionRecipe theRecipe; - public ReconstructorRecipeWrapper(LensNoneRecipe recipe){ + public ReconstructorRecipeWrapper(LensConversionRecipe recipe){ this.theRecipe = recipe; } @@ -54,17 +53,12 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implemen } @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ - - } - - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ + public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ this.updateButton(minecraft, mouseX, mouseY); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight){ + public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight){ } @@ -75,7 +69,7 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton implemen } @Override - public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ + public boolean handleClick(Minecraft minecraft, int mouseX, int mouseY, int mouseButton){ return this.handleClick(minecraft, mouseX, mouseY); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java index 9a30f371d..b8b9f7e94 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java @@ -1,20 +1,24 @@ /* - * This file ("InitArmorMaterials.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitArmorMaterials.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.material; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.util.SoundEvent; import net.minecraftforge.common.util.EnumHelper; -public class InitArmorMaterials{ +import java.util.Locale; + +public final class InitArmorMaterials{ public static ArmorMaterial armorMaterialEmerald; public static ArmorMaterial armorMaterialObsidian; @@ -30,15 +34,19 @@ public class InitArmorMaterials{ public static void init(){ ModUtil.LOGGER.info("Initializing Armor Materials..."); - armorMaterialEmerald = EnumHelper.addArmorMaterial("armorMaterialEmerald", ModUtil.MOD_ID_LOWER+":armorEmerald", 50, new int[]{5, 9, 8, 5}, 15); - armorMaterialObsidian = EnumHelper.addArmorMaterial("armorMaterialObsidian", ModUtil.MOD_ID_LOWER+":armorObsidian", 120, new int[]{3, 4, 3, 1}, 10); - armorMaterialQuartz = EnumHelper.addArmorMaterial("armorMaterialQuartz", ModUtil.MOD_ID_LOWER+":armorQuartz", 20, new int[]{3, 6, 5, 3}, 8); + armorMaterialEmerald = addArmorMaterial("armorMaterialEmerald", ModUtil.MOD_ID+":armorEmerald", 50, new int[]{5, 8, 9, 5}, 15, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); + armorMaterialObsidian = addArmorMaterial("armorMaterialObsidian", ModUtil.MOD_ID+":armorObsidian", 120, new int[]{1, 3, 4, 3}, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); + armorMaterialQuartz = addArmorMaterial("armorMaterialQuartz", ModUtil.MOD_ID+":armorQuartz", 20, new int[]{3, 5, 6, 3}, 8, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); - armorMaterialCrystalRed = EnumHelper.addArmorMaterial("armorMaterialCrystalRed", ModUtil.MOD_ID_LOWER+":armorCrystalRed", 18, new int[]{3, 7, 6, 3}, 9); - armorMaterialCrystalBlue = EnumHelper.addArmorMaterial("armorMaterialCrystalBlue", ModUtil.MOD_ID_LOWER+":armorCrystalBlue", 18, new int[]{3, 7, 6, 3}, 10); - armorMaterialCrystalLightBlue = EnumHelper.addArmorMaterial("armorMaterialCrystalLightBlue", ModUtil.MOD_ID_LOWER+":armorCrystalLightBlue", 35, new int[]{7, 9, 7, 5}, 12); - armorMaterialCrystalBlack = EnumHelper.addArmorMaterial("armorMaterialCrystalBlack", ModUtil.MOD_ID_LOWER+":armorCrystalBlack", 12, new int[]{1, 4, 3, 1}, 13); - armorMaterialCrystalGreen = EnumHelper.addArmorMaterial("armorMaterialCrystalGreen", ModUtil.MOD_ID_LOWER+":armorCrystalGreen", 60, new int[]{7, 10, 9, 6}, 18); - armorMaterialCrystalWhite = EnumHelper.addArmorMaterial("armorMaterialCrystalWhite", ModUtil.MOD_ID_LOWER+":armorCrystalWhite", 18, new int[]{4, 7, 6, 4}, 11); + armorMaterialCrystalRed = addArmorMaterial("armorMaterialCrystalRed", ModUtil.MOD_ID+":armorCrystalRed", 18, new int[]{3, 6, 7, 3}, 9, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); + armorMaterialCrystalBlue = addArmorMaterial("armorMaterialCrystalBlue", ModUtil.MOD_ID+":armorCrystalBlue", 18, new int[]{3, 6, 7, 3}, 10, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); + armorMaterialCrystalLightBlue = addArmorMaterial("armorMaterialCrystalLightBlue", ModUtil.MOD_ID+":armorCrystalLightBlue", 35, new int[]{5, 7, 9, 7}, 12, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); + armorMaterialCrystalBlack = addArmorMaterial("armorMaterialCrystalBlack", ModUtil.MOD_ID+":armorCrystalBlack", 12, new int[]{1, 3, 4, 1}, 13, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); + armorMaterialCrystalGreen = addArmorMaterial("armorMaterialCrystalGreen", ModUtil.MOD_ID+":armorCrystalGreen", 60, new int[]{6, 9, 10, 7}, 18, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); + armorMaterialCrystalWhite = addArmorMaterial("armorMaterialCrystalWhite", ModUtil.MOD_ID+":armorCrystalWhite", 18, new int[]{4, 6, 7, 4}, 11, SoundEvents.ITEM_ARMOR_EQUIP_GENERIC); + } + + private static ArmorMaterial addArmorMaterial(String name, String textureName, int durability, int[] reductionAmounts, int enchantability, SoundEvent soundOnEquip){ + return EnumHelper.addArmorMaterial((ModUtil.MOD_ID+"_"+name).toUpperCase(Locale.ROOT), textureName, durability, reductionAmounts, enchantability, soundOnEquip, 0F); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java index 8df781339..d631d2d69 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java @@ -1,11 +1,11 @@ /* - * This file ("InitToolMaterials.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitToolMaterials.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.material; @@ -14,7 +14,9 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.item.Item.ToolMaterial; import net.minecraftforge.common.util.EnumHelper; -public class InitToolMaterials{ +import java.util.Locale; + +public final class InitToolMaterials{ public static ToolMaterial toolMaterialEmerald; public static ToolMaterial toolMaterialObsidian; @@ -30,17 +32,21 @@ public class InitToolMaterials{ public static void init(){ ModUtil.LOGGER.info("Initializing Tool Materials..."); - toolMaterialEmerald = EnumHelper.addToolMaterial("toolMaterialEmerald", 3, 2000, 9.0F, 5.0F, 15); - toolMaterialObsidian = EnumHelper.addToolMaterial("toolMaterialObsidian", 3, 8000, 4.0F, 2.0F, 15); - toolMaterialQuartz = EnumHelper.addToolMaterial("toolMaterialQuartz", 2, 280, 6.5F, 2.0F, 10); + toolMaterialEmerald = addToolMaterial("toolMaterialEmerald", 3, 2000, 9.0F, 5.0F, 15); + toolMaterialObsidian = addToolMaterial("toolMaterialObsidian", 3, 8000, 4.0F, 2.0F, 15); + toolMaterialQuartz = addToolMaterial("toolMaterialQuartz", 2, 280, 6.5F, 2.0F, 10); - toolMaterialCrystalRed = EnumHelper.addToolMaterial("toolMaterialCrystalRed", 2, 300, 7.0F, 2.25F, 12); - toolMaterialCrystalBlue = EnumHelper.addToolMaterial("toolMaterialCrystalBlue", 2, 300, 7.0F, 2.25F, 12); - toolMaterialCrystalLightBlue = EnumHelper.addToolMaterial("toolMaterialCrystalLightBlue", 3, 1600, 9.0F, 4.0F, 14); - toolMaterialCrystalBlack = EnumHelper.addToolMaterial("toolMaterialCrystalBlack", 2, 280, 6.0F, 2.0F, 8); - toolMaterialCrystalGreen = EnumHelper.addToolMaterial("toolMaterialCrystalGreen", 4, 2200, 9.5F, 5.5F, 18); - toolMaterialCrystalWhite = EnumHelper.addToolMaterial("toolMaterialCrystalWhite", 2, 280, 6.25F, 2.5F, 15); + toolMaterialCrystalRed = addToolMaterial("toolMaterialCrystalRed", 2, 300, 7.0F, 2.25F, 12); + toolMaterialCrystalBlue = addToolMaterial("toolMaterialCrystalBlue", 2, 300, 7.0F, 2.25F, 12); + toolMaterialCrystalLightBlue = addToolMaterial("toolMaterialCrystalLightBlue", 3, 1600, 9.0F, 4.0F, 14); + toolMaterialCrystalBlack = addToolMaterial("toolMaterialCrystalBlack", 2, 280, 6.0F, 2.0F, 8); + toolMaterialCrystalGreen = addToolMaterial("toolMaterialCrystalGreen", 4, 2200, 9.5F, 5.5F, 18); + toolMaterialCrystalWhite = addToolMaterial("toolMaterialCrystalWhite", 2, 280, 6.25F, 2.5F, 15); } + private static ToolMaterial addToolMaterial(String name, int harvestLevel, int maxUses, float efficiency, float damage, int enchantability){ + return EnumHelper.addToolMaterial((ModUtil.MOD_ID+"_"+name).toUpperCase(Locale.ROOT), harvestLevel, maxUses, efficiency, damage, enchantability); + } + } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/BannerHelper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/BannerHelper.java new file mode 100644 index 000000000..db69bb24d --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/BannerHelper.java @@ -0,0 +1,53 @@ +/* + * This file ("BannerHelper.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.misc; + +import de.ellpeck.actuallyadditions.mod.items.InitItems; +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityBanner.EnumBannerPattern; +import net.minecraftforge.common.util.EnumHelper; + +import java.util.Locale; + +public final class BannerHelper{ + + public static void init(){ + addCraftingPattern("Drill", new ItemStack(InitItems.itemDrill)); + addCraftingPattern("LeafBlo", new ItemStack(InitItems.itemLeafBlower)); + addCraftingPattern("PhanCon", new ItemStack(InitItems.itemPhantomConnector)); + addCraftingPattern("Book", new ItemStack(InitItems.itemBooklet)); + } + + /** + * (Excerpted from Additional Banners by Darkhax with permission, thanks!) + *

+ * Adds a new banner pattern to the game. This banner pattern will be applied by using the + * provided item in a crafting recipe with the banner. + * + * @param name The name of the banner pattern. This is used for the texture file, and is + * also converted into upper case and used for the enum entry. Given how this + * system works, it's critical that this value is unique, consider adding the + * mod id to the name. + * //@param id A small string used to represent the pattern without taking up much space. An + * example of this is "bri". Given how the system works, it is critical that + * this is a unique value. please consider adding the mod id to the pattern id. + * @param craftingStack An ItemStack which is used in the crafting recipe for this pattern. + * An example of this would be the creeper skull being used for the creeper + * pattern. + */ + public static void addCraftingPattern(String name, ItemStack craftingStack){ + Class[] paramTypes = {String.class, String.class, ItemStack.class}; + Object[] paramValues = {ModUtil.MOD_ID+name, ModUtil.MOD_ID+name, craftingStack}; + EnumHelper.addEnum(EnumBannerPattern.class, (ModUtil.MOD_ID+"_"+name).toUpperCase(Locale.ROOT), paramTypes, paramValues); + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java index 1b06219c2..ab87f57af 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java @@ -1,37 +1,37 @@ /* - * This file ("DamageSources.java") is part of the Actually Additions Mod for Minecraft. + * This file ("DamageSources.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.DamageSource; -import net.minecraft.util.IChatComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; public class DamageSources extends DamageSource{ public static final DamageSource DAMAGE_ATOMIC_RECONSTRUCTOR = new DamageSources("atomicReconstructor", 5).setDamageBypassesArmor(); - private int messageCount; + private final int messageCount; public DamageSources(String name, int messageCount){ super(name); this.messageCount = messageCount; } + @Override - public IChatComponent getDeathMessage(EntityLivingBase entity){ - String locTag = "death."+ModUtil.MOD_ID_LOWER+"."+this.damageType+"."+(Util.RANDOM.nextInt(this.messageCount)+1); - return new ChatComponentText(StringUtil.localizeFormatted(locTag, entity.getName())); + public ITextComponent getDeathMessage(EntityLivingBase entity){ + String locTag = "death."+ModUtil.MOD_ID+"."+this.damageType+"."+(Util.RANDOM.nextInt(this.messageCount)+1); + return new TextComponentTranslation(locTag, entity.getName()); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerEmptyBucket.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerEmptyBucket.java deleted file mode 100644 index 7d45c1066..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerEmptyBucket.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file ("DispenserHandlerEmptyBucket.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.misc; - - -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import net.minecraft.block.BlockDispenser; -import net.minecraft.dispenser.BehaviorDefaultDispenseItem; -import net.minecraft.dispenser.IBlockSource; -import net.minecraft.init.Items; -import net.minecraft.item.ItemBucket; -import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; - -public class DispenserHandlerEmptyBucket extends BehaviorDefaultDispenseItem{ - - @Override - public ItemStack dispenseStack(IBlockSource source, ItemStack bucket){ - EnumFacing facing = BlockDispenser.getFacing(source.getBlockMetadata()); - int x = source.getBlockTileEntity().getPos().getX()+facing.getFrontOffsetX(); - int y = source.getBlockTileEntity().getPos().getY()+facing.getFrontOffsetY(); - int z = source.getBlockTileEntity().getPos().getZ()+facing.getFrontOffsetZ(); - BlockPos pos = new BlockPos(x, y, z); - - if(source.getWorld().isAirBlock(pos) && !PosUtil.getMaterial(pos, source.getWorld()).isSolid() && ((ItemBucket)bucket.getItem()).tryPlaceContainedLiquid(source.getWorld(), pos)){ - return new ItemStack(Items.bucket); - } - - return new BehaviorDefaultDispenseItem().dispense(source, bucket); - } - -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFertilize.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFertilize.java index 09b36adb5..9ea76f1a1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFertilize.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFertilize.java @@ -1,11 +1,11 @@ /* - * This file ("DispenserHandlerFertilize.java") is part of the Actually Additions Mod for Minecraft. + * This file ("DispenserHandlerFertilize.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc; @@ -16,22 +16,20 @@ import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; import net.minecraft.item.ItemDye; import net.minecraft.item.ItemStack; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; public class DispenserHandlerFertilize extends BehaviorDefaultDispenseItem{ @Override public ItemStack dispenseStack(IBlockSource source, ItemStack stack){ - EnumFacing facing = BlockDispenser.getFacing(source.getBlockMetadata()); - int x = source.getBlockTileEntity().getPos().getX()+facing.getFrontOffsetX(); - int y = source.getBlockTileEntity().getPos().getY()+facing.getFrontOffsetY(); - int z = source.getBlockTileEntity().getPos().getZ()+facing.getFrontOffsetZ(); - BlockPos pos = new BlockPos(x, y, z); + EnumFacing facing = source.func_189992_e().getValue(BlockDispenser.FACING); + BlockPos pos = source.getBlockPos().offset(facing); - if(ItemDye.applyBonemeal(stack, source.getWorld(), pos, null)){ - source.getWorld().playAuxSFX(2005, pos, 0); + if(ItemDye.applyBonemeal(stack, source.getWorld(), pos)){ + source.getWorld().playEvent(2005, pos, 0); } + return stack; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFillBucket.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFillBucket.java deleted file mode 100644 index daf0fad2e..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DispenserHandlerFillBucket.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file ("DispenserHandlerFillBucket.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.misc; - - -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import net.minecraft.block.Block; -import net.minecraft.block.BlockDispenser; -import net.minecraft.dispenser.BehaviorDefaultDispenseItem; -import net.minecraft.dispenser.IBlockSource; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityDispenser; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.IFluidBlock; - -public class DispenserHandlerFillBucket extends BehaviorDefaultDispenseItem{ - - @Override - public ItemStack dispenseStack(IBlockSource source, ItemStack emptyBucket){ - EnumFacing facing = BlockDispenser.getFacing(source.getBlockMetadata()); - int x = source.getBlockTileEntity().getPos().getX()+facing.getFrontOffsetX(); - int y = source.getBlockTileEntity().getPos().getY()+facing.getFrontOffsetY(); - int z = source.getBlockTileEntity().getPos().getZ()+facing.getFrontOffsetZ(); - - ItemStack filledBucket = this.tryFillBucket(source, x, y, z, emptyBucket); - - //Bucket couldn't be filled - if(filledBucket == null){ - return new BehaviorDefaultDispenseItem().dispense(source, emptyBucket); - } - - emptyBucket.stackSize--; - //Only one bucket was there -> new bucket gets placed in slot - if(emptyBucket.stackSize <= 0){ - emptyBucket = filledBucket.copy(); - } - //Not enough space for the bucket in the inventory? - else if(((TileEntityDispenser)source.getBlockTileEntity()).addItemStack(filledBucket.copy()) < 0){ - new BehaviorDefaultDispenseItem().dispense(source, filledBucket.copy()); - } - //Filled Bucket or Empty Buckets because either they weren't filled or the full one was dispensed out because of missing space - return emptyBucket; - } - - private ItemStack tryFillBucket(IBlockSource source, int x, int y, int z, ItemStack bucket){ - BlockPos pos = new BlockPos(x, y, z); - Block block = PosUtil.getBlock(pos, source.getWorld()); - - if(block == Blocks.water || block == Blocks.flowing_water){ - if(PosUtil.getMetadata(pos, source.getWorld()) == 0){ - source.getWorld().setBlockToAir(pos); - return new ItemStack(Items.water_bucket); - } - } - else if(block == Blocks.lava || block == Blocks.flowing_lava){ - if(PosUtil.getMetadata(pos, source.getWorld()) == 0){ - source.getWorld().setBlockToAir(pos); - return new ItemStack(Items.lava_bucket); - } - } - else if(block instanceof IFluidBlock && ((IFluidBlock)block).canDrain(source.getWorld(), pos)){ - ItemStack stack = FluidContainerRegistry.fillFluidContainer(((IFluidBlock)block).drain(source.getWorld(), pos, false), bucket); - if(stack != null){ - ((IFluidBlock)block).drain(source.getWorld(), pos, true); - return stack; - } - } - return null; - } - -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java index 6a181d2fb..2c238b662 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java @@ -1,51 +1,45 @@ /* - * This file ("DungeonLoot.java") is part of the Actually Additions Mod for Minecraft. + * This file ("DungeonLoot.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc; -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -public class DungeonLoot{ +//TODO Fix dungeon loot (oh god) +public final class DungeonLoot{ public static void init(){ if(ConfigBoolValues.DUNGEON_LOOT.isEnabled()){ ModUtil.LOGGER.info("Initializing Dungeon Loot..."); - ChestGenHooks dungeon = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST); + /*ChestGenHooks dungeon = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST); ChestGenHooks mineshaft = ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR); ChestGenHooks blacksmith = ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH); for(int i = 0; i < TheCrystals.values().length; i++){ - WeightedRandomChestContent item = new WeightedRandomChestContent(new ItemStack(InitItems.itemCrystal, 1, i), 2, 4, 5); - WeightedRandomChestContent block = new WeightedRandomChestContent(new ItemStack(InitBlocks.blockCrystal, 1, i), 1, 3, 1); + WeightedRandomChestContent item = new WeightedRandomChestContent(InitItems.itemCrystal, i, 2, 4, 5); + WeightedRandomChestContent block = new WeightedRandomChestContent(Item.getItemFromBlock(InitBlocks.blockCrystal), i, 1, 3, 1); dungeon.addItem(item); dungeon.addItem(block); mineshaft.addItem(item); mineshaft.addItem(block); } - WeightedRandomChestContent drillCore = new WeightedRandomChestContent(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), 1, 1, 3); + WeightedRandomChestContent drillCore = new WeightedRandomChestContent(InitItems.itemMisc, TheMiscItems.DRILL_CORE.ordinal(), 1, 1, 3); dungeon.addItem(drillCore); mineshaft.addItem(drillCore); blacksmith.addItem(drillCore); - WeightedRandomChestContent quartz = new WeightedRandomChestContent(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), 3, 4, 30); + WeightedRandomChestContent quartz = new WeightedRandomChestContent(InitItems.itemMisc, TheMiscItems.QUARTZ.ordinal(), 3, 4, 30); dungeon.addItem(quartz); - blacksmith.addItem(quartz); + blacksmith.addItem(quartz);*/ } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java index c2f77f41c..7b0ba117d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java @@ -1,46 +1,26 @@ /* - * This file ("LaserRelayConnectionHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("LaserRelayConnectionHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc; -import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; +import de.ellpeck.actuallyadditions.mod.data.WorldData; import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import io.netty.util.internal.ConcurrentSet; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class LaserRelayConnectionHandler{ +public final class LaserRelayConnectionHandler{ - private static LaserRelayConnectionHandler instance; - - /** - * All of the Networks - */ - public ConcurrentSet networks = new ConcurrentSet(); - - public static LaserRelayConnectionHandler getInstance(){ - return instance; - } - - public static void setInstance(LaserRelayConnectionHandler handler){ - instance = handler; - } - - public NBTTagCompound writeNetworkToNBT(Network network){ + public static NBTTagCompound writeNetworkToNBT(Network network){ NBTTagList list = new NBTTagList(); for(ConnectionPair pair : network.connections){ list.appendTag(pair.writeToNBT()); @@ -50,7 +30,7 @@ public class LaserRelayConnectionHandler{ return compound; } - public Network readNetworkFromNBT(NBTTagCompound tag){ + public static Network readNetworkFromNBT(NBTTagCompound tag){ NBTTagList list = tag.getTagList("Network", 10); Network network = new Network(); for(int i = 0; i < list.tagCount(); i++){ @@ -62,9 +42,9 @@ public class LaserRelayConnectionHandler{ /** * Gets all Connections for a Relay */ - public ConcurrentSet getConnectionsFor(BlockPos relay){ + public static ConcurrentSet getConnectionsFor(BlockPos relay, World world){ ConcurrentSet allPairs = new ConcurrentSet(); - for(Network aNetwork : this.networks){ + for(Network aNetwork : WorldData.getDataForWorld(world).laserRelayNetworks){ for(ConnectionPair pair : aNetwork.connections){ if(pair.contains(relay)){ allPairs.add(pair); @@ -77,26 +57,25 @@ public class LaserRelayConnectionHandler{ /** * Removes a Relay from its Network */ - public void removeRelayFromNetwork(BlockPos relay){ - Network network = this.getNetworkFor(relay); + public static void removeRelayFromNetwork(BlockPos relay, World world){ + Network network = getNetworkFor(relay, world); if(network != null){ //Setup new network (so that splitting a network will cause it to break into two) - this.networks.remove(network); + WorldData.getDataForWorld(world).laserRelayNetworks.remove(network); for(ConnectionPair pair : network.connections){ if(!pair.contains(relay)){ - this.addConnection(pair.firstRelay, pair.secondRelay); + addConnection(pair.positions[0], pair.positions[1], world); } } //System.out.println("Removing a Relay from the Network!"); } - WorldData.makeDirty(); } /** * Gets a Network for a Relay */ - public Network getNetworkFor(BlockPos relay){ - for(Network aNetwork : this.networks){ + public static Network getNetworkFor(BlockPos relay, World world){ + for(Network aNetwork : WorldData.getDataForWorld(world).laserRelayNetworks){ for(ConnectionPair pair : aNetwork.connections){ if(pair.contains(relay)){ return aNetwork; @@ -110,28 +89,28 @@ public class LaserRelayConnectionHandler{ * Adds a new connection between two relays * (Puts it into the correct network!) */ - public boolean addConnection(BlockPos firstRelay, BlockPos secondRelay){ - int distance = (int)PosUtil.toVec(firstRelay).distanceTo(PosUtil.toVec(secondRelay)); - if(distance > TileEntityLaserRelay.MAX_DISTANCE || PosUtil.areSamePos(firstRelay, secondRelay)){ + public static boolean addConnection(BlockPos firstRelay, BlockPos secondRelay, World world){ + int distanceSq = (int)firstRelay.distanceSq(secondRelay); + if(distanceSq > TileEntityLaserRelay.MAX_DISTANCE*TileEntityLaserRelay.MAX_DISTANCE || firstRelay.equals(secondRelay)){ return false; } - Network firstNetwork = this.getNetworkFor(firstRelay); - Network secondNetwork = this.getNetworkFor(secondRelay); + Network firstNetwork = getNetworkFor(firstRelay, world); + Network secondNetwork = getNetworkFor(secondRelay, world); //No Network exists if(firstNetwork == null && secondNetwork == null){ firstNetwork = new Network(); - this.networks.add(firstNetwork); + WorldData.getDataForWorld(world).laserRelayNetworks.add(firstNetwork); firstNetwork.connections.add(new ConnectionPair(firstRelay, secondRelay)); } //The same Network else if(firstNetwork == secondNetwork){ return false; } - //Both relays have networks + //Both relays have laserRelayNetworks else if(firstNetwork != null && secondNetwork != null){ - this.mergeNetworks(firstNetwork, secondNetwork); + mergeNetworks(firstNetwork, secondNetwork, world); firstNetwork.connections.add(new ConnectionPair(firstRelay, secondRelay)); } //Only first network exists @@ -139,77 +118,34 @@ public class LaserRelayConnectionHandler{ firstNetwork.connections.add(new ConnectionPair(firstRelay, secondRelay)); } //Only second network exists - else if(secondNetwork != null){ + else{ secondNetwork.connections.add(new ConnectionPair(firstRelay, secondRelay)); } - WorldData.makeDirty(); //System.out.println("Connected "+firstRelay.toString()+" to "+secondRelay.toString()); //System.out.println(firstNetwork == null ? secondNetwork.toString() : firstNetwork.toString()); - //System.out.println(this.networks); + //System.out.println(laserRelayNetworks); return true; } /** - * Merges two networks together + * Merges two laserRelayNetworks together * (Actually puts everything from the second network into the first one and removes the second one) */ - public void mergeNetworks(Network firstNetwork, Network secondNetwork){ + public static void mergeNetworks(Network firstNetwork, Network secondNetwork, World world){ for(ConnectionPair secondPair : secondNetwork.connections){ firstNetwork.connections.add(secondPair); } - this.networks.remove(secondNetwork); - WorldData.makeDirty(); + WorldData.getDataForWorld(world).laserRelayNetworks.remove(secondNetwork); //System.out.println("Merged Two Networks!"); } - public int transferEnergyToReceiverInNeed(World world, BlockPos energyGottenFrom, Network network, int maxTransfer, boolean simulate){ - int transmitted = 0; - //Go through all of the connections in the network - for(ConnectionPair pair : network.connections){ - BlockPos[] relays = new BlockPos[]{pair.firstRelay, pair.secondRelay}; - //Go through both relays in the connection - for(BlockPos relay : relays){ - if(relay != null){ - //Get every side of the relay - for(int i = 0; i <= 5; i++){ - EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); - //Get the Position at the side - BlockPos pos = WorldUtil.getCoordsFromSide(side, relay, 0); - if(!PosUtil.areSamePos(pos, energyGottenFrom)){ - TileEntity tile = world.getTileEntity(pos); - if(tile instanceof IEnergyReceiver && !(tile instanceof TileEntityLaserRelay)){ - IEnergyReceiver receiver = (IEnergyReceiver)tile; - if(receiver.canConnectEnergy(side.getOpposite())){ - //Transfer the energy (with the energy loss!) - int theoreticalReceived = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), maxTransfer-transmitted, true); - //The amount of energy lost during a transfer - int deduct = (int)(theoreticalReceived*((double)ConfigIntValues.LASER_RELAY_LOSS.getValue()/100)); - - transmitted += ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), theoreticalReceived-deduct, simulate); - transmitted += deduct; - - //If everything that could be transmitted was transmitted - if(transmitted >= maxTransfer){ - return transmitted; - } - } - } - } - } - } - } - } - return transmitted; - } - public static class ConnectionPair{ - public BlockPos firstRelay; - public BlockPos secondRelay; + public final BlockPos[] positions = new BlockPos[2]; public ConnectionPair(BlockPos firstRelay, BlockPos secondRelay){ - this.firstRelay = firstRelay; - this.secondRelay = secondRelay; + this.positions[0] = firstRelay; + this.positions[1] = secondRelay; } public static ConnectionPair readFromNBT(NBTTagCompound compound){ @@ -227,33 +163,61 @@ public class LaserRelayConnectionHandler{ } public boolean contains(BlockPos relay){ - return (this.firstRelay != null && PosUtil.areSamePos(firstRelay, relay)) || (this.secondRelay != null && PosUtil.areSamePos(secondRelay, relay)); + for(BlockPos position : this.positions){ + if(position != null && position.equals(relay)){ + return true; + } + } + return false; } @Override public String toString(){ - return (this.firstRelay == null ? "-" : this.firstRelay.toString())+" | "+(this.secondRelay == null ? "-" : this.secondRelay.toString()); + return (this.positions[0] == null ? "-" : this.positions[0].toString())+" | "+(this.positions[1] == null ? "-" : this.positions[1].toString()); } public NBTTagCompound writeToNBT(){ NBTTagCompound compound = new NBTTagCompound(); - for(int i = 0; i < 2; i++){ - BlockPos relay = i == 0 ? this.firstRelay : this.secondRelay; + for(int i = 0; i < this.positions.length; i++){ + BlockPos relay = this.positions[i]; compound.setInteger("x"+i, relay.getX()); compound.setInteger("y"+i, relay.getY()); compound.setInteger("z"+i, relay.getZ()); } return compound; } + + @Override + public boolean equals(Object obj){ + if(obj instanceof ConnectionPair){ + ConnectionPair pair = (ConnectionPair)obj; + for(int i = 0; i < this.positions.length; i++){ + if(this.positions[i] == pair.positions[i] || (this.positions[i] != null && this.positions[i].equals(pair.positions[i]))){ + return true; + } + } + } + return super.equals(obj); + } } public static class Network{ - public ConcurrentSet connections = new ConcurrentSet(); + public final ConcurrentSet connections = new ConcurrentSet(); @Override public String toString(){ return this.connections.toString(); } + + @Override + public boolean equals(Object obj){ + if(obj instanceof Network){ + if(this.connections.equals(((Network)obj).connections)){ + return true; + } + } + return super.equals(obj); + } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/MethodHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/MethodHandler.java new file mode 100644 index 000000000..250cca6b8 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/MethodHandler.java @@ -0,0 +1,184 @@ +/* + * This file ("MethodHandler.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.misc; + +import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; +import de.ellpeck.actuallyadditions.api.internal.IMethodHandler; +import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; +import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; + +import java.util.ArrayList; +import java.util.List; + +public class MethodHandler implements IMethodHandler{ + + @Override + public boolean addEffectToStack(ItemStack stack, CoffeeIngredient ingredient){ + boolean worked = false; + if(ingredient != null){ + PotionEffect[] effects = ingredient.getEffects(); + if(effects != null && effects.length > 0){ + for(PotionEffect effect : effects){ + PotionEffect effectHas = this.getSameEffectFromStack(stack, effect); + if(effectHas != null){ + if(effectHas.getAmplifier() < ingredient.maxAmplifier-1){ + this.addEffectProperties(stack, effect, false, true); + worked = true; + } + } + else{ + this.addEffectToStack(stack, effect); + worked = true; + } + } + } + } + return worked; + } + + @Override + public PotionEffect getSameEffectFromStack(ItemStack stack, PotionEffect effect){ + PotionEffect[] effectsStack = this.getEffectsFromStack(stack); + if(effectsStack != null && effectsStack.length > 0){ + for(PotionEffect effectStack : effectsStack){ + if(effect.getPotion() == effectStack.getPotion()){ + return effectStack; + } + } + } + return null; + } + + @Override + public void addEffectProperties(ItemStack stack, PotionEffect effect, boolean addDur, boolean addAmp){ + PotionEffect[] effects = this.getEffectsFromStack(stack); + stack.setTagCompound(new NBTTagCompound()); + for(int i = 0; i < effects.length; i++){ + if(effects[i].getPotion() == effect.getPotion()){ + effects[i] = new PotionEffect(effects[i].getPotion(), effects[i].getDuration()+(addDur ? effect.getDuration() : 0), effects[i].getAmplifier()+(addAmp ? (effect.getAmplifier() > 0 ? effect.getAmplifier() : 1) : 0)); + } + this.addEffectToStack(stack, effects[i]); + } + } + + @Override + public void addEffectToStack(ItemStack stack, PotionEffect effect){ + NBTTagCompound tag = stack.getTagCompound(); + if(tag == null){ + tag = new NBTTagCompound(); + } + + int prevCounter = tag.getInteger("Counter"); + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("ID", Potion.getIdFromPotion(effect.getPotion())); + compound.setInteger("Duration", effect.getDuration()); + compound.setInteger("Amplifier", effect.getAmplifier()); + + int counter = prevCounter+1; + tag.setTag(counter+"", compound); + tag.setInteger("Counter", counter); + + stack.setTagCompound(tag); + } + + @Override + public PotionEffect[] getEffectsFromStack(ItemStack stack){ + ArrayList effects = new ArrayList(); + NBTTagCompound tag = stack.getTagCompound(); + if(tag != null){ + int counter = tag.getInteger("Counter"); + while(counter > 0){ + NBTTagCompound compound = (NBTTagCompound)tag.getTag(counter+""); + PotionEffect effect = new PotionEffect(Potion.getPotionById(compound.getInteger("ID")), compound.getInteger("Duration"), compound.getByte("Amplifier")); + effects.add(effect); + counter--; + } + } + return effects.size() > 0 ? effects.toArray(new PotionEffect[effects.size()]) : null; + } + + @Override + public boolean invokeConversionLens(IBlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile){ + if(hitBlock != null && !hitState.getBlock().isAir(hitState, tile.getWorldObject(), hitBlock)){ + int range = 2; + + //Converting the Blocks + for(int reachX = -range; reachX < range+1; reachX++){ + for(int reachZ = -range; reachZ < range+1; reachZ++){ + for(int reachY = -range; reachY < range+1; reachY++){ + BlockPos pos = new BlockPos(hitBlock.getX()+reachX, hitBlock.getY()+reachY, hitBlock.getZ()+reachZ); + List recipes = LensRecipeHandler.getRecipesFor(new ItemStack(hitState.getBlock(), 1, hitState.getBlock().getMetaFromState(hitState))); + for(LensConversionRecipe recipe : recipes){ + if(recipe != null && recipe.type == tile.getLens() && tile.getEnergy() >= recipe.energyUse){ + List outputs = recipe.getOutputs(); + if(outputs != null && !outputs.isEmpty()){ + ItemStack output = outputs.get(0); + if(output.getItem() instanceof ItemBlock){ + if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ + tile.getWorldObject().playEvent(2001, pos, Block.getStateId(tile.getWorldObject().getBlockState(pos))); + } + tile.getWorldObject().setBlockState(pos, Block.getBlockFromItem(output.getItem()).getStateFromMeta(output.getItemDamage()), 2); + } + else{ + EntityItem item = new EntityItem(tile.getWorldObject(), pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, output.copy()); + tile.getWorldObject().spawnEntityInWorld(item); + } + tile.extractEnergy(recipe.energyUse); + break; + } + } + } + } + } + } + + //Converting the Items + ArrayList items = (ArrayList)tile.getWorldObject().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(hitBlock.getX()-range, hitBlock.getY()-range, hitBlock.getZ()-range, hitBlock.getX()+range, hitBlock.getY()+range, hitBlock.getZ()+range)); + for(EntityItem item : items){ + ItemStack stack = item.getEntityItem(); + if(!item.isDead && stack != null){ + List recipes = LensRecipeHandler.getRecipesFor(stack); + for(LensConversionRecipe recipe : recipes){ + if(recipe != null && recipe.type == tile.getLens() && tile.getEnergy() >= recipe.energyUse){ + List outputs = recipe.getOutputs(); + if(outputs != null && !outputs.isEmpty()){ + ItemStack outputCopy = outputs.get(0).copy(); + outputCopy.stackSize = stack.stackSize; + + item.setDead(); + + EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, outputCopy); + tile.getWorldObject().spawnEntityInWorld(newItem); + + tile.extractEnergy(recipe.energyUse); + break; + } + } + } + } + } + return true; + } + return false; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/EntityColoredParticleFX.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/ParticleColored.java similarity index 70% rename from src/main/java/de/ellpeck/actuallyadditions/mod/misc/EntityColoredParticleFX.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/misc/ParticleColored.java index e2753ae57..979111fc7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/EntityColoredParticleFX.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/ParticleColored.java @@ -1,24 +1,24 @@ /* - * This file ("EntityColoredParticleFX.java") is part of the Actually Additions Mod for Minecraft. + * This file ("EntityColoredParticleFX.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc; -import net.minecraft.client.particle.EntityReddustFX; +import net.minecraft.client.particle.ParticleRedstone; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public class EntityColoredParticleFX extends EntityReddustFX{ +public class ParticleColored extends ParticleRedstone{ - public EntityColoredParticleFX(World world, double x, double y, double z, float size, float r, float g, float b, float ageMulti){ + public ParticleColored(World world, double x, double y, double z, float size, float r, float g, float b, float ageMulti){ super(world, x, y, z, size, r, g, b); //To work around Reddust particles resetting the color to red if it's 0 (which is really stupid to be honest) this.particleRed = ((float)(Math.random()*0.20000000298023224D)+0.8F)*r*((float)Math.random()*0.4F+0.6F); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java new file mode 100644 index 000000000..8b88c32c3 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java @@ -0,0 +1,44 @@ +/* + * This file ("SoundHandler.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.misc; + +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; + +public final class SoundHandler{ + + public static SoundEvent duhDuhDuhDuuuh; + public static SoundEvent coffeeMachine; + public static SoundEvent reconstructor; + public static SoundEvent crusher; + + private static int size = 0; + + public static void init(){ + size = SoundEvent.REGISTRY.getKeys().size(); + + duhDuhDuhDuuuh = registerSound("duhDuhDuhDuuuh"); + coffeeMachine = registerSound("coffeeMachine"); + reconstructor = registerSound("reconstructor"); + crusher = registerSound("crusher"); + } + + private static SoundEvent registerSound(String name){ + ResourceLocation resLoc = new ResourceLocation(ModUtil.MOD_ID, name); + + SoundEvent event = new SoundEvent(resLoc); + SoundEvent.REGISTRY.register(size, resLoc, event); + + size++; + return event; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/WorldData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/WorldData.java deleted file mode 100644 index b551acbb7..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/WorldData.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file ("WorldData.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.misc; - -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentServerData; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; -import net.minecraft.world.WorldSavedData; - -public class WorldData extends WorldSavedData{ - - public static final String DATA_TAG = ModUtil.MOD_ID+"WorldData"; - public static WorldData instance; - - public WorldData(String tag){ - super(tag); - } - - public static void makeDirty(){ - if(instance != null){ - instance.markDirty(); - } - } - - public static void init(MinecraftServer server){ - if(server != null){ - World world = server.getEntityWorld(); - if(!world.isRemote){ - clearOldData(); - ModUtil.LOGGER.info("Loading WorldData!"); - - WorldData savedData = (WorldData)world.loadItemData(WorldData.class, WorldData.DATA_TAG); - //Generate new SavedData - if(savedData == null){ - ModUtil.LOGGER.info("No WorldData found, creating..."); - - savedData = new WorldData(WorldData.DATA_TAG); - world.setItemData(WorldData.DATA_TAG, savedData); - } - else{ - ModUtil.LOGGER.info("WorldData sucessfully received!"); - } - - //Set the current SavedData to the retreived one - WorldData.instance = savedData; - } - } - } - - public static void clearOldData(){ - if(!LaserRelayConnectionHandler.getInstance().networks.isEmpty()){ - ModUtil.LOGGER.info("Clearing leftover Laser Relay Connection Data from other worlds!"); - LaserRelayConnectionHandler.getInstance().networks.clear(); - } - if(!PersistentServerData.playerSaveData.isEmpty()){ - ModUtil.LOGGER.info("Clearing leftover Persistent Server Data from other worlds!"); - PersistentServerData.playerSaveData.clear(); - } - } - - @Override - public void readFromNBT(NBTTagCompound compound){ - //Laser World Data - NBTTagList networkList = compound.getTagList("Networks", 10); - for(int i = 0; i < networkList.tagCount(); i++){ - LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().readNetworkFromNBT(networkList.getCompoundTagAt(i)); - LaserRelayConnectionHandler.getInstance().networks.add(network); - } - - //Player Data - NBTTagList playerList = compound.getTagList("PlayerData", 10); - for(int i = 0; i < playerList.tagCount(); i++){ - PersistentServerData.PlayerSave aSave = PersistentServerData.PlayerSave.fromNBT(playerList.getCompoundTagAt(i)); - PersistentServerData.playerSaveData.add(aSave); - } - } - - @Override - public void writeToNBT(NBTTagCompound compound){ - //Laser World Data - NBTTagList networkList = new NBTTagList(); - for(LaserRelayConnectionHandler.Network network : LaserRelayConnectionHandler.getInstance().networks){ - networkList.appendTag(LaserRelayConnectionHandler.getInstance().writeNetworkToNBT(network)); - } - compound.setTag("Networks", networkList); - - //Player Data - NBTTagList playerList = new NBTTagList(); - for(int i = 0; i < PersistentServerData.playerSaveData.size(); i++){ - PersistentServerData.PlayerSave theSave = PersistentServerData.playerSaveData.get(i); - playerList.appendTag(theSave.toNBT()); - } - compound.setTag("PlayerData", playerList); - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/ISmileyCloudEasterEgg.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/ISmileyCloudEasterEgg.java index 832b13f30..6c5b90f88 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/ISmileyCloudEasterEgg.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/ISmileyCloudEasterEgg.java @@ -1,11 +1,11 @@ /* - * This file ("ISmileyCloudEasterEgg.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ISmileyCloudEasterEgg.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc.cloud; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java index 6907bb2ac..3c4fa9f73 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java @@ -1,11 +1,11 @@ /* - * This file ("SmileyCloudEasterEggs.java") is part of the Actually Additions Mod for Minecraft. + * This file ("SmileyCloudEasterEggs.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc.cloud; @@ -22,10 +22,11 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import java.util.ArrayList; +import java.util.List; -public class SmileyCloudEasterEggs{ +public final class SmileyCloudEasterEggs{ - public static final ArrayList cloudStuff = new ArrayList(); + public static final List CLOUD_STUFF = new ArrayList(); static{ //Glenthor @@ -37,7 +38,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(true, new ItemStack(Items.dye, 1, 2)); + renderHoldingItem(true, new ItemStack(Items.DYE, 1, 2)); renderHeadBlock(InitBlocks.blockHeatCollector, 0, 5F); } }); @@ -63,8 +64,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.fishing_rod)); - renderHoldingItem(true, new ItemStack(Items.fish)); + renderHoldingItem(false, new ItemStack(Items.FISHING_ROD)); + renderHoldingItem(true, new ItemStack(Items.FISH)); } }); //Hose @@ -76,8 +77,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.reeds)); - renderHeadBlock(Blocks.torch, 0, 15F); + renderHoldingItem(false, new ItemStack(Items.REEDS)); + renderHeadBlock(Blocks.TORCH, 0, 15F); } }); //Tobi @@ -89,8 +90,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(true, new ItemStack(Items.milk_bucket)); - renderHeadBlock(Blocks.lit_redstone_lamp, 0, 35F); + renderHoldingItem(true, new ItemStack(Items.MILK_BUCKET)); + renderHeadBlock(Blocks.LIT_REDSTONE_LAMP, 0, 35F); } }); //Vazkii @@ -102,8 +103,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(true, new ItemStack(Items.dye, 1, 15)); - renderHeadBlock(Blocks.red_flower, 5, 20F); + renderHoldingItem(true, new ItemStack(Items.DYE, 1, 15)); + renderHeadBlock(Blocks.RED_FLOWER, 5, 20F); } }); //Kitty @@ -115,9 +116,9 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(true, new ItemStack(Items.fish)); - renderHoldingItem(false, new ItemStack(Items.milk_bucket)); - renderHeadBlock(Blocks.wool, 10, 15F); + renderHoldingItem(true, new ItemStack(Items.FISH)); + renderHoldingItem(false, new ItemStack(Items.MILK_BUCKET)); + renderHeadBlock(Blocks.WOOL, 10, 15F); } }); //Canitzp @@ -129,8 +130,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.wooden_sword)); - renderHeadBlock(Blocks.chest, 0, 70F); + renderHoldingItem(false, new ItemStack(Items.WOODEN_SWORD)); + renderHeadBlock(Blocks.CHEST, 0, 70F); } }); //Lari @@ -142,7 +143,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.iron_helmet)); + renderHoldingItem(false, new ItemStack(Items.IRON_HELMET)); renderHeadBlock(InitBlocks.blockBlackLotus, 0, 28F); } }); @@ -155,9 +156,9 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.milk_bucket)); - renderHoldingItem(true, new ItemStack(Items.dye, 1, 1)); - renderHeadBlock(Blocks.wool, 14, 18F); + renderHoldingItem(false, new ItemStack(Items.MILK_BUCKET)); + renderHoldingItem(true, new ItemStack(Items.DYE, 1, 1)); + renderHeadBlock(Blocks.WOOL, 14, 18F); } }); //Bande @@ -169,8 +170,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.diamond_pickaxe)); - renderHeadBlock(Blocks.wool, 4, 18F); + renderHoldingItem(false, new ItemStack(Items.DIAMOND_PICKAXE)); + renderHeadBlock(Blocks.WOOL, 4, 18F); } }); //Wolle @@ -182,8 +183,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.string)); - renderHeadBlock(Blocks.wool, 0, 18F); + renderHoldingItem(false, new ItemStack(Items.STRING)); + renderHeadBlock(Blocks.WOOL, 0, 18F); } }); //Pakto @@ -195,7 +196,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.dye, 1, 9)); + renderHoldingItem(false, new ItemStack(Items.DYE, 1, 9)); renderHeadBlock(InitBlocks.blockColoredLampOn, 6, 18F); } }); @@ -209,7 +210,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(InitItems.itemLeafBlowerAdvanced, 1, 9)); - renderHeadBlock(Blocks.hay_block, 0, 74F); + renderHeadBlock(Blocks.HAY_BLOCK, 0, 74F); } }); //Acid @@ -222,7 +223,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal())); - renderHeadBlock(Blocks.bookshelf, 0, 27F); + renderHeadBlock(Blocks.BOOKSHELF, 0, 27F); } }); //Jasin @@ -234,8 +235,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.written_book)); - renderHeadBlock(Blocks.web, 0, 56F); + renderHoldingItem(false, new ItemStack(Items.WRITTEN_BOOK)); + renderHeadBlock(Blocks.WEB, 0, 56F); } }); //ShadowNinjaCat @@ -247,8 +248,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.diamond_sword)); - renderHeadBlock(Blocks.diamond_block, 0, 26F); + renderHoldingItem(false, new ItemStack(Items.DIAMOND_SWORD)); + renderHeadBlock(Blocks.DIAMOND_BLOCK, 0, 26F); } }); //NihonTiger @@ -260,9 +261,9 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.stone_pickaxe)); - renderHoldingItem(true, new ItemStack(Items.poisonous_potato)); - renderHeadBlock(Blocks.gravel, 0, 47F); + renderHoldingItem(false, new ItemStack(Items.STONE_PICKAXE)); + renderHoldingItem(true, new ItemStack(Items.POISONOUS_POTATO)); + renderHeadBlock(Blocks.GRAVEL, 0, 47F); } }); //FrauBaerchen @@ -274,9 +275,9 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.cookie)); - renderHoldingItem(true, new ItemStack(Items.paper)); - renderHeadBlock(Blocks.coal_block, 0, 60F); + renderHoldingItem(false, new ItemStack(Items.COOKIE)); + renderHoldingItem(true, new ItemStack(Items.PAPER)); + renderHeadBlock(Blocks.COAL_BLOCK, 0, 60F); } }); //Diddi @@ -289,7 +290,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ renderHoldingItem(true, new ItemStack(InitItems.itemDrill)); - renderHeadBlock(Blocks.redstone_block, 0, 30F); + renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 30F); } }); //MineLoad @@ -302,7 +303,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(InitItems.itemMagnetRing)); - renderHeadBlock(Blocks.crafting_table, 0, 35F); + renderHeadBlock(Blocks.CRAFTING_TABLE, 0, 35F); } }); //Kilobyte (When I asked him if he liked the mod, he just looked at the code. Maybe he'll find this eventually.) @@ -315,7 +316,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal())); - renderHeadBlock(Blocks.redstone_ore, 0, 80F); + renderHeadBlock(Blocks.REDSTONE_ORE, 0, 80F); } }); //XDjackieXD @@ -327,7 +328,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.enchanted_book)); + renderHoldingItem(false, new ItemStack(Items.ENCHANTED_BOOK)); renderHeadBlock(InitBlocks.blockDirectionalBreaker, 0, 40F); } }); @@ -340,7 +341,7 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.glowstone_dust)); + renderHoldingItem(false, new ItemStack(Items.GLOWSTONE_DUST)); renderHeadBlock(InitBlocks.blockColoredLampOn, 4, 40F); } }); @@ -353,8 +354,8 @@ public class SmileyCloudEasterEggs{ @Override public void renderExtra(float f){ - renderHoldingItem(false, new ItemStack(Items.gunpowder)); - renderHeadBlock(Blocks.sponge, 0, 20F); + renderHoldingItem(false, new ItemStack(Items.GUNPOWDER)); + renderHeadBlock(Blocks.SPONGE, 0, 20F); } }); //Mattzimann @@ -373,16 +374,14 @@ public class SmileyCloudEasterEggs{ } private static void register(ISmileyCloudEasterEgg egg){ - cloudStuff.add(egg); + CLOUD_STUFF.add(egg); } private static void renderHoldingItem(boolean leftHand, ItemStack stack){ GlStateManager.pushMatrix(); - GlStateManager.rotate(180F, 0F, 0F, 1F); - GlStateManager.rotate(270F, 0F, 1F, 0F); - GlStateManager.translate(0F, -1.5F, 0F); - GlStateManager.translate(-0.5F, 0.2F, leftHand ? 0.55F : -0.5F); + GlStateManager.rotate(90, 0, 1, 0); + GlStateManager.translate(0.2, -1F, leftHand ? -0.525F : 0.525F); GlStateManager.scale(0.75F, 0.75F, 0.75F); AssetUtil.renderItemInWorld(stack); @@ -393,8 +392,8 @@ public class SmileyCloudEasterEggs{ private static void renderHeadBlock(Block block, int meta, float rotation){ GlStateManager.pushMatrix(); GlStateManager.disableLighting(); - GlStateManager.translate(-0.015F, 0.6F, 0.075F); - GlStateManager.scale(0.3F, 0.3F, 0.3F); + GlStateManager.translate(-0.015F, 0.625F, 0.04F); + GlStateManager.scale(0.5F, 0.5F, 0.5F); GlStateManager.rotate(180F, 1F, 0F, 0F); GlStateManager.rotate(rotation, 0F, 1F, 0F); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java index 7b4909c58..35618b8a3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java @@ -1,11 +1,11 @@ /* - * This file ("RenderSpecial.java") is part of the Actually Additions Mod for Minecraft. + * This file ("RenderSpecial.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc.special; @@ -20,7 +20,7 @@ import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.Vec3d; import java.util.Calendar; @@ -38,7 +38,7 @@ public class RenderSpecial{ } if(ClientProxy.pumpkinBlurPumpkinBlur){ - this.theThingToRender = new ItemStack(Calendar.getInstance().get(Calendar.DAY_OF_MONTH)%2 == 0 ? Blocks.lit_pumpkin : Blocks.pumpkin); + this.theThingToRender = new ItemStack(Calendar.getInstance().get(Calendar.DAY_OF_MONTH)%2 == 0 ? Blocks.LIT_PUMPKIN : Blocks.PUMPKIN); } boolean isBlock = this.theThingToRender.getItem() instanceof ItemBlock; @@ -50,8 +50,8 @@ public class RenderSpecial{ GlStateManager.pushMatrix(); - Vec3 currentPos = Minecraft.getMinecraft().thePlayer.getPositionEyes(partialTicks); - Vec3 playerPos = player.getPositionEyes(partialTicks); + Vec3d currentPos = Minecraft.getMinecraft().thePlayer.getPositionEyes(partialTicks); + Vec3d playerPos = player.getPositionEyes(partialTicks); GlStateManager.translate(playerPos.xCoord-currentPos.xCoord, playerPos.yCoord-currentPos.yCoord-(player.isSneaking() || Minecraft.getMinecraft().thePlayer.isSneaking() ? 0.125D : 0D), playerPos.zCoord-currentPos.zCoord); GlStateManager.translate(0D, 2.435D+offsetUp, 0D); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java index 3bf0f506e..810f44ab9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java @@ -1,22 +1,22 @@ /* - * This file ("SpecialRenderInit.java") is part of the Actually Additions Mod for Minecraft. + * This file ("SpecialRenderInit.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc.special; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderPlayerEvent; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -26,17 +26,17 @@ import java.util.Properties; public class SpecialRenderInit{ - public static HashMap specialList = new HashMap(); + public static final HashMap SPECIAL_LIST = new HashMap(); - public static void init(){ + public SpecialRenderInit(){ new ThreadSpecialFetcher(); - Util.registerEvent(new SpecialRenderInit()); + MinecraftForge.EVENT_BUS.register(this); } public static void parse(Properties properties){ for(String key : properties.stringPropertyNames()){ String[] values = properties.getProperty(key).split("@"); - if(values != null && values.length > 0){ + if(values.length > 0){ String itemName = values[0]; int meta; @@ -50,18 +50,18 @@ public class SpecialRenderInit{ ItemStack stack = null; //Get the Item from the String ResourceLocation resLoc = new ResourceLocation(itemName); - if(Item.itemRegistry.containsKey(resLoc)){ - stack = new ItemStack(Item.itemRegistry.getObject(resLoc), 1, meta); + if(Item.REGISTRY.containsKey(resLoc)){ + stack = new ItemStack(Item.REGISTRY.getObject(resLoc), 1, meta); } else{ - if(Block.blockRegistry.containsKey(resLoc)){ - stack = new ItemStack(Block.blockRegistry.getObject(resLoc), 1, meta); + if(Block.REGISTRY.containsKey(resLoc)){ + stack = new ItemStack(Block.REGISTRY.getObject(resLoc), 1, meta); } } //Add a new Special Renderer to the list if(stack != null){ - specialList.put(key, new RenderSpecial(stack)); + SPECIAL_LIST.put(key, new RenderSpecial(stack)); } } } @@ -69,13 +69,16 @@ public class SpecialRenderInit{ @SubscribeEvent(priority = EventPriority.HIGHEST) public void onPlayerRender(RenderPlayerEvent.Pre event){ - if(!specialList.isEmpty()){ - for(Map.Entry entry : specialList.entrySet()){ + if(!SPECIAL_LIST.isEmpty()){ + for(Map.Entry entry : SPECIAL_LIST.entrySet()){ //Does the player have one of the names from the list? - if(StringUtil.equalsToLowerCase(entry.getKey(), event.entityPlayer.getName())){ - //Render the special Item/Block - entry.getValue().render(event.entityPlayer, event.partialRenderTick); - break; + String playerName = event.getEntityPlayer().getName(); + if(entry.getKey() != null && playerName != null){ + if(entry.getKey().equalsIgnoreCase(playerName)){ + //Render the special Item/Block + entry.getValue().render(event.getEntityPlayer(), event.getPartialRenderTick()); + break; + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/ThreadSpecialFetcher.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/ThreadSpecialFetcher.java index bdc869c50..e34a9bf08 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/ThreadSpecialFetcher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/ThreadSpecialFetcher.java @@ -1,11 +1,11 @@ /* - * This file ("ThreadSpecialFetcher.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ThreadSpecialFetcher.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.misc.special; @@ -19,7 +19,7 @@ import java.util.Properties; public class ThreadSpecialFetcher extends Thread{ public ThreadSpecialFetcher(){ - this.setName(ModUtil.MOD_ID+" Special Fetcher"); + this.setName(ModUtil.NAME+" Special Fetcher"); this.setDaemon(true); this.start(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/INEIRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/INEIRecipeHandler.java deleted file mode 100644 index d4c570a6e..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/INEIRecipeHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This file ("INEIRecipeHandler.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -import de.ellpeck.actuallyadditions.api.booklet.BookletPage; - -public interface INEIRecipeHandler{ - - BookletPage getPageForInfo(int neiIndex); -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIActuallyAdditionsConfig.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIActuallyAdditionsConfig.java deleted file mode 100644 index 37d43ec4d..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIActuallyAdditionsConfig.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file ("NEIActuallyAdditionsConfig.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEIActuallyAdditionsConfig/* implements IConfigureNEI*/{ - - /*@Override - public void loadConfig(){ - ModUtil.LOGGER.info("Initializing Not Enough Items Plugin..."); - - API.registerGuiOverlay(GuiCrafter.class, "crafting"); - API.registerGuiOverlayHandler(GuiCrafter.class, new DefaultOverlayHandler(), "crafting"); - - NEICrusherRecipe crusherRecipe = new NEICrusherRecipe(); - API.registerRecipeHandler(crusherRecipe); - API.registerUsageHandler(crusherRecipe); - - NEICrusherRecipe.Double crusherDoubleRecipe = new NEICrusherRecipe.Double(); - API.registerRecipeHandler(crusherDoubleRecipe); - API.registerUsageHandler(crusherDoubleRecipe); - - NEIFurnaceDoubleRecipe furnaceDoubleRecipe = new NEIFurnaceDoubleRecipe(); - API.registerRecipeHandler(furnaceDoubleRecipe); - API.registerUsageHandler(furnaceDoubleRecipe); - - NEIHairyBallRecipe ballRecipe = new NEIHairyBallRecipe(); - API.registerRecipeHandler(ballRecipe); - API.registerUsageHandler(ballRecipe); - - NEITreasureChestRecipe treasureChestRecipe = new NEITreasureChestRecipe(); - API.registerRecipeHandler(treasureChestRecipe); - API.registerUsageHandler(treasureChestRecipe); - - NEICompostRecipe compostRecipe = new NEICompostRecipe(); - API.registerRecipeHandler(compostRecipe); - API.registerUsageHandler(compostRecipe); - - NEICoffeeMachineRecipe coffeeMachineRecipe = new NEICoffeeMachineRecipe(); - API.registerRecipeHandler(coffeeMachineRecipe); - API.registerUsageHandler(coffeeMachineRecipe); - - NEIReconstructorRecipe reconstructorRecipe = new NEIReconstructorRecipe(); - API.registerRecipeHandler(reconstructorRecipe); - API.registerUsageHandler(reconstructorRecipe); - - NEIBookletRecipe bookletRecipe = new NEIBookletRecipe(); - API.registerRecipeHandler(bookletRecipe); - API.registerUsageHandler(bookletRecipe); - - API.hideItem(new ItemStack(InitBlocks.blockRice)); - API.hideItem(new ItemStack(InitBlocks.blockCanola)); - API.hideItem(new ItemStack(InitBlocks.blockFlax)); - API.hideItem(new ItemStack(InitBlocks.blockCoffee)); - API.hideItem(new ItemStack(InitBlocks.blockWildPlant, 1, Util.WILDCARD)); - API.hideItem(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD)); - } - - @Override - public String getName(){ - return ModUtil.MOD_ID+" NEI Plugin"; - } - - @Override - public String getVersion(){ - return ModUtil.VERSION; - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java deleted file mode 100644 index 839347ae2..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * This file ("NEIBookletRecipe.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEIBookletRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ - - public static final String NAME = "actuallyadditions.booklet"; - - /*public NEIBookletRecipe(){ - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - @Override - public BookletPage getPageForInfo(int page){ - return ((CachedInfoStack)this.arecipes.get(page)).thePage; - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(0, 18, 165, Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT), NAME)); - } - - @SuppressWarnings("unchecked") - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == NEIBookletRecipe.class){ - for(BookletPage page : ActuallyAdditionsAPI.bookletPagesWithItemStackData){ - ItemStack[] stacks = page.getItemStacksForPage(); - - //So that you don't see things like Mashed Food more than once - ArrayList nonDoubleStacks = new ArrayList(); - for(ItemStack stack : stacks){ - if(!ItemUtil.contains(nonDoubleStacks, stack, true)){ - arecipes.add(new CachedInfoStack(stack, page)); - nonDoubleStacks.add(stack); - } - } - } - } - else{ - super.loadCraftingRecipes(outputId, results); - } - } - - @SuppressWarnings("unchecked") - @Override - public void loadCraftingRecipes(ItemStack result){ - ArrayList allPages = BookletUtils.getPagesForStack(result); - for(BookletPage page : allPages){ - CachedInfoStack theRecipe = new CachedInfoStack(result, page); - arecipes.add(theRecipe); - } - } - - @SuppressWarnings("unchecked") - @Override - public void loadUsageRecipes(ItemStack ingredient){ - ArrayList allPages = BookletUtils.getPagesForStack(ingredient); - for(BookletPage page : allPages){ - CachedInfoStack theRecipe = new CachedInfoStack(ingredient, page); - arecipes.add(theRecipe); - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiFurnaceDouble.png"; - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } - - @Override - public void drawExtras(int recipe){ - CachedInfoStack stack = (CachedInfoStack)this.arecipes.get(recipe); - if(stack.theStack != null){ - List header = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.header").replaceAll("", EnumChatFormatting.BLUE+"").replaceAll("", EnumChatFormatting.BLACK+""), 165); - for(int i = 0; i < header.size(); i++){ - GuiDraw.drawString((String)header.get(i), 0, 18+i*(Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT+1), 0, false); - } - - int maxLines = 5; - IBookletChapter chapter = stack.thePage.getChapter(); - String aText = (chapter.getPages()[0] instanceof PagePicture && chapter.getPages().length > 1 ? chapter.getPages()[1] : chapter.getPages()[0]).getText(); - List text = Minecraft.getMinecraft().fontRendererObj.listFormattedStringToWidth(aText != null ? aText : EnumChatFormatting.DARK_RED+StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".booklet.noText"), 165); - for(int i = 0; i < Math.min(maxLines, text.size()); i++){ - GuiDraw.drawString(text.get(i)+(i == maxLines-1 && text.size() > maxLines ? EnumChatFormatting.RESET+""+EnumChatFormatting.BLACK+"..." : ""), 0, 18+25+i*(Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT+1), 0, false); - } - GuiDraw.drawString(EnumChatFormatting.ITALIC+chapter.getLocalizedName(), 0, 97, 0, false); - GuiDraw.drawString(EnumChatFormatting.ITALIC+"Page "+stack.thePage.getID(), 0, 107, 0, false); - } - } - - @Override - public Class getGuiClass(){ - return null; - } - - @Override - public void drawBackground(int recipe){ - - } - - @Override - public void drawForeground(int recipe){ - GlStateManager.color(1F, 1F, 1F, 1F); - GlStateManager.disableLighting(); - this.drawExtras(recipe); - } - - @Override - public int recipiesPerPage(){ - return 1; - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - public class CachedInfoStack extends CachedRecipe{ - - public ItemStack theStack; - public BookletPage thePage; - - public CachedInfoStack(ItemStack theStack, BookletPage thePage){ - this.theStack = theStack; - this.thePage = thePage; - } - - @Override - public PositionedStack getResult(){ - if(this.theStack != null){ - ItemStack newStack = this.theStack.copy(); - newStack.stackSize = 1; - return new PositionedStack(newStack, 0, 0); - } - return null; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java deleted file mode 100644 index cd92dceee..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * This file ("NEICoffeeMachineRecipe.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEICoffeeMachineRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ - - public static final String NAME = "actuallyadditions.coffee"; - - /*public NEICoffeeMachineRecipe(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 35, 3); - } - - @Override - public BookletPage getPageForInfo(int page){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCoffeeMachine)); - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(20, 39, 20, 16), NAME)); - transferRects.add(new RecipeTransferRect(new Rectangle(64, 42, 23, 10), NAME)); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == NEICoffeeMachineRecipe.class){ - List ingredients = ActuallyAdditionsAPI.coffeeMachineIngredients; - for(CoffeeIngredient ingredient : ingredients){ - arecipes.add(new CachedCoffee(ingredient)); - } - } - else{ - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - List ingredients = ActuallyAdditionsAPI.coffeeMachineIngredients; - for(CoffeeIngredient ingredient : ingredients){ - if(result.getItem() instanceof ItemCoffee){ - arecipes.add(new CachedCoffee(ingredient)); - } - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - - List ingredients = ActuallyAdditionsAPI.coffeeMachineIngredients; - for(CoffeeIngredient ingr : ingredients){ - if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemCoffeeBean), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(ingr.ingredient.copy(), ingredient)){ - CachedCoffee theRecipe = new CachedCoffee(ingr); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredientStack), ingredient); - arecipes.add(theRecipe); - } - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiNEICoffeeMachine.png"; - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } - - @Override - public void drawExtras(int recipe){ - drawProgressBar(20, 39, 126, 0, 21, 16, 48, 0); - drawProgressBar(63, 42, 125, 16, 24, 12, 48, 2); - - CachedCoffee cache = (CachedCoffee)this.arecipes.get(recipe); - if(cache.extraText != null){ - GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.special")+":", 2, 4, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - GuiDraw.drawString(cache.extraText, 2, 16, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - - if(cache.maxAmp > 0){ - GuiDraw.drawString(StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".coffee.maxAmount")+": "+cache.maxAmp, 2, 28, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - } - - @Override - public Class getGuiClass(){ - return GuiCoffeeMachine.class; - } - - @Override - public void drawBackground(int recipeIndex){ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 126, 88); - } - - @Override - public int recipiesPerPage(){ - return 1; - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - public class CachedCoffee extends CachedRecipe{ - - public PositionedStack cup; - public PositionedStack coffeeBeans; - public PositionedStack result; - public PositionedStack ingredientStack; - public String extraText; - public int maxAmp; - - public CachedCoffee(CoffeeIngredient ingredient){ - this.cup = new PositionedStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), 45, 39); - this.coffeeBeans = new PositionedStack(new ItemStack(InitItems.itemCoffeeBean, TileEntityCoffeeMachine.CACHE_USE), 2, 39); - this.ingredientStack = new PositionedStack(ingredient.ingredient.copy(), 90, 21); - this.setupResult(ingredient); - this.extraText = ingredient.getExtraText(); - this.maxAmp = ingredient.maxAmplifier; - } - - public void setupResult(CoffeeIngredient ingredient){ - ItemStack result = new ItemStack(InitItems.itemCoffee); - CoffeeBrewing.addEffectToStack(result, ingredient); - this.result = new PositionedStack(result.copy(), 45, 70); - } - - @Override - public PositionedStack getResult(){ - return result; - } - - @Override - public List getIngredients(){ - ArrayList list = new ArrayList(); - list.add(this.ingredientStack); - list.add(this.cup); - list.add(this.coffeeBeans); - return list; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java deleted file mode 100644 index 4dff5ca4e..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * This file ("NEICompostRecipe.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEICompostRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ - - public static final String NAME = "actuallyadditions.compost"; - - /*public NEICompostRecipe(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - @Override - public BookletPage getPageForInfo(int page){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockCompost)); - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME)); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == NEICompostRecipe.class){ - arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT))); - } - else{ - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - if(NEIServerUtils.areStacksSameType(new ItemStack(InitItems.itemFertilizer), result)){ - arecipes.add(new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT))); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), ingredient)){ - CachedCompostRecipe theRecipe = new CachedCompostRecipe(new ItemStack(InitItems.itemMisc, TileEntityCompost.AMOUNT, TheMiscItems.MASHED_FOOD.ordinal()), new ItemStack(InitItems.itemFertilizer, TileEntityCompost.AMOUNT)); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient); - arecipes.add(theRecipe); - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiNEISimple.png"; - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } - - @Override - public Class getGuiClass(){ - return null; - } - - @Override - public void drawBackground(int recipeIndex){ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); - } - - @Override - public int recipiesPerPage(){ - return 2; - } - - public class CachedCompostRecipe extends CachedRecipe{ - - public PositionedStack result; - public PositionedStack input; - public int chance; - - public CachedCompostRecipe(ItemStack input, ItemStack result){ - this.result = new PositionedStack(result, 67+32, 19); - this.input = new PositionedStack(input, 5+32, 19); - } - - @Override - public PositionedStack getResult(){ - return result; - } - - @Override - public PositionedStack getIngredient(){ - return input; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java deleted file mode 100644 index 6b4569946..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICrusherRecipe.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * This file ("NEICrusherRecipe.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEICrusherRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ - - /*public NEICrusherRecipe(){ - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - @Override - public BookletPage getPageForInfo(int page){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinder)); - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(80, 40, 24, 22), this.getBaseName())); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(this.getBaseName()) && (getClass() == NEICrusherRecipe.class || getClass() == Double.class)){ - for(CrusherRecipe recipe : ActuallyAdditionsAPI.crusherRecipes){ - arecipes.add(new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this)); - } - } - else{ - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - for(CrusherRecipe recipe : ActuallyAdditionsAPI.crusherRecipes){ - if(ItemUtil.contains(recipe.getRecipeOutputOnes(), result, true) || ItemUtil.contains(recipe.getRecipeOutputTwos(), result, true)){ - arecipes.add(new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this)); - } - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - for(CrusherRecipe recipe : ActuallyAdditionsAPI.crusherRecipes){ - if(ItemUtil.contains(recipe.getRecipeInputs(), ingredient, true)){ - CachedCrush theRecipe = new CachedCrush(recipe.getRecipeInputs(), recipe.getRecipeOutputOnes(), recipe.getRecipeOutputTwos(), recipe.outputTwoChance, this); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredient), ingredient); - arecipes.add(theRecipe); - } - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiGrinder.png"; - } - - @Override - public String getOverlayIdentifier(){ - return this.getBaseName(); - } - - @Override - public void drawExtras(int recipe){ - drawProgressBar(80, 40, 176, 0, 24, 23, 48, 1); - this.drawChanceString(118, 73, recipe); - } - - @Override - public Class getGuiClass(){ - return GuiGrinder.class; - } - - @Override - public void drawBackground(int recipeIndex){ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(60, 13, 60, 13, 56, 79); - } - - @Override - public int recipiesPerPage(){ - return 1; - } - - protected void drawChanceString(int x, int y, int recipe){ - CachedCrush crush = (CachedCrush)this.arecipes.get(recipe); - if(crush.resultTwo != null){ - int secondChance = crush.secondChance; - String secondString = secondChance+"%"; - GuiDraw.drawString(secondString, x, y, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - } - - protected String getBaseName(){ - return "actuallyadditions."+(this instanceof Double ? "crushingDouble" : "crushing"); - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+this.getBaseName()+".name"); - } - - public static class Double extends NEICrusherRecipe{ - - @Override - public BookletPage getPageForInfo(int page){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockGrinderDouble)); - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(51, 40, 24, 22), this.getBaseName())); - transferRects.add(new RecipeTransferRect(new Rectangle(101, 40, 24, 22), this.getBaseName())); - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiGrinderDouble.png"; - } - - @Override - public void drawExtras(int recipe){ - drawProgressBar(51, 40, 176, 0, 24, 23, 48, 1); - this.drawChanceString(66, 93, recipe); - } - - @Override - public Class getGuiClass(){ - return GuiGrinder.GuiGrinderDouble.class; - } - - @Override - public void drawBackground(int recipeIndex){ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(33, 20, 33, 20, 110, 70); - } - } - - public class CachedCrush extends CachedRecipe{ - - public PositionedStack ingredient; - public PositionedStack resultOne; - public PositionedStack resultTwo; - public int secondChance; - - public CachedCrush(List in, List outOne, List outTwo, int secondChance, NEICrusherRecipe handler){ - boolean isDouble = handler instanceof Double; - this.ingredient = new PositionedStack(in, isDouble ? 51 : 80, 21); - this.resultOne = new PositionedStack(outOne, isDouble ? 38 : 66, 69); - if(outTwo != null && !outTwo.isEmpty()){ - this.resultTwo = new PositionedStack(outTwo, isDouble ? 63 : 94, 69); - } - this.secondChance = secondChance; - } - - @Override - public PositionedStack getResult(){ - return null; - } - - @Override - public List getIngredients(){ - return this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.ingredient)); - } - - @Override - public List getOtherStacks(){ - ArrayList list = new ArrayList(); - list.addAll(this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.resultOne))); - if(this.resultTwo != null){ - list.addAll(this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.resultTwo))); - } - return list; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java deleted file mode 100644 index df2d1e05a..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This file ("NEIFurnaceDoubleRecipe.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEIFurnaceDoubleRecipe /*extends TemplateRecipeHandler implements INEIRecipeHandler*/{ - - public static final String NAME = "actuallyadditions.furnaceDouble"; - - /*public NEIFurnaceDoubleRecipe(){ - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - @Override - public BookletPage getPageForInfo(int page){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockFurnaceDouble)); - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(51, 40, 24, 22), NAME)); - transferRects.add(new RecipeTransferRect(new Rectangle(101, 40, 24, 22), NAME)); - } - - @SuppressWarnings("unchecked") - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == NEIFurnaceDoubleRecipe.class){ - Map recipes = FurnaceRecipes.instance().getSmeltingList(); - for(Map.Entry recipe : recipes.entrySet()){ - arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue())); - } - } - else{ - super.loadCraftingRecipes(outputId, results); - } - } - - @SuppressWarnings("unchecked") - @Override - public void loadCraftingRecipes(ItemStack result){ - Map recipes = FurnaceRecipes.instance().getSmeltingList(); - for(Map.Entry recipe : recipes.entrySet()){ - if(NEIServerUtils.areStacksSameType(recipe.getValue(), result)){ - arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue())); - } - } - } - - @SuppressWarnings("unchecked") - @Override - public void loadUsageRecipes(ItemStack ingredient){ - Map recipes = FurnaceRecipes.instance().getSmeltingList(); - for(Map.Entry recipe : recipes.entrySet()){ - if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getKey(), ingredient)){ - CachedFurn theRecipe = new CachedFurn(recipe.getKey(), recipe.getValue()); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.ingredient), ingredient); - arecipes.add(theRecipe); - } - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiFurnaceDouble.png"; - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } - - @Override - public void drawExtras(int recipe){ - drawProgressBar(51, 40, 176, 0, 24, 23, 48, 1); - } - - @Override - public Class getGuiClass(){ - return GuiFurnaceDouble.class; - } - - @Override - public void drawBackground(int recipeIndex){ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(46, 20, 46, 20, 84, 70); - } - - @Override - public int recipiesPerPage(){ - return 1; - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - public class CachedFurn extends CachedRecipe{ - - public PositionedStack ingredient; - public PositionedStack resultOne; - - public CachedFurn(ItemStack in, ItemStack resultOne){ - in.stackSize = 1; - this.ingredient = new PositionedStack(in, 51, 21); - this.resultOne = new PositionedStack(resultOne, 50, 69); - } - - @Override - public PositionedStack getResult(){ - return resultOne; - } - - @Override - public List getIngredients(){ - return getCycledIngredients(cycleticks/48, Collections.singletonList(ingredient)); - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java deleted file mode 100644 index 5091b2962..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * This file ("NEIHairyBallRecipe.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEIHairyBallRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ - - public static final String NAME = "actuallyadditions.ballOfHair"; - - /*public NEIHairyBallRecipe(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - @Override - public BookletPage getPageForInfo(int page){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitItems.itemHairyBall)); - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME)); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == NEIHairyBallRecipe.class){ - List recipes = ActuallyAdditionsAPI.ballOfFurReturnItems; - for(BallOfFurReturn recipe : recipes){ - arecipes.add(new CachedBallRecipe(new ItemStack(InitItems.itemHairyBall), recipe.returnItem, recipe.itemWeight)); - } - } - else{ - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - List recipes = ActuallyAdditionsAPI.ballOfFurReturnItems; - for(BallOfFurReturn recipe : recipes){ - if(NEIServerUtils.areStacksSameType(recipe.returnItem, result)){ - arecipes.add(new CachedBallRecipe(new ItemStack(InitItems.itemHairyBall), recipe.returnItem, recipe.itemWeight)); - } - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - List recipes = ActuallyAdditionsAPI.ballOfFurReturnItems; - for(BallOfFurReturn recipe : recipes){ - ItemStack stack = new ItemStack(InitItems.itemHairyBall); - if(NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)){ - CachedBallRecipe theRecipe = new CachedBallRecipe(stack, recipe.returnItem, recipe.itemWeight); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient); - arecipes.add(theRecipe); - } - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiNEISimple.png"; - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } - - @Override - public void drawExtras(int rec){ - CachedBallRecipe recipe = (CachedBallRecipe)this.arecipes.get(rec); - if(recipe.result != null){ - int secondChance = recipe.chance; - String secondString = secondChance+"%"; - GuiDraw.drawString(secondString, 65+32, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - } - - @Override - public Class getGuiClass(){ - return null; - } - - @Override - public void drawBackground(int recipeIndex){ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); - } - - @Override - public int recipiesPerPage(){ - return 2; - } - - public class CachedBallRecipe extends CachedRecipe{ - - public PositionedStack result; - public PositionedStack input; - public int chance; - - public CachedBallRecipe(ItemStack input, ItemStack result, int chance){ - this.result = new PositionedStack(result, 67+32, 19); - this.chance = chance; - this.input = new PositionedStack(input, 5+32, 19); - } - - @Override - public PositionedStack getResult(){ - return result; - } - - @Override - public PositionedStack getIngredient(){ - return input; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java deleted file mode 100644 index 5618b8e40..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * This file ("NEIReconstructorRecipe.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEIReconstructorRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ - - public static final String NAME = "actuallyadditions.reconstructor"; - - /*public NEIReconstructorRecipe(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - @Override - public BookletPage getPageForInfo(int page){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockAtomicReconstructor)); - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME)); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == NEIReconstructorRecipe.class){ - List recipes = ActuallyAdditionsAPI.reconstructorLensNoneRecipes; - //Default Recipes - for(LensNoneRecipe recipe : recipes){ - arecipes.add(new CachedReconstructorRecipe(recipe, false)); - } - //Color Recipes - for(Object o : LensColor.CONVERTABLE_BLOCKS){ - ItemStack stack; - if(o instanceof Block){ - stack = new ItemStack((Block)o); - } - else{ - stack = new ItemStack((Item)o); - } - for(int i = 0; i < 16; i++){ - ItemStack stackCopy = stack.copy(); - stackCopy.setItemDamage(i >= 15 ? 0 : i+1); - stack.setItemDamage(i); - arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipe(stack, stackCopy, LensColor.ENERGY_USE), true)); - } - } - } - else{ - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - List recipes = ActuallyAdditionsAPI.reconstructorLensNoneRecipes; - //Default Recipes - for(LensNoneRecipe recipe : recipes){ - if(ItemUtil.contains(recipe.getOutputs(), result, true)){ - arecipes.add(new CachedReconstructorRecipe(recipe, false)); - } - } - //Color Recipes - if(result.getItem() != null && (Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, result.getItem()) >= 0 || Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, Block.getBlockFromItem(result.getItem())) >= 0)){ - int meta = result.getItemDamage(); - ItemStack input = result.copy(); - input.setItemDamage(meta <= 0 ? 15 : meta-1); - arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipe(input, result, LensColor.ENERGY_USE), true)); - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - List recipes = ActuallyAdditionsAPI.reconstructorLensNoneRecipes; - //Default Recipes - for(LensNoneRecipe recipe : recipes){ - if(ItemUtil.contains(recipe.getInputs(), ingredient, true)){ - CachedReconstructorRecipe theRecipe = new CachedReconstructorRecipe(recipe, false); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient); - arecipes.add(theRecipe); - } - } - //Color Recipes - if(ingredient.getItem() != null && (Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, ingredient.getItem()) >= 0 || Util.arrayContains(LensColor.CONVERTABLE_BLOCKS, Block.getBlockFromItem(ingredient.getItem())) >= 0)){ - int meta = ingredient.getItemDamage(); - ItemStack output = ingredient.copy(); - output.setItemDamage(meta >= 15 ? 0 : meta+1); - arecipes.add(new CachedReconstructorRecipe(new LensNoneRecipe(ingredient, output, LensColor.ENERGY_USE), true)); - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiNEIAtomicReconstructor.png"; - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } - - @Override - public Class getGuiClass(){ - return null; - } - - @Override - public void drawBackground(int recipeIndex){ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); - } - - @Override - public void drawForeground(int recipe){ - if(Minecraft.getMinecraft().currentScreen != null){ - AssetUtil.renderStackToGui(new ItemStack(InitBlocks.blockAtomicReconstructor), 32+34, 19, 1.0F); - } - if(((CachedReconstructorRecipe)this.arecipes.get(recipe)).showColorLens){ - String text = InitItems.itemColorLens.getItemStackDisplayName(new ItemStack(InitItems.itemColorLens)); - GuiDraw.drawString(text, 0, 44, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - } - - @Override - public int recipiesPerPage(){ - return 2; - } - - public class CachedReconstructorRecipe extends CachedRecipe{ - - public PositionedStack result; - public PositionedStack input; - public boolean showColorLens; - - public CachedReconstructorRecipe(LensNoneRecipe recipe, boolean showColorLens){ - this.result = new PositionedStack(recipe.getOutputs(), 67+32, 19); - this.input = new PositionedStack(recipe.getInputs(), 5+32, 19); - this.showColorLens = showColorLens; - } - - @Override - public PositionedStack getResult(){ - return null; - } - - @Override - public List getIngredients(){ - return this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.input)); - } - - @Override - public java.util.List getOtherStacks(){ - ArrayList list = new ArrayList(); - list.addAll(this.getCycledIngredients(cycleticks/48, Collections.singletonList(this.result))); - return list; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java deleted file mode 100644 index e18599c9f..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIScreenEvents.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file ("NEIScreenEvents.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -import de.ellpeck.actuallyadditions.mod.booklet.button.TexturedButton; - -public class NEIScreenEvents{ - - private static final int NEI_BUTTON_ID = 123782; - private TexturedButton neiButton; - - /*@SuppressWarnings("unchecked") - @SubscribeEvent - public void onInitGuiForNEI(GuiScreenEvent.InitGuiEvent event){ - if(event.gui instanceof GuiRecipe){ - int xSize = 176; - int ySize = 166; - int guiLeft = (event.gui.width-xSize)/2; - int guiTop = (event.gui.height-ySize)/2; - - this.neiButton = new TexturedButton(NEI_BUTTON_ID, guiLeft+xSize-24, guiTop+127, 146, 154, 20, 20){ - @Override - public void drawButton(Minecraft minecraft, int x, int y){ - super.drawButton(minecraft, x, y); - if(this.visible && this.hovered){ - String text = StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe"); - Minecraft.getMinecraft().fontRendererObj.drawString(text, this.xPosition-Minecraft.getMinecraft().fontRendererObj.getStringWidth(text)-1, this.yPosition+this.height/2-Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT/2, StringUtil.DECIMAL_COLOR_WHITE, true); - } - } - }; - event.buttonList.add(this.neiButton); - - GuiRecipe theGui = (GuiRecipe)event.gui; - - IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype); - this.neiButton.visible = handler instanceof INEIRecipeHandler && ((INEIRecipeHandler)handler).getPageForInfo(theGui.page) != null; - } - } - - @SubscribeEvent - public void guiPostAction(GuiScreenEvent.ActionPerformedEvent.Post event){ - if(this.neiButton != null && event.gui instanceof GuiRecipe){ - GuiRecipe theGui = (GuiRecipe)event.gui; - - IRecipeHandler handler = theGui.getCurrentRecipeHandlers().get(theGui.recipetype); - boolean isPage = handler instanceof INEIRecipeHandler && ((INEIRecipeHandler)handler).getPageForInfo(theGui.page) != null; - this.neiButton.visible = isPage; - - if(isPage && event.button.id == NEI_BUTTON_ID){ - BookletPage page = ((INEIRecipeHandler)handler).getPageForInfo(theGui.page); - if(page != null){ - GuiBooklet book = new GuiBooklet(Minecraft.getMinecraft().currentScreen, false, true); - Minecraft.getMinecraft().displayGuiScreen(book); - BookletUtils.openIndexEntry(book, page.getChapter().getEntry(), ActuallyAdditionsAPI.bookletEntries.indexOf(page.getChapter().getEntry())/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true); - BookletUtils.openChapter(book, page.getChapter(), page); - } - } - } - }*/ -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java deleted file mode 100644 index 4c21fddd2..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * This file ("NEITreasureChestRecipe.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.nei; - -public class NEITreasureChestRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ - - public static final String NAME = "actuallyadditions.treasureChest"; - - /*public NEITreasureChestRecipe(){ - super(); - RecipeInfo.setGuiOffset(this.getGuiClass(), 0, 0); - } - - @Override - public BookletPage getPageForInfo(int page){ - return BookletUtils.getFirstPageForStack(new ItemStack(InitBlocks.blockTreasureChest)); - } - - @Override - public String getRecipeName(){ - return StringUtil.localize("container.nei."+NAME+".name"); - } - - @Override - public void loadTransferRects(){ - transferRects.add(new RecipeTransferRect(new Rectangle(31+32, 18, 22, 16), NAME)); - } - - @Override - public void loadCraftingRecipes(String outputId, Object... results){ - if(outputId.equals(NAME) && getClass() == NEITreasureChestRecipe.class){ - List recipes = ActuallyAdditionsAPI.treasureChestLoot; - for(TreasureChestLoot recipe : recipes){ - arecipes.add(new CachedTreasure(new ItemStack(InitBlocks.blockTreasureChest), recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount)); - } - } - else{ - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(ItemStack result){ - List recipes = ActuallyAdditionsAPI.treasureChestLoot; - for(TreasureChestLoot recipe : recipes){ - if(NEIServerUtils.areStacksSameType(recipe.returnItem, result)){ - arecipes.add(new CachedTreasure(new ItemStack(InitBlocks.blockTreasureChest), recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount)); - } - } - } - - @Override - public void loadUsageRecipes(ItemStack ingredient){ - List recipes = ActuallyAdditionsAPI.treasureChestLoot; - for(TreasureChestLoot recipe : recipes){ - ItemStack stack = new ItemStack(InitBlocks.blockTreasureChest); - if(NEIServerUtils.areStacksSameTypeCrafting(stack, ingredient)){ - CachedTreasure theRecipe = new CachedTreasure(stack, recipe.returnItem, recipe.itemWeight, recipe.minAmount, recipe.maxAmount); - theRecipe.setIngredientPermutation(Collections.singletonList(theRecipe.input), ingredient); - arecipes.add(theRecipe); - } - } - } - - @Override - public String getGuiTexture(){ - return ModUtil.MOD_ID_LOWER+":textures/gui/guiNEISimple.png"; - } - - @Override - public String getOverlayIdentifier(){ - return NAME; - } - - @Override - public void drawExtras(int rec){ - CachedTreasure recipe = (CachedTreasure)this.arecipes.get(rec); - if(recipe.result != null){ - GuiDraw.drawString(recipe.minAmount+"-"+recipe.maxAmount+" "+StringUtil.localize("container.nei."+ModUtil.MOD_ID_LOWER+".treasureChest.info")+" "+recipe.chance+"%", 55, 45, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); - } - } - - @Override - public Class getGuiClass(){ - return null; - } - - @Override - public void drawBackground(int recipeIndex){ - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(getGuiTexture()); - GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); - } - - @Override - public int recipiesPerPage(){ - return 2; - } - - public class CachedTreasure extends CachedRecipe{ - - public PositionedStack result; - public PositionedStack input; - public int chance; - public int minAmount; - public int maxAmount; - - public CachedTreasure(ItemStack input, ItemStack result, int chance, int minAmount, int maxAmount){ - this.result = new PositionedStack(result, 67+32, 19); - this.chance = chance; - this.input = new PositionedStack(input, 5+32, 19); - this.minAmount = minAmount; - this.maxAmount = maxAmount; - } - - @Override - public PositionedStack getResult(){ - return result; - } - - @Override - public PositionedStack getIngredient(){ - return input; - } - }*/ -} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/IDataHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/IDataHandler.java new file mode 100644 index 000000000..c1ede65c6 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/IDataHandler.java @@ -0,0 +1,19 @@ +/* + * This file ("IDataHandler.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.network; + +import net.minecraft.nbt.NBTTagCompound; + +public interface IDataHandler{ + + void handleData(NBTTagCompound compound); + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java new file mode 100644 index 000000000..83191799b --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java @@ -0,0 +1,69 @@ +/* + * This file ("PacketServerToClient.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.network; + +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import io.netty.buffer.ByteBuf; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; + +public class PacketClientToServer implements IMessage{ + + private NBTTagCompound data; + private IDataHandler handler; + + public PacketClientToServer(){ + + } + + public PacketClientToServer(NBTTagCompound data, IDataHandler handler){ + this.data = data; + this.handler = handler; + } + + @Override + public void fromBytes(ByteBuf buf){ + PacketBuffer buffer = new PacketBuffer(buf); + try{ + this.data = buffer.readNBTTagCompoundFromBuffer(); + + int handlerId = buffer.readInt(); + if(handlerId >= 0 && handlerId < PacketHandler.DATA_HANDLERS.size()){ + this.handler = PacketHandler.DATA_HANDLERS.get(handlerId); + } + } + catch(Exception e){ + ModUtil.LOGGER.error("Something went wrong trying to receive a server packet!", e); + } + } + + @Override + public void toBytes(ByteBuf buf){ + PacketBuffer buffer = new PacketBuffer(buf); + + buffer.writeNBTTagCompoundToBuffer(this.data); + buffer.writeInt(PacketHandler.DATA_HANDLERS.indexOf(this.handler)); + } + + public static class Handler implements IMessageHandler{ + + @Override + public IMessage onMessage(PacketClientToServer message, MessageContext ctx){ + if(message.data != null && message.handler != null){ + message.handler.handleData(message.data); + } + return null; + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java index 143233276..360c5db25 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java @@ -1,34 +1,156 @@ /* - * This file ("PacketHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("PacketHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.network; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiButton; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiNumber; -import de.ellpeck.actuallyadditions.mod.network.gui.PacketGuiString; +import de.ellpeck.actuallyadditions.mod.booklet.entry.EntrySet; +import de.ellpeck.actuallyadditions.mod.data.PlayerData; +import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; +import de.ellpeck.actuallyadditions.mod.network.gui.INumberReactor; +import de.ellpeck.actuallyadditions.mod.network.gui.IStringReactor; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBookletStand; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; -public class PacketHandler{ +import java.util.ArrayList; +import java.util.List; +public final class PacketHandler{ + + public static final List DATA_HANDLERS = new ArrayList(); + public static final IDataHandler PARTICLE_HANDLER = new IDataHandler(){ + @Override + @SideOnly(Side.CLIENT) + public void handleData(NBTTagCompound compound){ + AssetUtil.renderParticlesFromAToB(compound.getDouble("StartX"), compound.getDouble("StartY"), compound.getDouble("StartZ"), compound.getDouble("EndX"), compound.getDouble("EndY"), compound.getDouble("EndZ"), compound.getInteger("ParticleAmount"), compound.getFloat("ParticleSize"), new float[]{compound.getFloat("Color1"), compound.getFloat("Color2"), compound.getFloat("Color3")}, compound.getFloat("AgeMultiplier")); + } + }; + public static final IDataHandler TILE_ENTITY_HANDLER = new IDataHandler(){ + @Override + @SideOnly(Side.CLIENT) + public void handleData(NBTTagCompound compound){ + World world = Minecraft.getMinecraft().theWorld; + if(world != null){ + TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); + if(tile != null && tile instanceof TileEntityBase){ + ((TileEntityBase)tile).receiveSyncCompound(compound.getCompoundTag("Data")); + } + } + } + }; + public static final IDataHandler GUI_BUTTON_TO_TILE_HANDLER = new IDataHandler(){ + @Override + public void handleData(NBTTagCompound compound){ + World world = DimensionManager.getWorld(compound.getInteger("WorldID")); + TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); + + if(tile instanceof IButtonReactor){ + IButtonReactor reactor = (IButtonReactor)tile; + reactor.onButtonPressed(compound.getInteger("ButtonID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); + } + } + }; + public static final IDataHandler GUI_NUMBER_TO_TILE_HANDLER = new IDataHandler(){ + @Override + public void handleData(NBTTagCompound compound){ + World world = DimensionManager.getWorld(compound.getInteger("WorldID")); + TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); + + if(tile instanceof INumberReactor){ + INumberReactor reactor = (INumberReactor)tile; + reactor.onNumberReceived(compound.getInteger("Number"), compound.getInteger("NumberID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); + } + } + }; + public static final IDataHandler GUI_STRING_TO_TILE_HANDLER = new IDataHandler(){ + @Override + public void handleData(NBTTagCompound compound){ + World world = DimensionManager.getWorld(compound.getInteger("WorldID")); + TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); + + if(tile instanceof IStringReactor){ + IStringReactor reactor = (IStringReactor)tile; + reactor.onTextReceived(compound.getString("Text"), compound.getInteger("TextID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); + } + } + }; + public static final IDataHandler PLAYER_DATA_TO_CLIENT_HANDLER = new IDataHandler(){ + @Override + @SideOnly(Side.CLIENT) + public void handleData(NBTTagCompound compound){ + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if(player != null){ + PlayerData.getDataFromPlayer(player).theCompound = compound; + } + } + }; public static SimpleNetworkWrapper theNetwork; + public static final IDataHandler BOOKLET_STAND_BUTTON_HANDLER = new IDataHandler(){ + @Override + public void handleData(NBTTagCompound compound){ + World world = DimensionManager.getWorld(compound.getInteger("WorldID")); + TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); + EntityPlayer player = (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID")); + + if(player != null && tile instanceof TileEntityBookletStand){ + TileEntityBookletStand stand = (TileEntityBookletStand)tile; + if(player.getName() != null && player.getName().equalsIgnoreCase(stand.assignedPlayer)){ + stand.assignedEntry = EntrySet.readFromNBT(compound.getCompoundTag("EntrySet")); + stand.markDirty(); + stand.sendUpdate(); + } + } + } + }; + public static final IDataHandler CHANGE_PLAYER_DATA_HANDLER = new IDataHandler(){ + @Override + public void handleData(NBTTagCompound compound){ + NBTTagCompound data = compound.getCompoundTag("Data"); + World world = DimensionManager.getWorld(compound.getInteger("WorldID")); + EntityPlayer player = (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID")); + + if(player != null){ + PlayerData.PlayerSave playerData = PlayerData.getDataFromPlayer(player); + playerData.theCompound.merge(data); + if(player instanceof EntityPlayerMP){ + PacketHandler.theNetwork.sendTo(new PacketServerToClient(playerData.theCompound, PLAYER_DATA_TO_CLIENT_HANDLER), (EntityPlayerMP)player); + } + } + } + }; public static void init(){ - theNetwork = NetworkRegistry.INSTANCE.newSimpleChannel(ModUtil.MOD_ID_LOWER); + theNetwork = NetworkRegistry.INSTANCE.newSimpleChannel(ModUtil.MOD_ID); + theNetwork.registerMessage(PacketServerToClient.Handler.class, PacketServerToClient.class, 0, Side.CLIENT); + theNetwork.registerMessage(PacketClientToServer.Handler.class, PacketClientToServer.class, 1, Side.SERVER); - theNetwork.registerMessage(PacketGuiButton.Handler.class, PacketGuiButton.class, 0, Side.SERVER); - theNetwork.registerMessage(PacketGuiNumber.Handler.class, PacketGuiNumber.class, 1, Side.SERVER); - theNetwork.registerMessage(PacketGuiString.Handler.class, PacketGuiString.class, 2, Side.SERVER); - theNetwork.registerMessage(PacketParticle.Handler.class, PacketParticle.class, 3, Side.CLIENT); - theNetwork.registerMessage(PacketUpdateTileEntity.Handler.class, PacketUpdateTileEntity.class, 4, Side.CLIENT); + DATA_HANDLERS.add(PARTICLE_HANDLER); + DATA_HANDLERS.add(TILE_ENTITY_HANDLER); + DATA_HANDLERS.add(BOOKLET_STAND_BUTTON_HANDLER); + DATA_HANDLERS.add(GUI_BUTTON_TO_TILE_HANDLER); + DATA_HANDLERS.add(GUI_STRING_TO_TILE_HANDLER); + DATA_HANDLERS.add(GUI_NUMBER_TO_TILE_HANDLER); + DATA_HANDLERS.add(CHANGE_PLAYER_DATA_HANDLER); + DATA_HANDLERS.add(PLAYER_DATA_TO_CLIENT_HANDLER); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketParticle.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketParticle.java deleted file mode 100644 index f61ebfe3b..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketParticle.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * This file ("PacketParticle.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.network; - -import de.ellpeck.actuallyadditions.mod.misc.EntityColoredParticleFX; -import io.netty.buffer.ByteBuf; -import net.minecraft.client.Minecraft; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public class PacketParticle implements IMessage{ - - private int startX; - private int startY; - private int startZ; - private int endX; - private int endY; - private int endZ; - private float[] color; - private int particleAmount; - private float particleSize; - - @SuppressWarnings("unused") - public PacketParticle(){ - - } - - public PacketParticle(int startX, int startY, int startZ, int endX, int endY, int endZ, float[] color, int particleAmount, float particleSize){ - this.startX = startX; - this.startY = startY; - this.startZ = startZ; - this.endX = endX; - this.endY = endY; - this.endZ = endZ; - this.color = color; - this.particleAmount = particleAmount; - this.particleSize = particleSize; - } - - @SideOnly(Side.CLIENT) - public static void renderParticlesFromAToB(int startX, int startY, int startZ, int endX, int endY, int endZ, int particleAmount, float particleSize, float[] color, float ageMultiplier){ - World world = Minecraft.getMinecraft().theWorld; - - if(Minecraft.getMinecraft().thePlayer.getDistance(startX, startY, startZ) <= 64 || Minecraft.getMinecraft().thePlayer.getDistance(endX, endY, endZ) <= 64){ - int difX = startX-endX; - int difY = startY-endY; - int difZ = startZ-endZ; - double distance = new Vec3(startX, startY, startZ).distanceTo(new Vec3(endX, endY, endZ)); - - for(int times = 0; times < particleAmount/2; times++){ - for(double i = 0; i <= 1; i += 1/(distance*particleAmount)){ - EntityColoredParticleFX fx = new EntityColoredParticleFX(world, (difX*i)+endX+0.5, (difY*i)+endY+0.5, (difZ*i)+endZ+0.5, particleSize, color[0], color[1], color[2], ageMultiplier); - Minecraft.getMinecraft().effectRenderer.addEffect(fx); - } - } - } - } - - @Override - public void fromBytes(ByteBuf buf){ - this.startX = buf.readInt(); - this.startY = buf.readInt(); - this.startZ = buf.readInt(); - this.endX = buf.readInt(); - this.endY = buf.readInt(); - this.endZ = buf.readInt(); - this.particleAmount = buf.readInt(); - this.particleSize = buf.readFloat(); - - this.color = new float[3]; - for(int i = 0; i < this.color.length; i++){ - this.color[i] = buf.readFloat(); - } - } - - @Override - public void toBytes(ByteBuf buf){ - buf.writeInt(this.startX); - buf.writeInt(this.startY); - buf.writeInt(this.startZ); - buf.writeInt(this.endX); - buf.writeInt(this.endY); - buf.writeInt(this.endZ); - buf.writeInt(this.particleAmount); - buf.writeFloat(this.particleSize); - - for(float aColor : this.color){ - buf.writeFloat(aColor); - } - } - - public static class Handler implements IMessageHandler{ - - @Override - @SideOnly(Side.CLIENT) - public IMessage onMessage(PacketParticle message, MessageContext ctx){ - renderParticlesFromAToB(message.startX, message.startY, message.startZ, message.endX, message.endY, message.endZ, message.particleAmount, message.particleSize, message.color, 1); - return null; - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java new file mode 100644 index 000000000..1e250d9ac --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java @@ -0,0 +1,72 @@ +/* + * This file ("PacketServerToClient.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.network; + +import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import io.netty.buffer.ByteBuf; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; +import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public class PacketServerToClient implements IMessage{ + + private NBTTagCompound data; + private IDataHandler handler; + + public PacketServerToClient(){ + + } + + public PacketServerToClient(NBTTagCompound data, IDataHandler handler){ + this.data = data; + this.handler = handler; + } + + @Override + public void fromBytes(ByteBuf buf){ + PacketBuffer buffer = new PacketBuffer(buf); + try{ + this.data = buffer.readNBTTagCompoundFromBuffer(); + + int handlerId = buffer.readInt(); + if(handlerId >= 0 && handlerId < PacketHandler.DATA_HANDLERS.size()){ + this.handler = PacketHandler.DATA_HANDLERS.get(handlerId); + } + } + catch(Exception e){ + ModUtil.LOGGER.error("Something went wrong trying to receive a client packet!", e); + } + } + + @Override + public void toBytes(ByteBuf buf){ + PacketBuffer buffer = new PacketBuffer(buf); + + buffer.writeNBTTagCompoundToBuffer(this.data); + buffer.writeInt(PacketHandler.DATA_HANDLERS.indexOf(this.handler)); + } + + public static class Handler implements IMessageHandler{ + + @Override + @SideOnly(Side.CLIENT) + public IMessage onMessage(PacketServerToClient message, MessageContext ctx){ + if(message.data != null && message.handler != null){ + message.handler.handleData(message.data); + } + return null; + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java deleted file mode 100644 index d515af4ba..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketUpdateTileEntity.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * This file ("PacketUpdateTileEntity.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.network; - -import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import io.netty.buffer.ByteBuf; -import net.minecraft.client.Minecraft; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.PacketBuffer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -public class PacketUpdateTileEntity implements IMessage{ - - private NBTTagCompound compound; - private BlockPos pos; - - @SuppressWarnings("unused") - public PacketUpdateTileEntity(){ - - } - - public PacketUpdateTileEntity(TileEntityBase tile){ - this.compound = tile.getSyncCompound(); - this.pos = tile.getPos(); - } - - @Override - public void fromBytes(ByteBuf buf){ - PacketBuffer buffer = new PacketBuffer(buf); - try{ - this.compound = buffer.readNBTTagCompoundFromBuffer(); - this.pos = buffer.readBlockPos(); - } - catch(Exception e){ - ModUtil.LOGGER.error("Something went wrong trying to receive a TileEntity packet!", e); - } - } - - @Override - public void toBytes(ByteBuf buf){ - PacketBuffer buffer = new PacketBuffer(buf); - - buffer.writeNBTTagCompoundToBuffer(this.compound); - buffer.writeBlockPos(this.pos); - } - - public static class Handler implements IMessageHandler{ - - @Override - @SideOnly(Side.CLIENT) - public IMessage onMessage(PacketUpdateTileEntity message, MessageContext ctx){ - if(message.pos != null && message.compound != null){ - World world = Minecraft.getMinecraft().theWorld; - if(world != null){ - TileEntity tile = world.getTileEntity(message.pos); - if(tile != null && tile instanceof TileEntityBase){ - ((TileEntityBase)tile).receiveSyncCompound(message.compound); - } - } - } - return null; - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IButtonReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IButtonReactor.java index 3e46569b8..b53f86187 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IButtonReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IButtonReactor.java @@ -1,11 +1,11 @@ /* - * This file ("IButtonReactor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IButtonReactor.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.network.gui; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/INumberReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/INumberReactor.java index 93fb7f525..c9f4f4e30 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/INumberReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/INumberReactor.java @@ -1,11 +1,11 @@ /* - * This file ("INumberReactor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("INumberReactor.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.network.gui; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IStringReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IStringReactor.java index f3e6c9fc9..9584e303a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IStringReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/IStringReactor.java @@ -1,11 +1,11 @@ /* - * This file ("IStringReactor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IStringReactor.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.network.gui; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiButton.java deleted file mode 100644 index bbe43d312..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiButton.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This file ("PacketGuiButton.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.network.gui; - - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; - -public class PacketGuiButton implements IMessage{ - - private int tileX; - private int tileY; - private int tileZ; - private int worldID; - private int buttonID; - private int playerID; - - @SuppressWarnings("unused") - public PacketGuiButton(){ - - } - - public PacketGuiButton(int x, int y, int z, World world, int buttonID, EntityPlayer player){ - this.tileX = x; - this.tileY = y; - this.tileZ = z; - this.worldID = world.provider.getDimensionId(); - this.buttonID = buttonID; - this.playerID = player.getEntityId(); - } - - @Override - public void fromBytes(ByteBuf buf){ - this.tileX = buf.readInt(); - this.tileY = buf.readInt(); - this.tileZ = buf.readInt(); - this.worldID = buf.readInt(); - this.buttonID = buf.readInt(); - this.playerID = buf.readInt(); - } - - @Override - public void toBytes(ByteBuf buf){ - buf.writeInt(this.tileX); - buf.writeInt(this.tileY); - buf.writeInt(this.tileZ); - buf.writeInt(this.worldID); - buf.writeInt(this.buttonID); - buf.writeInt(this.playerID); - } - - public static class Handler implements IMessageHandler{ - - @Override - public IMessage onMessage(PacketGuiButton message, MessageContext ctx){ - World world = DimensionManager.getWorld(message.worldID); - TileEntity tile = world.getTileEntity(new BlockPos(message.tileX, message.tileY, message.tileZ)); - - if(tile instanceof IButtonReactor){ - IButtonReactor reactor = (IButtonReactor)tile; - reactor.onButtonPressed(message.buttonID, (EntityPlayer)world.getEntityByID(message.playerID)); - } - - return null; - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiNumber.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiNumber.java deleted file mode 100644 index 1be9ea5a8..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiNumber.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file ("PacketGuiNumber.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.network.gui; - - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; - -public class PacketGuiNumber implements IMessage{ - - private int tileX; - private int tileY; - private int tileZ; - private int worldID; - private int text; - private int textID; - private int playerID; - - @SuppressWarnings("unused") - public PacketGuiNumber(){ - - } - - public PacketGuiNumber(int x, int y, int z, World world, int text, int textID, EntityPlayer player){ - this.tileX = x; - this.tileY = y; - this.tileZ = z; - this.worldID = world.provider.getDimensionId(); - this.text = text; - this.textID = textID; - this.playerID = player.getEntityId(); - } - - @Override - public void fromBytes(ByteBuf buf){ - this.tileX = buf.readInt(); - this.tileY = buf.readInt(); - this.tileZ = buf.readInt(); - this.worldID = buf.readInt(); - this.text = buf.readInt(); - this.textID = buf.readInt(); - this.playerID = buf.readInt(); - } - - @Override - public void toBytes(ByteBuf buf){ - buf.writeInt(this.tileX); - buf.writeInt(this.tileY); - buf.writeInt(this.tileZ); - buf.writeInt(this.worldID); - buf.writeInt(this.text); - buf.writeInt(this.textID); - buf.writeInt(this.playerID); - } - - public static class Handler implements IMessageHandler{ - - @Override - public IMessage onMessage(PacketGuiNumber message, MessageContext ctx){ - World world = DimensionManager.getWorld(message.worldID); - TileEntity tile = world.getTileEntity(new BlockPos(message.tileX, message.tileY, message.tileZ)); - - if(tile instanceof INumberReactor){ - INumberReactor reactor = (INumberReactor)tile; - reactor.onNumberReceived(message.text, message.textID, (EntityPlayer)world.getEntityByID(message.playerID)); - } - - return null; - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiString.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiString.java deleted file mode 100644 index d48071826..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/gui/PacketGuiString.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * This file ("PacketGuiString.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.network.gui; - - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.fml.common.network.simpleimpl.IMessage; -import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; -import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; - -public class PacketGuiString implements IMessage{ - - private int tileX; - private int tileY; - private int tileZ; - private int worldID; - private String text; - private int textID; - private int playerID; - - @SuppressWarnings("unused") - public PacketGuiString(){ - - } - - public PacketGuiString(int x, int y, int z, World world, String text, int textID, EntityPlayer player){ - this.tileX = x; - this.tileY = y; - this.tileZ = z; - this.worldID = world.provider.getDimensionId(); - this.text = text; - this.textID = textID; - this.playerID = player.getEntityId(); - } - - @Override - public void fromBytes(ByteBuf buf){ - this.tileX = buf.readInt(); - this.tileY = buf.readInt(); - this.tileZ = buf.readInt(); - this.worldID = buf.readInt(); - - this.text = ""; - int textLength = buf.readInt(); - for(int i = 0; i < textLength; i++){ - this.text += buf.readChar(); - } - - this.textID = buf.readInt(); - this.playerID = buf.readInt(); - } - - @Override - public void toBytes(ByteBuf buf){ - buf.writeInt(this.tileX); - buf.writeInt(this.tileY); - buf.writeInt(this.tileZ); - buf.writeInt(this.worldID); - - buf.writeInt(this.text.length()); - for(int i = 0; i < this.text.length(); i++){ - buf.writeChar(this.text.charAt(i)); - } - - buf.writeInt(this.textID); - buf.writeInt(this.playerID); - } - - public static class Handler implements IMessageHandler{ - - @Override - public IMessage onMessage(PacketGuiString message, MessageContext ctx){ - World world = DimensionManager.getWorld(message.worldID); - TileEntity tile = world.getTileEntity(new BlockPos(message.tileX, message.tileY, message.tileZ)); - - if(tile instanceof IStringReactor){ - IStringReactor reactor = (IStringReactor)tile; - reactor.onTextReceived(message.text, message.textID, (EntityPlayer)world.getEntityByID(message.playerID)); - } - - return null; - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java index 6d66e3be0..ba0693038 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java @@ -1,11 +1,11 @@ /* - * This file ("InitOreDict.java") is part of the Actually Additions Mod for Minecraft. + * This file ("InitOreDict.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.ore; @@ -24,13 +24,13 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -public class InitOreDict{ +public final class InitOreDict{ public static void init(){ ModUtil.LOGGER.info("Initializing OreDictionary Entries..."); //Vanilla Ores - addOre(Items.coal, "coal"); + addOre(Items.COAL, "coal"); //Ores for Pulverizers etc. addOre(InitItems.itemDust, TheDusts.IRON.ordinal(), "dustIron"); @@ -50,7 +50,7 @@ public class InitOreDict{ addOre(InitItems.itemRiceSeed, "seedRice"); addOre(InitItems.itemFoods, TheFoods.RICE.ordinal(), "cropRice"); addOre(InitItems.itemFlaxSeed, "seedFlax"); - addOre(Items.string, "cropFlax"); + addOre(Items.STRING, "cropFlax"); addOre(InitItems.itemCoffeeSeed, "seedCoffee"); addOre(InitItems.itemCoffeeBean, "cropCoffee"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java index a33b7322e..0df33228c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -1,11 +1,11 @@ /* - * This file ("ClientProxy.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ClientProxy.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.proxy; @@ -15,62 +15,95 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.BookletPage; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; +import de.ellpeck.actuallyadditions.mod.blocks.render.RenderCompost; +import de.ellpeck.actuallyadditions.mod.blocks.render.RenderDisplayStand; +import de.ellpeck.actuallyadditions.mod.blocks.render.RenderReconstructorLens; +import de.ellpeck.actuallyadditions.mod.blocks.render.RenderSmileyCloud; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.event.InitEvents; +import de.ellpeck.actuallyadditions.mod.event.ClientEvents; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityDisplayStand; +import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper; +import de.ellpeck.actuallyadditions.mod.util.IColorProvidingItem; import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import de.ellpeck.actuallyadditions.mod.util.playerdata.PersistentClientData; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.resources.IReloadableResourceManager; import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.IResourceManagerReloadListener; -import net.minecraft.client.resources.model.ModelBakery; -import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import java.io.BufferedWriter; import java.io.File; -import java.util.Calendar; -import java.util.HashMap; -import java.util.Map; +import java.io.FileWriter; +import java.util.*; public class ClientProxy implements IProxy{ + private static final List COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING = new ArrayList(); + private static final Map MODEL_LOCATIONS_FOR_REGISTERING = new HashMap(); public static boolean pumpkinBlurPumpkinBlur; public static boolean jingleAllTheWay; public static boolean bulletForMyValentine; public static int bookletWordCount; public static int bookletCharCount; - private static Map modelLocationsForRegistering = new HashMap(); - private static Map modelVariantsForRegistering = new HashMap(); private static void countBookletWords(){ bookletWordCount = 0; bookletCharCount = 0; + String bookletText = ""; - for(IBookletEntry entry : ActuallyAdditionsAPI.bookletEntries){ - for(IBookletChapter chapter : entry.getChapters()){ - for(BookletPage page : chapter.getPages()){ - if(page.getText() != null){ - bookletWordCount += page.getText().split(" ").length; - bookletCharCount += page.getText().length(); + for(IBookletEntry entry : ActuallyAdditionsAPI.BOOKLET_ENTRIES){ + if(entry != ActuallyAdditionsAPI.allAndSearch){ + bookletWordCount += entry.getLocalizedName().split(" ").length; + bookletCharCount += entry.getLocalizedName().length(); + bookletText += entry.getLocalizedName()+"\n\n"; + + for(IBookletChapter chapter : entry.getChapters()){ + bookletWordCount += chapter.getLocalizedName().split(" ").length; + bookletCharCount += chapter.getLocalizedName().length(); + bookletText += chapter.getLocalizedName()+"\n"; + + for(BookletPage page : chapter.getPages()){ + if(page.getText() != null){ + bookletWordCount += page.getText().split(" ").length; + bookletCharCount += page.getText().length(); + bookletText += page.getText()+"\n"; + } } + bookletText += "\n"; + } - bookletWordCount += chapter.getLocalizedName().split(" ").length; - bookletCharCount += chapter.getLocalizedName().length(); + bookletText += "\n"; + } + } + + if(ConfigBoolValues.BOOKLET_TEXT_TO_FILE.isEnabled()){ + File file = new File(Minecraft.getMinecraft().mcDataDir, ModUtil.MOD_ID+"booklettext.txt"); + try{ + file.createNewFile(); + BufferedWriter writer = new BufferedWriter(new FileWriter(file)); + writer.write(TextFormatting.getTextWithoutFormattingCodes(bookletText)); + writer.close(); + ModUtil.LOGGER.info("Wrote booklet text to file!"); + } + catch(Exception e){ + ModUtil.LOGGER.error("Couldn't write booklet text to file!", e); } - bookletWordCount += entry.getLocalizedName().split(" ").length; - bookletCharCount += entry.getLocalizedName().length(); } } @@ -82,17 +115,16 @@ public class ClientProxy implements IProxy{ Calendar c = Calendar.getInstance(); pumpkinBlurPumpkinBlur = c.get(Calendar.MONTH) == Calendar.OCTOBER; jingleAllTheWay = c.get(Calendar.MONTH) == Calendar.DECEMBER && c.get(Calendar.DAY_OF_MONTH) >= 6 && c.get(Calendar.DAY_OF_MONTH) <= 26; - bulletForMyValentine = (c.get(Calendar.MONTH) == Calendar.FEBRUARY && c.get(Calendar.DAY_OF_MONTH) >= 12 && c.get(Calendar.DAY_OF_MONTH) <= 16) || StringUtil.equalsToLowerCase(Minecraft.getMinecraft().getSession().getUsername(), "pinkhrya"); + bulletForMyValentine = c.get(Calendar.MONTH) == Calendar.FEBRUARY && c.get(Calendar.DAY_OF_MONTH) >= 12 && c.get(Calendar.DAY_OF_MONTH) <= 16; } else{ ModUtil.LOGGER.warn("You have turned Seasonal Mode off. Therefore, you are evil."); } - PersistentClientData.setTheFile(new File(Minecraft.getMinecraft().mcDataDir, ModUtil.MOD_ID+"Data.dat")); - - for(Map.Entry entry : modelVariantsForRegistering.entrySet()){ - ModelBakery.registerItemVariants(entry.getKey(), entry.getValue()); + for(Map.Entry entry : MODEL_LOCATIONS_FOR_REGISTERING.entrySet()){ + ModelLoader.setCustomModelResourceLocation(entry.getKey().getItem(), entry.getKey().getItemDamage(), entry.getValue()); } + this.registerCustomFluidBlockRenderer(InitFluids.fluidCanolaOil); this.registerCustomFluidBlockRenderer(InitFluids.fluidOil); @@ -123,24 +155,19 @@ public class ClientProxy implements IProxy{ public void init(FMLInitializationEvent event){ ModUtil.LOGGER.info("Initializing ClientProxy..."); - InitEvents.initClient(); + new ClientEvents(); - //TODO Fix Tile rendering - /*ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderTileEntity(new ModelCompost())); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFishingNet.class, new RenderTileEntity(new ModelFishingNet())); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFurnaceSolar.class, new RenderTileEntity(new ModelFurnaceSolar())); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoffeeMachine.class, new RenderTileEntity(new ModelCoffeeMachine())); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPhantomBooster.class, new RenderTileEntity(new ModelPhantomBooster())); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmileyCloud.class, new RenderSmileyCloud(new ModelSmileyCloud())); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserRelay.class, new RenderLaserRelay(new ModelLaserRelay())); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBookletStand.class, new RenderTileEntity(new ModelBookletStand())); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAtomicReconstructor.class, new RenderReconstructorLens());*/ + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCompost.class, new RenderCompost()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAtomicReconstructor.class, new RenderReconstructorLens()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmileyCloud.class, new RenderSmileyCloud()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayStand.class, new RenderDisplayStand()); - //TODO Fix villager - //VillagerRegistry.instance().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/entity/villager/jamVillager.png")); + //VillagerRegistry.INSTANCE().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID, "textures/entity/villager/jamVillager.png")); - for(Map.Entry entry : modelLocationsForRegistering.entrySet()){ - Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(entry.getKey().getItem(), entry.getKey().getItemDamage(), new ModelResourceLocation(entry.getValue(), "inventory")); + for(Item item : COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING){ + if(item instanceof IColorProvidingItem){ + Minecraft.getMinecraft().getItemColors().registerItemColorHandler(((IColorProvidingItem)item).getColor(), item); + } } } @@ -148,18 +175,16 @@ public class ClientProxy implements IProxy{ public void postInit(FMLPostInitializationEvent event){ ModUtil.LOGGER.info("PostInitializing ClientProxy..."); - SpecialRenderInit.init(); - - countBookletWords(); + new SpecialRenderInit(); } @Override - public void addRenderRegister(ItemStack stack, ResourceLocation location){ - modelLocationsForRegistering.put(stack, location); + public void addRenderRegister(ItemStack stack, ResourceLocation location, String variant){ + MODEL_LOCATIONS_FOR_REGISTERING.put(stack, new ModelResourceLocation(location, variant)); } @Override - public void addRenderVariant(Item item, ResourceLocation... location){ - modelVariantsForRegistering.put(item, location); + public void addColoredItem(Item item){ + COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING.add(item); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/IProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/IProxy.java index e15121884..b82ad41a0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/IProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/IProxy.java @@ -1,11 +1,11 @@ /* - * This file ("IProxy.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IProxy.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.proxy; @@ -25,7 +25,7 @@ public interface IProxy{ void postInit(FMLPostInitializationEvent event); - void addRenderRegister(ItemStack stack, ResourceLocation location); + void addRenderRegister(ItemStack stack, ResourceLocation location, String variant); - void addRenderVariant(Item item, ResourceLocation... location); + void addColoredItem(Item item); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ServerProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ServerProxy.java index cd4b73a1c..4cdd5ed05 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ServerProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ServerProxy.java @@ -1,11 +1,11 @@ /* - * This file ("ServerProxy.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ServerProxy.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.proxy; @@ -18,7 +18,6 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -@SuppressWarnings("unused") public class ServerProxy implements IProxy{ @Override @@ -37,12 +36,12 @@ public class ServerProxy implements IProxy{ } @Override - public void addRenderRegister(ItemStack stack, ResourceLocation location){ + public void addRenderRegister(ItemStack stack, ResourceLocation location, String variant){ } @Override - public void addRenderVariant(Item item, ResourceLocation... location){ + public void addColoredItem(Item item){ } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java index 77497cb10..9d9772cb0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java @@ -1,18 +1,18 @@ /* - * This file ("CrusherRecipeRegistry.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CrusherRecipeRegistry.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.recipe; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.item.ItemStack; @@ -22,23 +22,23 @@ import java.util.ArrayList; import java.util.List; -public class CrusherRecipeRegistry{ +public final class CrusherRecipeRegistry{ - public static ArrayList searchCases = new ArrayList(); + public static final ArrayList SEARCH_CASES = new ArrayList(); public static void registerFinally(){ ArrayList oresNoResult = new ArrayList(); - int recipeStartedAt = ActuallyAdditionsAPI.crusherRecipes.size(); + int recipeStartedAt = ActuallyAdditionsAPI.CRUSHER_RECIPES.size(); for(String ore : OreDictionary.getOreNames()){ if(!hasException(ore)){ - for(SearchCase theCase : searchCases){ + for(SearchCase theCase : SEARCH_CASES){ if(ore.length() > theCase.theCase.length()){ if(ore.substring(0, theCase.theCase.length()).equals(theCase.theCase)){ String output = theCase.resultPreString+ore.substring(theCase.theCase.length()); if(!hasOreRecipe(ore)){ - if(!OreDictionary.getOres(output).isEmpty() && !OreDictionary.getOres(ore).isEmpty()){ + if(!OreDictionary.getOres(output, false).isEmpty() && !OreDictionary.getOres(ore, false).isEmpty()){ ActuallyAdditionsAPI.addCrusherRecipe(ore, output, theCase.resultAmount); } else{ @@ -54,8 +54,8 @@ public class CrusherRecipeRegistry{ } ArrayList addedRecipes = new ArrayList(); - for(int i = recipeStartedAt; i < ActuallyAdditionsAPI.crusherRecipes.size(); i++){ - CrusherRecipe recipe = ActuallyAdditionsAPI.crusherRecipes.get(i); + for(int i = recipeStartedAt; i < ActuallyAdditionsAPI.CRUSHER_RECIPES.size(); i++){ + CrusherRecipe recipe = ActuallyAdditionsAPI.CRUSHER_RECIPES.get(i); addedRecipes.add(recipe.input+" -> "+recipe.outputOneAmount+"x "+recipe.outputOne); } ModUtil.LOGGER.info("Added "+addedRecipes.size()+" Crusher Recipes automatically: "+addedRecipes.toString()); @@ -63,7 +63,7 @@ public class CrusherRecipeRegistry{ } private static boolean hasException(String ore){ - for(String conf : ConfigValues.crusherRecipeExceptions){ + for(String conf : ConfigStringListValues.CRUSHER_RECIPE_EXCEPTIONS.getValue()){ if(conf.equals(ore)){ return true; } @@ -72,7 +72,7 @@ public class CrusherRecipeRegistry{ } public static boolean hasOreRecipe(String input){ - for(CrusherRecipe recipe : ActuallyAdditionsAPI.crusherRecipes){ + for(CrusherRecipe recipe : ActuallyAdditionsAPI.CRUSHER_RECIPES){ if(recipe.input != null && recipe.input.equals(input)){ return true; } @@ -86,7 +86,7 @@ public class CrusherRecipeRegistry{ } public static CrusherRecipe getRecipeFromInput(ItemStack input){ - for(CrusherRecipe recipe : ActuallyAdditionsAPI.crusherRecipes){ + for(CrusherRecipe recipe : ActuallyAdditionsAPI.CRUSHER_RECIPES){ if(ItemUtil.contains(recipe.getRecipeInputs(), input, true)){ return recipe; } @@ -106,9 +106,9 @@ public class CrusherRecipeRegistry{ public static class SearchCase{ - String theCase; - int resultAmount; - String resultPreString; + final String theCase; + final int resultAmount; + final String resultPreString; public SearchCase(String theCase, int resultAmount){ this(theCase, resultAmount, "dust"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java index 080f057f9..8f8e2257a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java @@ -1,11 +1,11 @@ /* - * This file ("FuelHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("FuelHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.recipe; @@ -20,55 +20,54 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.IFuelHandler; import net.minecraftforge.fml.common.registry.GameRegistry; -import org.apache.commons.lang3.tuple.Pair; -import java.util.HashMap; +import java.util.ArrayList; +import java.util.List; -@SuppressWarnings("unused") public class FuelHandler implements IFuelHandler{ - private static HashMap, Integer> fuelList = new HashMap, Integer>(); + private static final List FUEL_LIST = new ArrayList(); public static void init(){ ModUtil.LOGGER.info("Initializing Fuelstuffs..."); GameRegistry.registerFuelHandler(new FuelHandler()); - setFuelValues(); - } - public static void setFuelValues(){ addFuel(InitItems.itemMisc, TheMiscItems.TINY_CHAR.ordinal(), 200); addFuel(InitItems.itemMisc, TheMiscItems.TINY_COAL.ordinal(), 200); addFuel(InitBlocks.blockMisc, TheMiscBlocks.CHARCOAL_BLOCK.ordinal(), 16000); + addFuel(InitItems.itemMisc, TheMiscItems.BIOCOAL.ordinal(), 180); } - private static void addFuel(Item item, int metadata, int value){ - fuelList.put(Pair.of(item, metadata), value); + private static void addFuel(Item item, int meta, int value){ + FUEL_LIST.add(new Fuel(new ItemStack(item, 1, meta), value)); } - private static void addFuel(Block block, int metadata, int value){ - addFuel(Item.getItemFromBlock(block), metadata, value); + private static void addFuel(Block block, int meta, int value){ + addFuel(Item.getItemFromBlock(block), meta, value); } - private static int getFuelValue(ItemStack stack){ - if(stack != null && stack.getItem() != null){ - Pair pair = Pair.of(stack.getItem(), stack.getItemDamage()); - - if(fuelList.containsKey(pair)){ - return fuelList.get(pair); - } - else{ - pair = Pair.of(stack.getItem(), 0); - if(fuelList.containsKey(pair)){ - return fuelList.get(pair); + @Override + public int getBurnTime(ItemStack stack){ + if(stack != null){ + for(Fuel fuel : FUEL_LIST){ + if(stack.isItemEqual(fuel.fuel)){ + return fuel.burnTime; } } } return 0; } - @Override - public int getBurnTime(ItemStack fuel){ - return getFuelValue(fuel); + private static class Fuel{ + + public ItemStack fuel; + public int burnTime; + + public Fuel(ItemStack fuel, int burnTime){ + this.fuel = fuel; + this.burnTime = burnTime; + } + } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/HairyBallHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/HairyBallHandler.java index 3f43cfaa0..e3e8bc7cb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/HairyBallHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/HairyBallHandler.java @@ -1,11 +1,11 @@ /* - * This file ("HairyBallHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("HairyBallHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.recipe; @@ -16,32 +16,32 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -public class HairyBallHandler{ +public final class HairyBallHandler{ public static void init(){ - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.string), 100); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.diamond), 2); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.name_tag), 1); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.fish), 80); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.fish, 1, 1), 60); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.fish, 1, 2), 10); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.fish, 1, 3), 40); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.feather), 60); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.leather), 30); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.dye), 70); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.clay_ball), 40); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.stick), 40); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.iron_ingot), 10); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.gold_ingot), 6); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.beef), 30); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.ender_pearl), 2); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.planks), 20); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.waterlily), 10); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.experience_bottle), 3); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.gravel), 40); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.sand), 50); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.vine), 30); - ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.web), 4); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.STRING), 100); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.DIAMOND), 2); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.NAME_TAG), 1); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.FISH), 80); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.FISH, 1, 1), 60); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.FISH, 1, 2), 10); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.FISH, 1, 3), 40); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.FEATHER), 60); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.LEATHER), 30); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.DYE), 70); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.CLAY_BALL), 40); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.STICK), 40); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.IRON_INGOT), 10); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.GOLD_INGOT), 6); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.BEEF), 30); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.ENDER_PEARL), 2); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.PLANKS), 20); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.WATERLILY), 10); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.EXPERIENCE_BOTTLE), 3); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.GRAVEL), 40); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.SAND), 50); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.VINE), 30); + ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Blocks.WEB), 4); ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(InitItems.itemSolidifiedExperience), 20); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/TreasureChestHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/TreasureChestHandler.java index aa365c338..8ff8a54e1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/TreasureChestHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/TreasureChestHandler.java @@ -1,11 +1,11 @@ /* - * This file ("TreasureChestHandler.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TreasureChestHandler.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.recipe; @@ -16,41 +16,41 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheJams; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -public class TreasureChestHandler{ +public final class TreasureChestHandler{ public static void init(){ - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.diamond), 5, 1, 2); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.iron_ingot), 30, 1, 5); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.gold_nugget), 60, 1, 8); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.gold_ingot), 35, 1, 3); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.ender_pearl), 10, 1, 2); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.emerald), 3, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.experience_bottle), 5, 3, 6); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.DIAMOND), 5, 1, 2); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.IRON_INGOT), 30, 1, 5); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.GOLD_NUGGET), 60, 1, 8); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.GOLD_INGOT), 35, 1, 3); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.ENDER_PEARL), 10, 1, 2); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.EMERALD), 3, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.EXPERIENCE_BOTTLE), 5, 3, 6); ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(InitItems.itemSolidifiedExperience), 15, 3, 6); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_11), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_13), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_blocks), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_cat), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_chirp), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_far), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_mall), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_mellohi), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_stal), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_strad), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_ward), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.record_wait), 1, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.saddle), 5, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.name_tag), 20, 1, 2); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_11), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_13), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_BLOCKS), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_CAT), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_CHIRP), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_FAR), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_MALL), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_MELLOHI), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_STAL), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_STRAD), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_WARD), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.RECORD_WAIT), 1, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.SADDLE), 5, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.NAME_TAG), 20, 1, 2); ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(InitItems.itemJams, 1, TheJams.CU_BA_RA.ordinal()), 10, 1, 2); ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(InitItems.itemJams, 1, TheJams.GRA_KI_BA.ordinal()), 10, 1, 2); ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(InitItems.itemJams, 1, TheJams.PL_AP_LE.ordinal()), 10, 1, 2); ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(InitItems.itemJams, 1, TheJams.CH_AP_CI.ordinal()), 10, 1, 2); ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(InitItems.itemJams, 1, TheJams.HO_ME_KI.ordinal()), 10, 1, 2); ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(InitItems.itemJams, 1, TheJams.PI_CO.ordinal()), 10, 1, 2); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.fish), 80, 1, 3); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.fish, 1, 1), 60, 1, 3); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.fish, 1, 2), 10, 1, 1); - ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.fish, 1, 3), 40, 1, 2); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.FISH), 80, 1, 3); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.FISH, 1, 1), 60, 1, 3); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.FISH, 1, 2), 10, 1, 1); + ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.FISH, 1, 3), 40, 1, 2); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java index 59113953f..4c3c22201 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergyDisplay.java @@ -1,11 +1,11 @@ /* - * This file ("IEnergyDisplay.java") is part of the Actually Additions Mod for Minecraft. + * This file ("IEnergyDisplay.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -20,4 +20,7 @@ public interface IEnergyDisplay{ @SideOnly(Side.CLIENT) int getMaxEnergy(); + + @SideOnly(Side.CLIENT) + boolean needsHoldShift(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergySaver.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergySaver.java deleted file mode 100644 index c6f432f56..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IEnergySaver.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This file ("IEnergySaver.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.tile; - -public interface IEnergySaver{ - - int getEnergy(); - - void setEnergy(int energy); -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IFluidSaver.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IFluidSaver.java deleted file mode 100644 index f6ac5393b..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IFluidSaver.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This file ("IFluidSaver.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.tile; - -import net.minecraftforge.fluids.FluidStack; - -public interface IFluidSaver{ - - FluidStack[] getFluids(); - - void setFluids(FluidStack[] fluids); -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IRedstoneToggle.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IRedstoneToggle.java deleted file mode 100644 index ca5712b50..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/IRedstoneToggle.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This file ("IRedstoneToggle.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.tile; - -public interface IRedstoneToggle{ - - void toggle(boolean to); - - boolean isPulseMode(); - - void activateOnPulse(); -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index c6bf6c649..e42600573 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -1,52 +1,61 @@ /* - * This file ("TileEntityAtomicReconstructor.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityAtomicReconstructor.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.lens.ILensItem; import de.ellpeck.actuallyadditions.api.lens.Lens; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.items.lens.Lenses; -import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.PacketParticle; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityAtomicReconstructor extends TileEntityInventoryBase implements IEnergyReceiver, IEnergySaver, IRedstoneToggle, IEnergyDisplay, IAtomicReconstructor{ +public class TileEntityAtomicReconstructor extends TileEntityInventoryBase implements IEnergyReceiver, IEnergyDisplay, IAtomicReconstructor{ public static final int ENERGY_USE = 1000; - public EnergyStorage storage = new EnergyStorage(300000); + public final EnergyStorage storage = new EnergyStorage(300000); + public int counter; private int currentTime; - private boolean activateOnceWithSignal; private int oldEnergy; public TileEntityAtomicReconstructor(){ super(1, "reconstructor"); } + public static void shootLaser(World world, double startX, double startY, double startZ, double endX, double endY, double endZ, Lens currentLens){ + if(!ConfigBoolValues.LESS_SOUND.isEnabled()){ + world.playSound(null, startX, startY, startZ, SoundHandler.reconstructor, SoundCategory.BLOCKS, 0.35F, 1.0F); + } + AssetUtil.shootParticles(world, startX, startY, startZ, endX, endY, endZ, currentLens.getColor(), ConfigBoolValues.LESS_PARTICLES.isEnabled() ? 2 : 8, 2F); + } + @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("CurrentTime", this.currentTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("CurrentTime", this.currentTime); + compound.setInteger("Counter", this.counter); + } this.storage.writeToNBT(compound); } @@ -56,18 +65,20 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTime = compound.getInteger("CurrentTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.currentTime = compound.getInteger("CurrentTime"); + this.counter = compound.getInteger("Counter"); + } this.storage.readFromNBT(compound); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); if(!this.worldObj.isRemote){ - if(!this.isRedstonePowered && !this.activateOnceWithSignal){ + if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; if(this.currentTime <= 0){ @@ -88,41 +99,36 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple private void doWork(){ if(this.storage.getEnergyStored() >= ENERGY_USE){ - EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj)); + IBlockState state = this.worldObj.getBlockState(this.pos); + EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)); //Extract energy for shooting the laser itself too! this.storage.extractEnergy(ENERGY_USE, false); //The Lens the Reconstructor currently has installed - Lens currentLens = this.getCurrentLens(); + Lens currentLens = this.getLens(); int distance = currentLens.getDistance(); for(int i = 0; i < distance; i++){ - BlockPos hitBlock = WorldUtil.getCoordsFromSide(sideToManipulate, this.pos, i); + BlockPos hitBlock = this.pos.offset(sideToManipulate, i); - if(currentLens.invoke(hitBlock, this)){ - this.shootLaser(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), currentLens); + if(currentLens.invoke(this.worldObj.getBlockState(hitBlock), hitBlock, this)){ + shootLaser(this.worldObj, this.getX(), this.getY(), this.getZ(), hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), currentLens); break; } else if(i >= distance-1){ - this.shootLaser(hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), currentLens); + shootLaser(this.worldObj, this.getX(), this.getY(), this.getZ(), hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), currentLens); } } } } - public Lens getCurrentLens(){ + @Override + public Lens getLens(){ if(this.slots[0] != null){ if(this.slots[0].getItem() instanceof ILensItem){ return ((ILensItem)this.slots[0].getItem()).getLens(); } } - return Lenses.LENS_NONE; - } - - private void shootLaser(int endX, int endY, int endZ, Lens currentLens){ - if(!ConfigValues.lessSound){ - this.worldObj.playSoundEffect(this.getX(), this.getY(), this.getZ(), ModUtil.MOD_ID_LOWER+":reconstructor", 0.35F, 1.0F); - } - PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getX(), this.getY(), this.getZ(), endX, endY, endZ, currentLens.getColor(), ConfigValues.lessParticles ? 2 : 8, 2F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.getX(), this.getY(), this.getZ(), 64)); + return this.counter >= 500 ? ActuallyAdditionsAPI.lensDisruption : ActuallyAdditionsAPI.lensDefaultConversion; } @Override @@ -196,11 +202,6 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple return this.storage.getEnergyStored(); } - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - @Override @SideOnly(Side.CLIENT) public int getMaxEnergy(){ @@ -208,13 +209,13 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple } @Override - public void toggle(boolean to){ - this.activateOnceWithSignal = to; + public boolean needsHoldShift(){ + return false; } @Override - public boolean isPulseMode(){ - return this.activateOnceWithSignal; + public boolean isRedstoneToggle(){ + return true; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java index 5ee48df56..fe28f4844 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -1,101 +1,149 @@ /* - * This file ("TileEntityBase.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityBase.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; +import cofh.api.energy.IEnergyProvider; +import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.PacketUpdateTileEntity; +import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; +import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fml.common.ModAPIManager; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; public abstract class TileEntityBase extends TileEntity implements ITickable{ + public static boolean teslaLoaded; public boolean isRedstonePowered; + public boolean isPulseMode; protected int ticksElapsed; + public final String name; + + public TileEntityBase(String name){ + this.name = name; + } public static void init(){ ModUtil.LOGGER.info("Registering TileEntities..."); - GameRegistry.registerTileEntity(TileEntityCompost.class, ModUtil.MOD_ID_LOWER+":tileEntityCompost"); - GameRegistry.registerTileEntity(TileEntityFeeder.class, ModUtil.MOD_ID_LOWER+":tileEntityFeeder"); - GameRegistry.registerTileEntity(TileEntityGiantChest.class, ModUtil.MOD_ID_LOWER+":tileEntityGiantChest"); - GameRegistry.registerTileEntity(TileEntityGrinder.class, ModUtil.MOD_ID_LOWER+":tileEntityGrinder"); - GameRegistry.registerTileEntity(TileEntityFurnaceDouble.class, ModUtil.MOD_ID_LOWER+":tileEntityFurnaceDouble"); - GameRegistry.registerTileEntity(TileEntityInputter.class, ModUtil.MOD_ID_LOWER+":tileEntityInputter"); - GameRegistry.registerTileEntity(TileEntityFishingNet.class, ModUtil.MOD_ID_LOWER+":tileEntityFishingNet"); - GameRegistry.registerTileEntity(TileEntityFurnaceSolar.class, ModUtil.MOD_ID_LOWER+":tileEntityFurnaceSolar"); - GameRegistry.registerTileEntity(TileEntityHeatCollector.class, ModUtil.MOD_ID_LOWER+":tileEntityHeatCollector"); - GameRegistry.registerTileEntity(TileEntityItemRepairer.class, ModUtil.MOD_ID_LOWER+":tileEntityRepairer"); - GameRegistry.registerTileEntity(TileEntityGreenhouseGlass.class, ModUtil.MOD_ID_LOWER+":tileEntityGreenhouseGlass"); - GameRegistry.registerTileEntity(TileEntityBreaker.class, ModUtil.MOD_ID_LOWER+":tileEntityBreaker"); - GameRegistry.registerTileEntity(TileEntityDropper.class, ModUtil.MOD_ID_LOWER+":tileEntityDropper"); - GameRegistry.registerTileEntity(TileEntityInputter.TileEntityInputterAdvanced.class, ModUtil.MOD_ID_LOWER+":tileEntityInputterAdvanced"); - GameRegistry.registerTileEntity(TileEntityBreaker.TileEntityPlacer.class, ModUtil.MOD_ID_LOWER+":tileEntityPlacer"); - GameRegistry.registerTileEntity(TileEntityGrinder.TileEntityGrinderDouble.class, ModUtil.MOD_ID_LOWER+":tileEntityGrinderDouble"); - GameRegistry.registerTileEntity(TileEntityCanolaPress.class, ModUtil.MOD_ID_LOWER+":tileEntityCanolaPress"); - GameRegistry.registerTileEntity(TileEntityFermentingBarrel.class, ModUtil.MOD_ID_LOWER+":tileEntityFermentingBarrel"); - GameRegistry.registerTileEntity(TileEntityOilGenerator.class, ModUtil.MOD_ID_LOWER+":tileEntityOilGenerator"); - GameRegistry.registerTileEntity(TileEntityCoalGenerator.class, ModUtil.MOD_ID_LOWER+":tileEntityCoalGenerator"); - GameRegistry.registerTileEntity(TileEntityPhantomItemface.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomItemface"); - GameRegistry.registerTileEntity(TileEntityPhantomLiquiface.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomLiquiface"); - GameRegistry.registerTileEntity(TileEntityPhantomEnergyface.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomEnergyface"); - GameRegistry.registerTileEntity(TileEntityPhantomPlacer.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomPlacer"); - GameRegistry.registerTileEntity(TileEntityPhantomPlacer.TileEntityPhantomBreaker.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomBreaker"); - GameRegistry.registerTileEntity(TileEntityFluidCollector.class, ModUtil.MOD_ID_LOWER+":tileEntityFluidCollector"); - GameRegistry.registerTileEntity(TileEntityFluidCollector.TileEntityFluidPlacer.class, ModUtil.MOD_ID_LOWER+":tileEntityFluidPlacer"); - GameRegistry.registerTileEntity(TileEntityLavaFactoryController.class, ModUtil.MOD_ID_LOWER+":tileEntityLavaFactoryController"); - GameRegistry.registerTileEntity(TileEntityCoffeeMachine.class, ModUtil.MOD_ID_LOWER+":tileEntityCoffeeMachine"); - GameRegistry.registerTileEntity(TileEntityPhantomBooster.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomBooster"); - GameRegistry.registerTileEntity(TileEntityEnergizer.class, ModUtil.MOD_ID_LOWER+":tileEntityEnergizer"); - GameRegistry.registerTileEntity(TileEntityEnervator.class, ModUtil.MOD_ID_LOWER+":tileEntityEnervator"); - GameRegistry.registerTileEntity(TileEntityXPSolidifier.class, ModUtil.MOD_ID_LOWER+":tileEntityXPSolidifier"); - GameRegistry.registerTileEntity(TileEntitySmileyCloud.class, ModUtil.MOD_ID_LOWER+":tileEntityCloud"); - GameRegistry.registerTileEntity(TileEntityLeafGenerator.class, ModUtil.MOD_ID_LOWER+":tileEntityLeafGenerator"); - GameRegistry.registerTileEntity(TileEntityDirectionalBreaker.class, ModUtil.MOD_ID_LOWER+":tileEntityDirectionalBreaker"); - GameRegistry.registerTileEntity(TileEntityRangedCollector.class, ModUtil.MOD_ID_LOWER+":tileEntityRangedCollector"); - GameRegistry.registerTileEntity(TileEntityLaserRelay.class, ModUtil.MOD_ID_LOWER+":tileEntityLaserRelay"); - GameRegistry.registerTileEntity(TileEntityAtomicReconstructor.class, ModUtil.MOD_ID_LOWER+":tileEntityAtomicReconstructor"); - GameRegistry.registerTileEntity(TileEntityMiner.class, ModUtil.MOD_ID_LOWER+":tileEntityMiner"); - GameRegistry.registerTileEntity(TileEntityFireworkBox.class, ModUtil.MOD_ID_LOWER+":tileEntityFireworkBox"); + register(TileEntityCompost.class, "Compost"); + register(TileEntityFeeder.class, "Feeder"); + register(TileEntityGiantChest.class, "GiantChest"); + register(TileEntityGiantChestMedium.class, "GiantChestMedium"); + register(TileEntityGiantChestLarge.class, "GiantChestLarge"); + register(TileEntityGrinder.class, "Grinder"); + register(TileEntityFurnaceDouble.class, "FurnaceDouble"); + register(TileEntityInputter.class, "Inputter"); + register(TileEntityFishingNet.class, "FishingNet"); + register(TileEntityFurnaceSolar.class, "FurnaceSolar"); + register(TileEntityHeatCollector.class, "HeatCollector"); + register(TileEntityItemRepairer.class, "Repairer"); + register(TileEntityGreenhouseGlass.class, "GreenhouseGlass"); + register(TileEntityBreaker.class, "Breaker"); + register(TileEntityDropper.class, "Dropper"); + register(TileEntityInputterAdvanced.class, "InputterAdvanced"); + register(TileEntityPlacer.class, "Placer"); + register(TileEntityGrinderDouble.class, "GrinderDouble"); + register(TileEntityCanolaPress.class, "CanolaPress"); + register(TileEntityFermentingBarrel.class, "FermentingBarrel"); + register(TileEntityOilGenerator.class, "OilGenerator"); + register(TileEntityCoalGenerator.class, "CoalGenerator"); + register(TileEntityPhantomItemface.class, "PhantomItemface"); + register(TileEntityPhantomLiquiface.class, "PhantomLiquiface"); + register(TileEntityPhantomEnergyface.class, "PhantomEnergyface"); + register(TileEntityPlayerInterface.class, "PlayerInterface"); + register(TileEntityPhantomPlacer.class, "PhantomPlacer"); + register(TileEntityPhantomBreaker.class, "PhantomBreaker"); + register(TileEntityFluidCollector.class, "FluidCollector"); + register(TileEntityFluidPlacer.class, "FluidPlacer"); + register(TileEntityLavaFactoryController.class, "LavaFactoryController"); + register(TileEntityCoffeeMachine.class, "CoffeeMachine"); + register(TileEntityPhantomBooster.class, "PhantomBooster"); + register(TileEntityEnergizer.class, "Energizer"); + register(TileEntityEnervator.class, "Enervator"); + register(TileEntityXPSolidifier.class, "XPSolidifier"); + register(TileEntitySmileyCloud.class, "Cloud"); + register(TileEntityLeafGenerator.class, "LeafGenerator"); + register(TileEntityDirectionalBreaker.class, "DirectionalBreaker"); + register(TileEntityRangedCollector.class, "RangedCollector"); + register(TileEntityAtomicReconstructor.class, "AtomicReconstructor"); + register(TileEntityMiner.class, "Miner"); + register(TileEntityFireworkBox.class, "FireworkBox"); + register(TileEntityPhantomRedstoneface.class, "PhantomRedstoneface"); + register(TileEntityLaserRelayItem.class, "LaserRelayItem"); + register(TileEntityLaserRelayEnergy.class, "LaserRelay"); + register(TileEntityLaserRelayItemWhitelist.class, "LaserRelayItemWhitelist"); + register(TileEntityItemViewer.class, "ItemViewer"); + register(TileEntityBookletStand.class, "BookletStand"); + register(TileEntityDisplayStand.class, "DisplayStand"); + register(TileEntityShockSuppressor.class, "ShockSuppressor"); + + if(ModAPIManager.INSTANCE.hasAPI("Tesla|API")){ + ModUtil.LOGGER.info("Tesla API loaded... Activating Tesla Power System integration..."); + teslaLoaded = true; + } + else{ + ModUtil.LOGGER.info("Tesla API not found! Skipping Tesla Power System integration."); + } + } + + private static void register(Class tileClass, String legacyName){ + try{ + //This is hacky and dirty but it works so whatever + String name = ModUtil.MOD_ID+":"+tileClass.newInstance().name; + String oldName = ModUtil.MOD_ID+":tileEntity"+legacyName; + GameRegistry.registerTileEntityWithAlternatives(tileClass, name, oldName); + } + catch(Exception e){ + ModUtil.LOGGER.fatal("Registering a TileEntity failed!", e); + } } @Override - public final void readFromNBT(NBTTagCompound compound){ + public void readFromNBT(NBTTagCompound compound){ super.readFromNBT(compound); - this.isRedstonePowered = compound.getBoolean("Redstone"); - this.readSyncableNBT(compound, false); + this.readSyncableNBT(compound, NBTType.SAVE_TILE); } @Override - public final void writeToNBT(NBTTagCompound compound){ - super.writeToNBT(compound); - compound.setBoolean("Redstone", this.isRedstonePowered); - this.writeSyncableNBT(compound, false); + public NBTTagCompound writeToNBT(NBTTagCompound compound){ + compound = super.writeToNBT(compound); + this.writeSyncableNBT(compound, NBTType.SAVE_TILE); + return compound; } @Override - public final Packet getDescriptionPacket(){ - NBTTagCompound compound = this.getSyncCompound(); + public SPacketUpdateTileEntity getUpdatePacket(){ + NBTTagCompound compound = this.getUpdateTag(); if(compound != null){ - return new S35PacketUpdateTileEntity(this.pos, 3, compound); + return new SPacketUpdateTileEntity(this.pos, 0, compound); } else{ return null; @@ -103,7 +151,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } @Override - public final void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt){ if(pkt != null){ this.receiveSyncCompound(pkt.getNbtCompound()); } @@ -115,42 +163,73 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } public void receiveSyncCompound(NBTTagCompound compound){ - this.readSyncableNBT(compound, true); + this.readSyncableNBT(compound, NBTType.SYNC); } - public NBTTagCompound getSyncCompound(){ - NBTTagCompound tag = new NBTTagCompound(); - this.writeSyncableNBT(tag, true); + @Override + public NBTTagCompound getUpdateTag(){ + NBTTagCompound tag = super.getUpdateTag(); + this.writeSyncableNBT(tag, NBTType.SYNC); return tag; } - public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ - if(this instanceof IRedstoneToggle){ - compound.setBoolean("IsPulseMode", ((IRedstoneToggle)this).isPulseMode()); - } + @Override + public void handleUpdateTag(NBTTagCompound compound){ + this.receiveSyncCompound(compound); } - public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ - if(this instanceof IRedstoneToggle){ - ((IRedstoneToggle)this).toggle(compound.getBoolean("IsPulseMode")); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type == NBTType.SAVE_TILE){ + compound.setBoolean("Redstone", this.isRedstonePowered); + } + if(this.isRedstoneToggle() && (type != NBTType.SAVE_BLOCK || this.isPulseMode)){ + compound.setBoolean("IsPulseMode", this.isPulseMode); } } @Override - public final void update(){ + public ITextComponent getDisplayName(){ + return new TextComponentTranslation("container."+ModUtil.MOD_ID+"."+this.name+".name"); + } + + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type == NBTType.SAVE_TILE){ + this.isRedstonePowered = compound.getBoolean("Redstone"); + } + if(this.isRedstoneToggle()){ + this.isPulseMode = compound.getBoolean("IsPulseMode"); + } + } + + @Override + public void update(){ this.updateEntity(); } public void updateEntity(){ this.ticksElapsed++; + + if(!this.worldObj.isRemote){ + if(this instanceof IEnergyReceiver || this instanceof IEnergyProvider){ + WorldUtil.doEnergyInteraction(this); + } + + if(this instanceof net.minecraftforge.fluids.IFluidHandler || this.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null)){ + WorldUtil.doFluidInteraction(this); + } + } } - public final void setRedstonePowered(boolean powered){ + public void setRedstonePowered(boolean powered){ this.isRedstonePowered = powered; this.markDirty(); } - protected final boolean sendUpdateWithInterval(){ + public boolean canPlayerUse(EntityPlayer player){ + return player.getDistanceSq(this.getPos().getX()+0.5D, this.pos.getY()+0.5D, this.pos.getZ()+0.5D) <= 64 && !this.isInvalid() && this.worldObj.getTileEntity(this.pos) == this; + } + + protected boolean sendUpdateWithInterval(){ if(this.ticksElapsed%ConfigIntValues.TILE_ENTITY_UPDATE_INTERVAL.getValue() == 0){ this.sendUpdate(); return true; @@ -160,7 +239,57 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } } - public final void sendUpdate(){ - PacketHandler.theNetwork.sendToAllAround(new PacketUpdateTileEntity(this), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimensionId(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 64)); + public void sendUpdate(){ + if(!this.worldObj.isRemote){ + NBTTagCompound compound = this.getUpdateTag(); + if(compound != null){ + NBTTagCompound data = new NBTTagCompound(); + data.setTag("Data", compound); + data.setInteger("X", this.pos.getX()); + data.setInteger("Y", this.pos.getY()); + data.setInteger("Z", this.pos.getZ()); + PacketHandler.theNetwork.sendToAllAround(new PacketServerToClient(data, PacketHandler.TILE_ENTITY_HANDLER), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 128)); + } + } + } + + @Override + public boolean hasCapability(Capability capability, EnumFacing facing){ + return this.getCapability(capability, facing) != null; + } + + @Override + public T getCapability(Capability capability, EnumFacing facing){ + if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){ + IFluidHandler tank = this.getFluidHandler(facing); + if(tank != null){ + return (T)tank; + } + } + else if(teslaLoaded){ + T cap = TeslaUtil.getTeslaCapability(this, capability, facing); + if(cap != null){ + return cap; + } + } + return super.getCapability(capability, facing); + } + + public IFluidHandler getFluidHandler(EnumFacing facing){ + return null; + } + + public boolean isRedstoneToggle(){ + return false; + } + + public void activateOnPulse(){ + + } + + public enum NBTType{ + SAVE_TILE, + SYNC, + SAVE_BLOCK } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBookletStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBookletStand.java new file mode 100644 index 000000000..390edccbe --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBookletStand.java @@ -0,0 +1,45 @@ +/* + * This file ("TileEntityBookletStand.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import de.ellpeck.actuallyadditions.mod.booklet.entry.EntrySet; +import net.minecraft.nbt.NBTTagCompound; + +public class TileEntityBookletStand extends TileEntityBase{ + + public EntrySet assignedEntry = new EntrySet(null); + public String assignedPlayer; + + public TileEntityBookletStand(){ + super("bookletStand"); + } + + @Override + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setTag("SavedEntry", this.assignedEntry.writeToNBT()); + + if(this.assignedPlayer != null){ + compound.setString("Player", this.assignedPlayer); + } + } + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.assignedEntry = EntrySet.readFromNBT(compound.getCompoundTag("SavedEntry")); + this.assignedPlayer = compound.getString("Player"); + } + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index 56ece8b7c..9901c4289 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -1,33 +1,34 @@ /* - * This file ("TileEntityBreaker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityBreaker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockAir; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.event.ForgeEventFactory; -import java.util.ArrayList; +import java.util.List; -public class TileEntityBreaker extends TileEntityInventoryBase implements IRedstoneToggle{ +public class TileEntityBreaker extends TileEntityInventoryBase{ public boolean isPlacer; private int currentTime; - private boolean activateOnceWithSignal; public TileEntityBreaker(int slots, String name){ super(slots, name); @@ -39,23 +40,26 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("CurrentTime", this.currentTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("CurrentTime", this.currentTime); + } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTime = compound.getInteger("CurrentTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.currentTime = compound.getInteger("CurrentTime"); + } } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - if(!this.isRedstonePowered && !this.activateOnceWithSignal){ + if(!this.worldObj.isRemote){ + if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; if(this.currentTime <= 0){ @@ -75,31 +79,32 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst } private void doWork(){ - EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj)); + IBlockState state = this.worldObj.getBlockState(this.pos); + EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)); - BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, this.pos, 0); - if(coordsBlock != null){ - Block blockToBreak = PosUtil.getBlock(coordsBlock, worldObj); - if(!this.isPlacer && blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(worldObj, coordsBlock) > -1.0F){ - ArrayList drops = new ArrayList(); - int meta = PosUtil.getMetadata(coordsBlock, worldObj); - drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock, worldObj.getBlockState(coordsBlock), 0)); + BlockPos coordsBlock = this.pos.offset(sideToManipulate, 0); + IBlockState stateToBreak = this.worldObj.getBlockState(coordsBlock); + Block blockToBreak = stateToBreak.getBlock(); + if(!this.isPlacer && blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(stateToBreak, this.worldObj, coordsBlock) > -1.0F){ + List drops = blockToBreak.getDrops(this.worldObj, coordsBlock, stateToBreak, 0); + float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.worldObj, coordsBlock, this.worldObj.getBlockState(coordsBlock), 0, 1, false, null); + if(Util.RANDOM.nextFloat() <= chance){ if(WorldUtil.addToInventory(this, drops, false, true)){ - if(!ConfigValues.lessBlockBreakingEffects){ - worldObj.playAuxSFX(2001, coordsBlock, Block.getStateId(worldObj.getBlockState(coordsBlock))); + if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ + this.worldObj.playEvent(2001, coordsBlock, Block.getStateId(stateToBreak)); } - WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos); + this.worldObj.setBlockToAir(coordsBlock); WorldUtil.addToInventory(this, drops, true, true); this.markDirty(); } } - else if(this.isPlacer){ - int theSlot = WorldUtil.findFirstFilledSlot(this.slots); - this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(sideToManipulate, worldObj, this.pos, this.slots[theSlot])); - if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){ - this.slots[theSlot] = null; - } + } + else if(this.isPlacer){ + int theSlot = WorldUtil.findFirstFilledSlot(this.slots); + this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(sideToManipulate, this.worldObj, this.pos, this.slots[theSlot])); + if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){ + this.slots[theSlot] = null; } } } @@ -115,13 +120,8 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst } @Override - public void toggle(boolean to){ - this.activateOnceWithSignal = to; - } - - @Override - public boolean isPulseMode(){ - return this.activateOnceWithSignal; + public boolean isRedstoneToggle(){ + return true; } @Override @@ -129,13 +129,4 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements IRedst this.doWork(); } - public static class TileEntityPlacer extends TileEntityBreaker{ - - public TileEntityPlacer(){ - super(9, "placer"); - this.isPlacer = true; - } - - } - } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index f56e4361e..e87cb1b6c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityCanolaPress.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityCanolaPress.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -15,29 +15,35 @@ import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; -import net.minecraft.init.Items; +import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidTankProperties; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityCanolaPress extends TileEntityInventoryBase implements IEnergyReceiver, IFluidHandler, IEnergySaver, IFluidSaver{ +public class TileEntityCanolaPress extends TileEntityInventoryBase implements IEnergyReceiver, net.minecraftforge.fluids.IFluidHandler{ public static final int PRODUCE = 80; public static final int ENERGY_USE = 35; private static final int TIME = 30; - public EnergyStorage storage = new EnergyStorage(40000); - public FluidTank tank = new FluidTank(2*FluidContainerRegistry.BUCKET_VOLUME); + public final EnergyStorage storage = new EnergyStorage(40000); + public final FluidTank tank = new FluidTank(2*Util.BUCKET){ + @Override + public boolean canFill(){ + return false; + } + }; public int currentProcessTime; private int lastEnergyStored; private int lastTankAmount; private int lastProcessTime; public TileEntityCanolaPress(){ - super(3, "canolaPress"); + super(1, "canolaPress"); } @SideOnly(Side.CLIENT) @@ -56,26 +62,29 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("ProcessTime", this.currentProcessTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("ProcessTime", this.currentProcessTime); + } this.storage.writeToNBT(compound); this.tank.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); + super.writeSyncableNBT(compound, type); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.currentProcessTime = compound.getInteger("ProcessTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + this.currentProcessTime = compound.getInteger("ProcessTime"); + } this.storage.readFromNBT(compound); this.tank.readFromNBT(compound); - super.readSyncableNBT(compound, sync); + super.readSyncableNBT(compound, type); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(this.isCanola(0) && PRODUCE <= this.tank.getCapacity()-this.tank.getFluidAmount()){ if(this.storage.getEnergyStored() >= ENERGY_USE){ this.currentProcessTime++; @@ -88,7 +97,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE this.slots[0] = null; } - this.tank.fill(new FluidStack(InitFluids.fluidCanolaOil, PRODUCE), true); + this.tank.fillInternal(new FluidStack(InitFluids.fluidCanolaOil, PRODUCE), true); this.markDirty(); } } @@ -97,18 +106,6 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE this.currentProcessTime = 0; } - WorldUtil.fillBucket(tank, slots, 1, 2); - - if(this.tank.getFluidAmount() > 0){ - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.DOWN, this.tank); - if(!this.isRedstonePowered){ - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.NORTH, this.tank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.EAST, this.tank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.SOUTH, this.tank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.WEST, this.tank); - } - } - if((this.storage.getEnergyStored() != this.lastEnergyStored || this.tank.getFluidAmount() != this.lastTankAmount | this.currentProcessTime != this.lastProcessTime) && this.sendUpdateWithInterval()){ this.lastEnergyStored = this.storage.getEnergyStored(); this.lastProcessTime = this.currentProcessTime; @@ -119,7 +116,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == 0 && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CANOLA.ordinal()) || (i == 1 && stack.getItem() == Items.bucket); + return (i == 0 && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CANOLA.ordinal()); } public boolean isCanola(int slot){ @@ -133,7 +130,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return slot == 2 && FluidContainerRegistry.containsFluid(this.slots[0], new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME)); + return false; } @Override @@ -156,56 +153,63 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE return true; } + @Override + public FluidTank getFluidHandler(EnumFacing facing){ + return facing != EnumFacing.UP ? this.tank : null; + } + @Override public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - return 0; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? 0 : handler.fill(resource, doFill); } @Override public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - if(resource.getFluid() == InitFluids.fluidCanolaOil){ - return this.tank.drain(resource.amount, doDrain); - } - return null; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(resource, doDrain); } @Override public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain){ - return this.tank.drain(maxDrain, doDrain); + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(maxDrain, doDrain); } @Override public boolean canFill(EnumFacing from, Fluid fluid){ + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canFillFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } return false; } @Override public boolean canDrain(EnumFacing from, Fluid fluid){ - return from != EnumFacing.UP; + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canDrainFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } + return false; } @Override public FluidTankInfo[] getTankInfo(EnumFacing from){ - return new FluidTankInfo[]{this.tank.getInfo()}; - } - - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - - @Override - public FluidStack[] getFluids(){ - return new FluidStack[]{this.tank.getFluid()}; - } - - @Override - public void setFluids(FluidStack[] fluids){ - this.tank.setFluid(fluids[0]); + IFluidHandler handler = this.getFluidHandler(from); + if(handler instanceof IFluidTank){ + return new FluidTankInfo[]{((IFluidTank)handler).getInfo()}; + } + else{ + return null; + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java index ef75b1688..8a721f8eb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java @@ -1,19 +1,17 @@ /* - * This file ("TileEntityCoalGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityCoalGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntityFurnace; @@ -21,10 +19,10 @@ import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityCoalGenerator extends TileEntityInventoryBase implements IEnergyProvider, IEnergySaver{ +public class TileEntityCoalGenerator extends TileEntityInventoryBase implements IEnergyProvider{ public static final int PRODUCE = 30; - public EnergyStorage storage = new EnergyStorage(60000); + public final EnergyStorage storage = new EnergyStorage(60000); public int maxBurnTime; public int currentBurnTime; private int lastEnergy; @@ -46,26 +44,29 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("BurnTime", this.currentBurnTime); - compound.setInteger("MaxBurnTime", this.maxBurnTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("BurnTime", this.currentBurnTime); + compound.setInteger("MaxBurnTime", this.maxBurnTime); + } this.storage.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); + super.writeSyncableNBT(compound, type); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.currentBurnTime = compound.getInteger("BurnTime"); - this.maxBurnTime = compound.getInteger("MaxBurnTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + this.currentBurnTime = compound.getInteger("BurnTime"); + this.maxBurnTime = compound.getInteger("MaxBurnTime"); + } this.storage.readFromNBT(compound); - super.readSyncableNBT(compound, sync); + super.readSyncableNBT(compound, type); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ boolean flag = this.currentBurnTime > 0; if(this.currentBurnTime > 0){ @@ -84,21 +85,8 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements } } - if(this.storage.getEnergyStored() > 0){ - WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage); - } - if(flag != this.currentBurnTime > 0){ this.markDirty(); - int meta = PosUtil.getMetadata(this.getPos(), worldObj); - if(meta == 1){ - if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && this.storage.getEnergyStored() < this.storage.getMaxEnergyStored())){ - PosUtil.setMetadata(this.pos, worldObj, 0, 2); - } - } - else{ - PosUtil.setMetadata(this.pos, worldObj, 1, 2); - } } if((this.storage.getEnergyStored() != this.lastEnergy || this.currentBurnTime != this.lastCurrentBurnTime || this.lastBurnTime != this.maxBurnTime) && this.sendUpdateWithInterval()){ @@ -121,7 +109,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return false; + return TileEntityFurnace.getItemBurnTime(this.slots[0]) <= 0; } @Override @@ -143,14 +131,4 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements public boolean canConnectEnergy(EnumFacing from){ return true; } - - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java index 82652e39c..4d9962f43 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java @@ -1,47 +1,58 @@ /* - * This file ("TileEntityCoffeeMachine.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityCoffeeMachine.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.api.recipe.coffee.CoffeeIngredient; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; +import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidTankProperties; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements IButtonReactor, IEnergyReceiver, IFluidSaver, IFluidHandler, IEnergySaver{ +public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements IButtonReactor, IEnergyReceiver, net.minecraftforge.fluids.IFluidHandler{ public static final int SLOT_COFFEE_BEANS = 0; public static final int SLOT_INPUT = 1; public static final int SLOT_OUTPUT = 2; - public static final int SLOT_WATER_INPUT = 11; - public static final int SLOT_WATER_OUTPUT = 12; public static final int CACHE_USE = 15; public static final int ENERGY_USED = 150; public static final int WATER_USE = 500; public static final int COFFEE_CACHE_MAX_AMOUNT = 300; private static final int TIME_USED = 500; - public EnergyStorage storage = new EnergyStorage(300000); - public FluidTank tank = new FluidTank(4*FluidContainerRegistry.BUCKET_VOLUME); + public final EnergyStorage storage = new EnergyStorage(300000); + public final FluidTank tank = new FluidTank(4*Util.BUCKET){ + @Override + public boolean canDrain(){ + return false; + } + + @Override + public boolean canFillFluidType(FluidStack fluid){ + return fluid.getFluid() == FluidRegistry.WATER; + } + }; public int coffeeCacheAmount; public int brewTime; private int lastEnergy; @@ -50,7 +61,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements private int lastBrewTime; public TileEntityCoffeeMachine(){ - super(13, "coffeeMachine"); + super(11, "coffeeMachine"); } @SideOnly(Side.CLIENT) @@ -74,27 +85,31 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); this.tank.writeToNBT(compound); - compound.setInteger("Cache", this.coffeeCacheAmount); - compound.setInteger("Time", this.brewTime); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("Cache", this.coffeeCacheAmount); + compound.setInteger("Time", this.brewTime); + } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); this.tank.readFromNBT(compound); - this.coffeeCacheAmount = compound.getInteger("Cache"); - this.brewTime = compound.getInteger("Time"); + if(type != NBTType.SAVE_BLOCK){ + this.coffeeCacheAmount = compound.getInteger("Cache"); + this.brewTime = compound.getInteger("Time"); + } } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ this.storeCoffee(); if(this.brewTime > 0 || this.isRedstonePowered){ @@ -102,7 +117,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements } if((this.coffeeCacheAmount != this.lastCoffeeAmount || this.storage.getEnergyStored() != this.lastEnergy || this.tank.getFluidAmount() != this.lastTank || this.brewTime != this.lastBrewTime) && this.sendUpdateWithInterval()){ - this.lastCoffeeAmount = coffeeCacheAmount; + this.lastCoffeeAmount = this.coffeeCacheAmount; this.lastEnergy = this.storage.getEnergyStored(); this.lastTank = this.tank.getFluidAmount(); this.lastBrewTime = this.brewTime; @@ -112,7 +127,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i >= 3 && ItemCoffee.getIngredientFromStack(stack) != null) || (i == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (i == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal()) || (i == SLOT_WATER_INPUT && FluidContainerRegistry.containsFluid(stack, new FluidStack(FluidRegistry.WATER, 1))); + return (i >= 3 && ItemCoffee.getIngredientFromStack(stack) != null) || (i == SLOT_COFFEE_BEANS && stack.getItem() == InitItems.itemCoffeeBean) || (i == SLOT_INPUT && stack.getItem() == InitItems.itemMisc && stack.getItemDamage() == TheMiscItems.CUP.ordinal()); } public void storeCoffee(){ @@ -126,16 +141,14 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements this.coffeeCacheAmount += toAdd; } } - - WorldUtil.emptyBucket(tank, slots, SLOT_WATER_INPUT, SLOT_WATER_OUTPUT, FluidRegistry.WATER); } public void brew(){ - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(this.slots[SLOT_INPUT] != null && this.slots[SLOT_INPUT].getItem() == InitItems.itemMisc && this.slots[SLOT_INPUT].getItemDamage() == TheMiscItems.CUP.ordinal() && this.slots[SLOT_OUTPUT] == null && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid() != null && this.tank.getFluid().getFluid() == FluidRegistry.WATER && this.tank.getFluidAmount() >= WATER_USE){ if(this.storage.getEnergyStored() >= ENERGY_USED){ - if(this.brewTime%30 == 0 && !ConfigValues.lessSound){ - this.worldObj.playSoundEffect(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), ModUtil.MOD_ID_LOWER+":coffeeMachine", 0.35F, 1.0F); + if(this.brewTime%30 == 0 && !ConfigBoolValues.LESS_SOUND.isEnabled()){ + this.worldObj.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.coffeeMachine, SoundCategory.BLOCKS, 0.35F, 1.0F); } this.brewTime++; @@ -162,7 +175,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements this.slots[SLOT_INPUT] = null; } this.coffeeCacheAmount -= CACHE_USE; - this.tank.drain(WATER_USE, true); + this.tank.drainInternal(WATER_USE, true); } } } @@ -179,7 +192,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return slot == SLOT_OUTPUT || (slot >= 3 && slot < this.slots.length-2 && ItemCoffee.getIngredientFromStack(stack) == null) || slot == SLOT_WATER_OUTPUT; + return slot == SLOT_OUTPUT || (slot >= 3 && slot < this.slots.length-2 && ItemCoffee.getIngredientFromStack(stack) == null); } @Override @@ -209,53 +222,63 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements return true; } + @Override + public FluidTank getFluidHandler(EnumFacing facing){ + return facing != EnumFacing.DOWN ? this.tank : null; + } + @Override public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - return resource.getFluid() == FluidRegistry.WATER && from != EnumFacing.DOWN ? this.tank.fill(resource, doFill) : 0; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? 0 : handler.fill(resource, doFill); } @Override public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - return null; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(resource, doDrain); } @Override public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain){ - return null; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(maxDrain, doDrain); } @Override public boolean canFill(EnumFacing from, Fluid fluid){ - return true; + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canFillFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } + return false; } @Override public boolean canDrain(EnumFacing from, Fluid fluid){ + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canDrainFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } return false; } @Override public FluidTankInfo[] getTankInfo(EnumFacing from){ - return new FluidTankInfo[]{this.tank.getInfo()}; - } - - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - - @Override - public FluidStack[] getFluids(){ - return new FluidStack[]{this.tank.getFluid()}; - } - - @Override - public void setFluids(FluidStack[] fluids){ - this.tank.setFluid(fluids[0]); + IFluidHandler handler = this.getFluidHandler(from); + if(handler instanceof IFluidTank){ + return new FluidTankInfo[]{((IFluidTank)handler).getInfo()}; + } + else{ + return null; + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java index 6b31c5228..b309a9fd3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java @@ -1,36 +1,46 @@ /* - * This file ("TileEntityCompost.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityCompost.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.ItemFertilizer; -import de.ellpeck.actuallyadditions.mod.items.ItemMisc; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.api.recipe.CompostRecipe; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; public class TileEntityCompost extends TileEntityInventoryBase{ - public static final int AMOUNT = 10; public int conversionTime; public TileEntityCompost(){ super(1, "compost"); } + public static CompostRecipe getRecipeForInput(ItemStack input){ + if(input != null){ + for(CompostRecipe recipe : ActuallyAdditionsAPI.COMPOST_RECIPES){ + if(input.isItemEqual(recipe.input)){ + return recipe; + } + } + } + return null; + } + @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("ConversionTime", this.conversionTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("ConversionTime", this.conversionTime); + } } @Override @@ -39,37 +49,43 @@ public class TileEntityCompost extends TileEntityInventoryBase{ } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.conversionTime = compound.getInteger("ConversionTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.conversionTime = compound.getInteger("ConversionTime"); + } } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ boolean theFlag = this.conversionTime > 0; - if(this.slots[0] != null && !(this.slots[0].getItem() instanceof ItemFertilizer) && this.slots[0].stackSize >= AMOUNT){ - this.conversionTime++; - if(this.conversionTime >= 2000){ - this.slots[0] = new ItemStack(InitItems.itemFertilizer, AMOUNT); + + if(this.slots[0] != null){ + CompostRecipe recipe = getRecipeForInput(this.slots[0]); + if(recipe != null && this.slots[0].isItemEqual(recipe.input) && this.slots[0].stackSize >= recipe.input.stackSize){ + this.conversionTime++; + if(this.conversionTime >= 3000){ + this.slots[0] = recipe.output.copy(); + this.conversionTime = 0; + this.markDirty(); + } + } + else{ this.conversionTime = 0; } } + if(theFlag != this.conversionTime > 0){ this.markDirty(); } } } - @Override - public int getInventoryStackLimit(){ - return AMOUNT; - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return stack.getItem() instanceof ItemMisc && stack.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal(); + return getRecipeForInput(stack) != null; } @Override @@ -78,6 +94,17 @@ public class TileEntityCompost extends TileEntityInventoryBase{ this.sendUpdate(); } + @Override + public int getInventoryStackLimit(){ + if(this.slots[0] != null){ + CompostRecipe recipe = getRecipeForInput(this.slots[0]); + if(recipe != null && recipe.input != null){ + return recipe.input.stackSize; + } + } + return super.getInventoryStackLimit(); + } + @Override public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ return this.isItemValidForSlot(slot, stack); @@ -85,6 +112,6 @@ public class TileEntityCompost extends TileEntityInventoryBase{ @Override public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return stack.getItem() instanceof ItemFertilizer; + return getRecipeForInput(stack) == null; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java index ebd6d63f2..d95cf68aa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java @@ -1,75 +1,77 @@ /* - * This file ("TileEntityDirectionalBreaker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityDirectionalBreaker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockAir; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.ArrayList; +import java.util.List; -public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implements IEnergyReceiver, IEnergySaver, IRedstoneToggle{ +public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implements IEnergyReceiver{ public static final int RANGE = 8; public static final int ENERGY_USE = 5; - public EnergyStorage storage = new EnergyStorage(10000); + public final EnergyStorage storage = new EnergyStorage(10000); private int lastEnergy; private int currentTime; - private boolean activateOnceWithSignal; public TileEntityDirectionalBreaker(){ super(9, "directionalBreaker"); } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); - compound.setInteger("CurrentTime", this.currentTime); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("CurrentTime", this.currentTime); + } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); - this.currentTime = compound.getInteger("CurrentTime"); + if(type != NBTType.SAVE_BLOCK){ + this.currentTime = compound.getInteger("CurrentTime"); + } } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - if(!this.isRedstonePowered && !this.activateOnceWithSignal){ - if(this.storage.getEnergyStored() >= ENERGY_USE*RANGE){ - if(this.currentTime > 0){ - this.currentTime--; - if(this.currentTime <= 0){ - this.doWork(); - } - } - else{ - this.currentTime = 15; + if(!this.worldObj.isRemote){ + if(!this.isRedstonePowered && !this.isPulseMode){ + if(this.currentTime > 0){ + this.currentTime--; + if(this.currentTime <= 0){ + this.doWork(); } } + else{ + this.currentTime = 15; + } } if(this.storage.getEnergyStored() != this.lastEnergy && this.sendUpdateWithInterval()){ @@ -79,24 +81,27 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem } private void doWork(){ - EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj)); + if(this.storage.getEnergyStored() >= ENERGY_USE*RANGE){ + IBlockState state = this.worldObj.getBlockState(this.pos); + EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)); - for(int i = 0; i < RANGE; i++){ - BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, pos, i); - if(coordsBlock != null){ - Block blockToBreak = PosUtil.getBlock(coordsBlock, worldObj); - if(blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(worldObj, pos) > -1.0F){ - ArrayList drops = new ArrayList(); - drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock, worldObj.getBlockState(coordsBlock), 0)); + for(int i = 0; i < RANGE; i++){ + BlockPos coordsBlock = this.pos.offset(sideToManipulate, i); + Block blockToBreak = this.worldObj.getBlockState(coordsBlock).getBlock(); + if(blockToBreak != null && !(blockToBreak instanceof BlockAir) && blockToBreak.getBlockHardness(this.worldObj.getBlockState(coordsBlock), this.worldObj, this.pos) > -1.0F){ + List drops = blockToBreak.getDrops(this.worldObj, coordsBlock, this.worldObj.getBlockState(coordsBlock), 0); + float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.worldObj, coordsBlock, this.worldObj.getBlockState(coordsBlock), 0, 1, false, null); - if(WorldUtil.addToInventory(this, drops, false, true)){ - if(!ConfigValues.lessBlockBreakingEffects){ - worldObj.playAuxSFX(2001, coordsBlock, Block.getStateId(worldObj.getBlockState(coordsBlock))); + if(Util.RANDOM.nextFloat() <= chance){ + if(WorldUtil.addToInventory(this, drops, false, true)){ + if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ + this.worldObj.playEvent(2001, coordsBlock, Block.getStateId(this.worldObj.getBlockState(coordsBlock))); + } + this.worldObj.setBlockToAir(coordsBlock); + WorldUtil.addToInventory(this, drops, true, true); + this.storage.extractEnergy(ENERGY_USE, false); + this.markDirty(); } - WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.getPos(), i); - WorldUtil.addToInventory(this, drops, true, true); - this.storage.extractEnergy(ENERGY_USE, false); - this.markDirty(); } } } @@ -143,24 +148,10 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem return true; } - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - - @Override - public void toggle(boolean to){ - this.activateOnceWithSignal = to; - } - - @Override - public boolean isPulseMode(){ - return this.activateOnceWithSignal; + public boolean isRedstoneToggle(){ + return true; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java new file mode 100644 index 000000000..b183faa55 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java @@ -0,0 +1,145 @@ +/* + * This file ("TileEntityDisplayStand.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import cofh.api.energy.EnergyStorage; +import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; + +public class TileEntityDisplayStand extends TileEntityInventoryBase implements IEnergyDisplay, IEnergyReceiver{ + + private final EnergyStorage storage = new EnergyStorage(300000); + private int oldEnergy; + + public TileEntityDisplayStand(){ + super(1, "displayStand"); + } + + @Override + public void updateEntity(){ + super.updateEntity(); + + if(!this.worldObj.isRemote){ + if(this.slots[0] != null && !this.isRedstonePowered){ + IDisplayStandItem item = this.convertToDisplayStandItem(this.slots[0].getItem()); + if(item != null){ + int energy = item.getUsePerTick(this.slots[0], this, this.ticksElapsed); + if(this.storage.getEnergyStored() >= energy){ + if(item.update(this.slots[0], this, this.ticksElapsed)){ + this.storage.extractEnergy(energy, false); + } + } + } + } + + if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ + this.oldEnergy = this.storage.getEnergyStored(); + } + } + } + + @Override + public boolean shouldSyncSlots(){ + return true; + } + + @Override + public void markDirty(){ + super.markDirty(); + this.sendUpdate(); + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack){ + return true; + } + + @Override + public boolean canInsertItem(int index, ItemStack stack, EnumFacing direction){ + return this.isItemValidForSlot(index, stack); + } + + @Override + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + this.storage.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + this.storage.readFromNBT(compound); + } + + private IDisplayStandItem convertToDisplayStandItem(Item item){ + if(item instanceof IDisplayStandItem){ + return (IDisplayStandItem)item; + } + else if(item instanceof ItemBlock){ + Block block = Block.getBlockFromItem(item); + if(block instanceof IDisplayStandItem){ + return (IDisplayStandItem)block; + } + } + return null; + } + + @Override + public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction){ + return true; + } + + @Override + public int getEnergy(){ + return this.storage.getEnergyStored(); + } + + @Override + public int getMaxEnergy(){ + return this.storage.getMaxEnergyStored(); + } + + @Override + public boolean needsHoldShift(){ + return true; + } + + @Override + public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ + return from != EnumFacing.UP ? this.storage.receiveEnergy(maxReceive, simulate) : 0; + } + + @Override + public int getEnergyStored(EnumFacing from){ + return from != EnumFacing.UP ? this.storage.getEnergyStored() : 0; + } + + @Override + public int getMaxEnergyStored(EnumFacing from){ + return from != EnumFacing.UP ? this.storage.getMaxEnergyStored() : 0; + } + + @Override + public boolean canConnectEnergy(EnumFacing from){ + return from != EnumFacing.UP; + } + + @Override + public int getInventoryStackLimit(){ + return 1; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java index 60a4982b0..b84b51dbe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java @@ -1,48 +1,50 @@ /* - * This file ("TileEntityDropper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityDropper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; -public class TileEntityDropper extends TileEntityInventoryBase implements IRedstoneToggle{ +public class TileEntityDropper extends TileEntityInventoryBase{ private int currentTime; - private boolean activateOnceWithSignal; public TileEntityDropper(){ super(9, "dropper"); } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("CurrentTime", this.currentTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("CurrentTime", this.currentTime); + } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTime = compound.getInteger("CurrentTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.currentTime = compound.getInteger("CurrentTime"); + } } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - if(!this.isRedstonePowered && !this.activateOnceWithSignal){ + if(!this.worldObj.isRemote){ + if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; if(this.currentTime <= 0){ @@ -65,7 +67,8 @@ public class TileEntityDropper extends TileEntityInventoryBase implements IRedst if(this.removeFromInventory(false) != null){ ItemStack stack = this.removeFromInventory(true); stack.stackSize = 1; - WorldUtil.dropItemAtSide(WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj)), worldObj, this.pos, stack); + IBlockState state = this.worldObj.getBlockState(this.pos); + WorldUtil.dropItemAtSide(WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)), this.worldObj, this.pos, stack); } } @@ -96,13 +99,8 @@ public class TileEntityDropper extends TileEntityInventoryBase implements IRedst } @Override - public void toggle(boolean to){ - this.activateOnceWithSignal = to; - } - - @Override - public boolean isPulseMode(){ - return this.activateOnceWithSignal; + public boolean isRedstoneToggle(){ + return true; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java index 33131aeb2..aec10a9e7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityEnergizer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityEnergizer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -19,9 +19,9 @@ import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityEnergizer extends TileEntityInventoryBase implements IEnergyReceiver, IEnergySaver{ +public class TileEntityEnergizer extends TileEntityInventoryBase implements IEnergyReceiver{ - public EnergyStorage storage = new EnergyStorage(500000); + public final EnergyStorage storage = new EnergyStorage(500000); private int lastEnergy; public TileEntityEnergizer(){ @@ -29,21 +29,21 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ this.storage.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); + super.writeSyncableNBT(compound, type); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ this.storage.readFromNBT(compound); - super.readSyncableNBT(compound, sync); + super.readSyncableNBT(compound, type); } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){ if(this.storage.getEnergyStored() > 0){ int received = ((IEnergyContainerItem)this.slots[0].getItem()).receiveEnergy(this.slots[0], this.storage.getEnergyStored(), false); @@ -59,7 +59,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne } } - if(lastEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ + if(this.lastEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ this.lastEnergy = this.storage.getEnergyStored(); } } @@ -104,14 +104,4 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne public boolean canConnectEnergy(EnumFacing from){ return true; } - - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java index 2d9f66303..526c968f4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityEnervator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityEnervator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -13,16 +13,15 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyContainerItem; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityEnervator extends TileEntityInventoryBase implements IEnergyProvider, IEnergySaver{ +public class TileEntityEnervator extends TileEntityInventoryBase implements IEnergyProvider{ - public EnergyStorage storage = new EnergyStorage(500000); + public final EnergyStorage storage = new EnergyStorage(500000); private int lastEnergy; public TileEntityEnervator(){ @@ -30,21 +29,21 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ this.storage.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); + super.writeSyncableNBT(compound, type); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ this.storage.readFromNBT(compound); - super.readSyncableNBT(compound, sync); + super.readSyncableNBT(compound, type); } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(this.slots[0] != null && this.slots[0].getItem() instanceof IEnergyContainerItem && this.slots[1] == null){ if(((IEnergyContainerItem)this.slots[0].getItem()).getEnergyStored(this.slots[0]) > 0){ int toReceive = ((IEnergyContainerItem)this.slots[0].getItem()).extractEnergy(this.slots[0], this.storage.getMaxEnergyStored()-this.storage.getEnergyStored(), false); @@ -60,11 +59,7 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne } } - if(this.storage.getEnergyStored() > 0){ - WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage); - } - - if(lastEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ + if(this.lastEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ this.lastEnergy = this.storage.getEnergyStored(); } } @@ -109,14 +104,4 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == 1; } - - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java index 3b42009d9..59c47d9ae 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityFeeder.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityFeeder.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -14,9 +14,9 @@ import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -41,31 +41,30 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); compound.setInteger("Timer", this.currentTimer); - if(sync){ + if(type == NBTType.SYNC){ compound.setInteger("Animals", this.currentAnimalAmount); } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.currentTimer = compound.getInteger("Timer"); - if(sync){ + if(type == NBTType.SYNC){ this.currentAnimalAmount = compound.getInteger("Animals"); } } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ boolean theFlag = this.currentTimer > 0; int range = 5; - List animals = worldObj.getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.fromBounds(this.pos.getX()-range, this.pos.getY()-range, this.pos.getZ()-range, this.pos.getX()+range, this.pos.getY()+range, this.pos.getZ()+range)); + List animals = this.worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(this.pos.getX()-range, this.pos.getY()-range, this.pos.getZ()-range, this.pos.getX()+range, this.pos.getY()+range, this.pos.getZ()+range)); if(animals != null){ this.currentAnimalAmount = animals.size(); if(this.currentAnimalAmount >= 2){ @@ -120,7 +119,7 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ double d = Util.RANDOM.nextGaussian()*0.02D; double d1 = Util.RANDOM.nextGaussian()*0.02D; double d2 = Util.RANDOM.nextGaussian()*0.02D; - worldObj.spawnParticle(EnumParticleTypes.HEART, (animal.posX+(double)(Util.RANDOM.nextFloat()*animal.width*2.0F))-animal.width, animal.posY+0.5D+(double)(Util.RANDOM.nextFloat()*animal.height), (animal.posZ+(double)(Util.RANDOM.nextFloat()*animal.width*2.0F))-animal.width, d, d1, d2); + this.worldObj.spawnParticle(EnumParticleTypes.HEART, (animal.posX+(double)(Util.RANDOM.nextFloat()*animal.width*2.0F))-animal.width, animal.posY+0.5D+(double)(Util.RANDOM.nextFloat()*animal.height), (animal.posZ+(double)(Util.RANDOM.nextFloat()*animal.width*2.0F))-animal.width, d, d1, d2); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java index 4bfb1694f..490690db6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java @@ -1,70 +1,85 @@ /* - * This file ("TileEntityFermentingBarrel.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityFermentingBarrel.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; +import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidTankProperties; +import net.minecraftforge.fluids.capability.templates.FluidHandlerFluidMap; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityFermentingBarrel extends TileEntityInventoryBase implements IFluidHandler, IFluidSaver{ +public class TileEntityFermentingBarrel extends TileEntityBase implements net.minecraftforge.fluids.IFluidHandler{ private static final int PROCESS_TIME = 100; - public FluidTank canolaTank = new FluidTank(2*FluidContainerRegistry.BUCKET_VOLUME); - public FluidTank oilTank = new FluidTank(2*FluidContainerRegistry.BUCKET_VOLUME); + public final FluidTank canolaTank = new FluidTank(2*Util.BUCKET){ + @Override + public boolean canDrain(){ + return false; + } + + @Override + public boolean canFillFluidType(FluidStack fluid){ + return fluid.getFluid() == InitFluids.fluidCanolaOil; + } + }; + public final FluidTank oilTank = new FluidTank(2*Util.BUCKET){ + @Override + public boolean canFill(){ + return false; + } + }; public int currentProcessTime; private int lastCanola; private int lastOil; private int lastProcessTime; public TileEntityFermentingBarrel(){ - super(4, "fermentingBarrel"); + super("fermentingBarrel"); } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ compound.setInteger("ProcessTime", this.currentProcessTime); this.canolaTank.writeToNBT(compound); NBTTagCompound tag = new NBTTagCompound(); this.oilTank.writeToNBT(tag); compound.setTag("OilTank", tag); - super.writeSyncableNBT(compound, sync); + super.writeSyncableNBT(compound, type); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ this.currentProcessTime = compound.getInteger("ProcessTime"); this.canolaTank.readFromNBT(compound); this.oilTank.readFromNBT((NBTTagCompound)compound.getTag("OilTank")); - super.readSyncableNBT(compound, sync); + super.readSyncableNBT(compound, type); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ int produce = 80; if(this.canolaTank.getFluidAmount() >= produce && produce <= this.oilTank.getCapacity()-this.oilTank.getFluidAmount()){ this.currentProcessTime++; if(this.currentProcessTime >= PROCESS_TIME){ this.currentProcessTime = 0; - this.oilTank.fill(new FluidStack(InitFluids.fluidOil, produce), true); - this.canolaTank.drain(produce, true); + this.oilTank.fillInternal(new FluidStack(InitFluids.fluidOil, produce), true); + this.canolaTank.drainInternal(produce, true); this.markDirty(); } } @@ -72,19 +87,6 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen this.currentProcessTime = 0; } - WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitFluids.fluidCanolaOil); - WorldUtil.fillBucket(oilTank, slots, 2, 3); - - if(this.oilTank.getFluidAmount() > 0){ - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.DOWN, this.oilTank); - if(!this.isRedstonePowered){ - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.NORTH, this.oilTank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.EAST, this.oilTank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.SOUTH, this.oilTank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.WEST, this.oilTank); - } - } - if((this.canolaTank.getFluidAmount() != this.lastCanola || this.oilTank.getFluidAmount() != this.lastOil || this.currentProcessTime != this.lastProcessTime) && this.sendUpdateWithInterval()){ this.lastProcessTime = this.currentProcessTime; this.lastCanola = this.canolaTank.getFluidAmount(); @@ -93,11 +95,6 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen } } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return (i == 0 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidCanolaOil, FluidContainerRegistry.BUCKET_VOLUME))) || (i == 2 && stack.getItem() == Items.bucket); - } - @SideOnly(Side.CLIENT) public int getProcessScaled(int i){ return this.currentProcessTime*i/PROCESS_TIME; @@ -114,59 +111,69 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen } @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); - } - - @Override - public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return (slot == 1 && stack.getItem() == Items.bucket) || (slot == 3 && FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME))); + public IFluidHandler getFluidHandler(EnumFacing facing){ + FluidHandlerFluidMap map = new FluidHandlerFluidMap(); + if(facing != EnumFacing.DOWN){ + map.addHandler(InitFluids.fluidCanolaOil, this.canolaTank); + } + if(facing != EnumFacing.UP){ + map.addHandler(InitFluids.fluidOil, this.oilTank); + } + return map; } @Override public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - if(from != EnumFacing.DOWN && resource.getFluid() == InitFluids.fluidCanolaOil){ - return this.canolaTank.fill(resource, doFill); - } - return 0; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? 0 : handler.fill(resource, doFill); } @Override public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - if(resource.getFluid() == InitFluids.fluidOil){ - return this.oilTank.drain(resource.amount, doDrain); - } - return null; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(resource, doDrain); } @Override public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain){ - return this.oilTank.drain(maxDrain, doDrain); + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(maxDrain, doDrain); } @Override public boolean canFill(EnumFacing from, Fluid fluid){ - return from != EnumFacing.DOWN && fluid == InitFluids.fluidCanolaOil; + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canFillFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } + return false; } @Override public boolean canDrain(EnumFacing from, Fluid fluid){ - return from != EnumFacing.UP && fluid == InitFluids.fluidOil; + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canDrainFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } + return false; } @Override public FluidTankInfo[] getTankInfo(EnumFacing from){ - return new FluidTankInfo[]{this.canolaTank.getInfo(), this.oilTank.getInfo()}; - } - - @Override - public FluidStack[] getFluids(){ - return new FluidStack[]{this.oilTank.getFluid(), this.canolaTank.getFluid()}; - } - - @Override - public void setFluids(FluidStack[] fluids){ - this.oilTank.setFluid(fluids[0]); - this.canolaTank.setFluid(fluids[1]); + IFluidHandler handler = this.getFluidHandler(from); + if(handler instanceof IFluidTank){ + return new FluidTankInfo[]{((IFluidTank)handler).getInfo()}; + } + else{ + return null; + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java index 57707f626..99debbc3d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityFireworkBox.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityFireworkBox.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -20,34 +20,94 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.EnumFacing; -import net.minecraft.util.MathHelper; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityFireworkBox extends TileEntityBase implements IEnergyReceiver, IRedstoneToggle, IEnergyDisplay, IEnergySaver{ +public class TileEntityFireworkBox extends TileEntityBase implements IEnergyReceiver, IEnergyDisplay{ public static final int USE_PER_SHOT = 300; - public EnergyStorage storage = new EnergyStorage(20000); + public final EnergyStorage storage = new EnergyStorage(20000); private int timeUntilNextFirework; - private boolean activateOnceWithSignal; private int oldEnergy; + public TileEntityFireworkBox(){ + super("fireworkBox"); + } + + public static void spawnFireworks(World world, double x, double y, double z){ + int range = 4; + int amount = Util.RANDOM.nextInt(5)+1; + for(int i = 0; i < amount; i++){ + ItemStack firework = makeFirework(); + + double newX = x+MathHelper.getRandomDoubleInRange(Util.RANDOM, 0, range*2)-range; + double newZ = z+MathHelper.getRandomDoubleInRange(Util.RANDOM, 0, range*2)-range; + EntityFireworkRocket rocket = new EntityFireworkRocket(world, newX, y+0.5, newZ, firework); + world.spawnEntityInWorld(rocket); + } + } + + private static ItemStack makeFirework(){ + NBTTagList list = new NBTTagList(); + int chargesAmount = Util.RANDOM.nextInt(2)+1; + for(int i = 0; i < chargesAmount; i++){ + list.appendTag(makeFireworkCharge()); + } + + NBTTagCompound compound1 = new NBTTagCompound(); + compound1.setTag("Explosions", list); + compound1.setByte("Flight", (byte)(Util.RANDOM.nextInt(3)+1)); + + NBTTagCompound compound = new NBTTagCompound(); + compound.setTag("Fireworks", compound1); + + ItemStack firework = new ItemStack(Items.FIREWORKS); + firework.setTagCompound(compound); + + return firework; + } + + private static NBTTagCompound makeFireworkCharge(){ + NBTTagCompound compound = new NBTTagCompound(); + + if(Util.RANDOM.nextFloat() >= 0.65F){ + if(Util.RANDOM.nextFloat() >= 0.5F){ + compound.setBoolean("Flicker", true); + } + else{ + compound.setBoolean("Trail", true); + } + } + + int[] colors = new int[MathHelper.getRandomIntegerInRange(Util.RANDOM, 1, 6)]; + for(int i = 0; i < colors.length; i++){ + colors[i] = ItemDye.DYE_COLORS[Util.RANDOM.nextInt(ItemDye.DYE_COLORS.length)]; + } + compound.setIntArray("Colors", colors); + + compound.setByte("Type", (byte)Util.RANDOM.nextInt(5)); + + return compound; + } + @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); } @Override public void updateEntity(){ if(!this.worldObj.isRemote){ - if(!this.isRedstonePowered && !this.activateOnceWithSignal){ + if(!this.isRedstonePowered && !this.isPulseMode){ if(this.timeUntilNextFirework > 0){ this.timeUntilNextFirework--; if(this.timeUntilNextFirework <= 0){ @@ -67,64 +127,12 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece private void doWork(){ if(this.storage.getEnergyStored() >= USE_PER_SHOT){ - int range = 4; - int amount = Util.RANDOM.nextInt(5)+1; - for(int i = 0; i < amount; i++){ - ItemStack firework = this.makeFirework(); - - double x = this.pos.getX()+MathHelper.getRandomDoubleInRange(Util.RANDOM, 0, range*2)-range; - double z = this.pos.getZ()+MathHelper.getRandomDoubleInRange(Util.RANDOM, 0, range*2)-range; - EntityFireworkRocket rocket = new EntityFireworkRocket(this.worldObj, x, this.pos.getY()+0.5, z, firework); - this.worldObj.spawnEntityInWorld(rocket); - } + spawnFireworks(this.worldObj, this.pos.getX(), this.pos.getY(), this.pos.getZ()); this.storage.extractEnergy(USE_PER_SHOT, false); } } - private ItemStack makeFirework(){ - NBTTagList list = new NBTTagList(); - int chargesAmount = Util.RANDOM.nextInt(2)+1; - for(int i = 0; i < chargesAmount; i++){ - list.appendTag(this.makeFireworkCharge()); - } - - NBTTagCompound compound1 = new NBTTagCompound(); - compound1.setTag("Explosions", list); - compound1.setByte("Flight", (byte)(Util.RANDOM.nextInt(3)+1)); - - NBTTagCompound compound = new NBTTagCompound(); - compound.setTag("Fireworks", compound1); - - ItemStack firework = new ItemStack(Items.fireworks); - firework.setTagCompound(compound); - - return firework; - } - - private NBTTagCompound makeFireworkCharge(){ - NBTTagCompound compound = new NBTTagCompound(); - - if(Util.RANDOM.nextFloat() >= 0.65F){ - if(Util.RANDOM.nextFloat() >= 0.5F){ - compound.setBoolean("Flicker", true); - } - else{ - compound.setBoolean("Trail", true); - } - } - - int[] colors = new int[MathHelper.getRandomIntegerInRange(Util.RANDOM, 1, 6)]; - for(int i = 0; i < colors.length; i++){ - colors[i] = ItemDye.dyeColors[Util.RANDOM.nextInt(ItemDye.dyeColors.length)]; - } - compound.setIntArray("Colors", colors); - - compound.setByte("Type", (byte)Util.RANDOM.nextInt(5)); - - return compound; - } - @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.storage.receiveEnergy(maxReceive, simulate); @@ -146,13 +154,8 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece } @Override - public void toggle(boolean to){ - this.activateOnceWithSignal = to; - } - - @Override - public boolean isPulseMode(){ - return this.activateOnceWithSignal; + public boolean isRedstoneToggle(){ + return true; } @Override @@ -165,14 +168,14 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyRece return this.storage.getEnergyStored(); } - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - @Override @SideOnly(Side.CLIENT) public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java index e8cbcec01..53b876796 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java @@ -1,66 +1,79 @@ /* - * This file ("TileEntityFishingNet.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityFishingNet.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; - -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.FishingHooks; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.loot.LootContext; +import net.minecraft.world.storage.loot.LootTableList; import java.util.ArrayList; +import java.util.List; public class TileEntityFishingNet extends TileEntityBase{ public int timeUntilNextDrop; - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("TimeUntilNextDrop", this.timeUntilNextDrop); + public TileEntityFishingNet(){ + super("fishingNet"); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.timeUntilNextDrop = compound.getInteger("TimeUntilNextDrop"); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("TimeUntilNextDrop", this.timeUntilNextDrop); + } + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.timeUntilNextDrop = compound.getInteger("TimeUntilNextDrop"); + } } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(!this.isRedstonePowered){ - if(PosUtil.getMaterial(PosUtil.offset(this.pos, 0, -1, 0), this.worldObj) == Material.water){ + if(this.worldObj.getBlockState(this.pos.down()).getMaterial() == Material.WATER){ if(this.timeUntilNextDrop > 0){ this.timeUntilNextDrop--; - if(timeUntilNextDrop <= 0){ - ItemStack fishable = FishingHooks.getRandomFishable(Util.RANDOM, Util.RANDOM.nextFloat()); - TileEntity tile = worldObj.getTileEntity(PosUtil.offset(pos, 0, 1, 0)); - if(tile != null && tile instanceof IInventory){ - ArrayList list = new ArrayList(); - list.add(fishable); - WorldUtil.addToInventory((IInventory)tile, list, EnumFacing.DOWN, true, false); - } - else{ - EntityItem item = new EntityItem(worldObj, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, fishable); - item.lifespan = 2000; - worldObj.spawnEntityInWorld(item); + if(this.timeUntilNextDrop <= 0){ + LootContext.Builder builder = new LootContext.Builder((WorldServer)this.worldObj); + List fishables = this.worldObj.getLootTableManager().getLootTableFromLocation(LootTableList.GAMEPLAY_FISHING).generateLootForPools(Util.RANDOM, builder.build()); + for(ItemStack fishable : fishables){ + TileEntity tile = this.worldObj.getTileEntity(this.pos.up()); + if(tile != null && tile instanceof IInventory){ + ArrayList list = new ArrayList(); + list.add(fishable); + WorldUtil.addToInventory((IInventory)tile, list, EnumFacing.DOWN, true, false); + } + else{ + EntityItem item = new EntityItem(this.worldObj, this.pos.getX()+0.5, this.pos.getY()+0.5, this.pos.getZ()+0.5, fishable); + item.lifespan = 2000; + this.worldObj.spawnEntityInWorld(item); + } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java index ca810aac3..4dadcf292 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java @@ -1,53 +1,59 @@ /* - * This file ("TileEntityFluidCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityFluidCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; - -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidTankProperties; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityFluidCollector extends TileEntityInventoryBase implements IFluidHandler, IFluidSaver, IRedstoneToggle{ +public class TileEntityFluidCollector extends TileEntityBase implements net.minecraftforge.fluids.IFluidHandler{ - public FluidTank tank = new FluidTank(8*FluidContainerRegistry.BUCKET_VOLUME); + public final FluidTank tank = new FluidTank(8*Util.BUCKET){ + @Override + public boolean canFill(){ + return TileEntityFluidCollector.this.isPlacer; + } + + @Override + public boolean canDrain(){ + return !TileEntityFluidCollector.this.isPlacer; + } + }; public boolean isPlacer; private int lastTankAmount; private int currentTime; - private boolean activateOnceWithSignal; - public TileEntityFluidCollector(int slots, String name){ - super(slots, name); + public TileEntityFluidCollector(String name){ + super(name); } public TileEntityFluidCollector(){ - super(2, "fluidCollector"); + this("fluidCollector"); this.isPlacer = false; } @Override - public void toggle(boolean to){ - this.activateOnceWithSignal = to; - } - - @Override - public boolean isPulseMode(){ - return this.activateOnceWithSignal; + public boolean isRedstoneToggle(){ + return true; } @Override @@ -56,36 +62,42 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements } private void doWork(){ - EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(PosUtil.getMetadata(this.pos, worldObj)); - BlockPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, this.pos, 0); + IBlockState state = this.worldObj.getBlockState(this.pos); + Block block = state.getBlock(); + EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(block.getMetaFromState(state)); + BlockPos coordsBlock = this.pos.offset(sideToManipulate, 0); - if(coordsBlock != null){ - Block blockToBreak = PosUtil.getBlock(coordsBlock, worldObj); - if(!this.isPlacer && blockToBreak != null && PosUtil.getMetadata(coordsBlock, worldObj) == 0 && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount()){ - if(blockToBreak instanceof IFluidBlock && ((IFluidBlock)blockToBreak).getFluid() != null){ - if(this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){ - this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), true); - WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos); - } - } - else if(blockToBreak == Blocks.lava || blockToBreak == Blocks.flowing_lava){ - if(this.tank.fill(new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){ - this.tank.fill(new FluidStack(FluidRegistry.LAVA, FluidContainerRegistry.BUCKET_VOLUME), true); - WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos); - } - } - else if(blockToBreak == Blocks.water || blockToBreak == Blocks.flowing_water){ - if(this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){ - this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), true); - WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, this.pos); - } + IBlockState stateToBreak = this.worldObj.getBlockState(coordsBlock); + Block blockToBreak = stateToBreak.getBlock(); + if(!this.isPlacer && blockToBreak != null && blockToBreak.getMetaFromState(stateToBreak) == 0 && Util.BUCKET <= this.tank.getCapacity()-this.tank.getFluidAmount()){ + if(blockToBreak instanceof IFluidBlock && ((IFluidBlock)blockToBreak).getFluid() != null){ + if(this.tank.fillInternal(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), Util.BUCKET), false) >= Util.BUCKET){ + this.tank.fillInternal(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), Util.BUCKET), true); + this.worldObj.setBlockToAir(coordsBlock); } } - else if(this.isPlacer && PosUtil.getBlock(coordsBlock, worldObj).isReplaceable(worldObj, coordsBlock)){ - if(this.tank.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME){ - if(this.tank.getFluid().getFluid().getBlock() != null){ - WorldUtil.useItemAtSide(sideToManipulate, worldObj, this.pos, new ItemStack(this.tank.getFluid().getFluid().getBlock())); - this.tank.drain(FluidContainerRegistry.BUCKET_VOLUME, true); + else if(blockToBreak == Blocks.LAVA || blockToBreak == Blocks.FLOWING_LAVA){ + if(this.tank.fillInternal(new FluidStack(FluidRegistry.LAVA, Util.BUCKET), false) >= Util.BUCKET){ + this.tank.fillInternal(new FluidStack(FluidRegistry.LAVA, Util.BUCKET), true); + this.worldObj.setBlockToAir(coordsBlock); + } + } + else if(blockToBreak == Blocks.WATER || blockToBreak == Blocks.FLOWING_WATER){ + if(this.tank.fillInternal(new FluidStack(FluidRegistry.WATER, Util.BUCKET), false) >= Util.BUCKET){ + this.tank.fillInternal(new FluidStack(FluidRegistry.WATER, Util.BUCKET), true); + this.worldObj.setBlockToAir(coordsBlock); + } + } + } + else if(this.isPlacer && blockToBreak.isReplaceable(this.worldObj, coordsBlock)){ + if(this.tank.getFluidAmount() >= Util.BUCKET){ + Block fluid = this.tank.getFluid().getFluid().getBlock(); + if(fluid != null){ + BlockPos offsetPos = this.pos.offset(sideToManipulate); + boolean placeable = !(blockToBreak instanceof BlockLiquid) && !(blockToBreak instanceof IFluidBlock) && blockToBreak.isReplaceable(this.worldObj, offsetPos); + if(placeable){ + this.worldObj.setBlockState(offsetPos, fluid.getDefaultState(), 3); + this.tank.drainInternal(Util.BUCKET, true); } } } @@ -93,64 +105,33 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements } @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - if(this.isPlacer){ - return this.tank.fill(resource, doFill); + public IFluidHandler getFluidHandler(EnumFacing facing){ + return this.tank; + } + + @Override + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("CurrentTime", this.currentTime); } - return 0; - } - - @Override - public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - if(!this.isPlacer){ - return this.tank.drain(resource.amount, doDrain); - } - return null; - } - - @Override - public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain){ - if(!this.isPlacer){ - return this.tank.drain(maxDrain, doDrain); - } - return null; - } - - @Override - public boolean canFill(EnumFacing from, Fluid fluid){ - return this.isPlacer; - } - - @Override - public boolean canDrain(EnumFacing from, Fluid fluid){ - return !this.isPlacer; - } - - @Override - public FluidTankInfo[] getTankInfo(EnumFacing from){ - return new FluidTankInfo[]{this.tank.getInfo()}; - } - - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("CurrentTime", this.currentTime); this.tank.writeToNBT(compound); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.currentTime = compound.getInteger("CurrentTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.currentTime = compound.getInteger("CurrentTime"); + } this.tank.readFromNBT(compound); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - if(!this.isRedstonePowered && !this.activateOnceWithSignal){ + if(!this.worldObj.isRemote){ + if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; if(this.currentTime <= 0){ @@ -162,74 +143,69 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements } } - if(!this.isPlacer){ - WorldUtil.fillBucket(tank, slots, 0, 1); - } - else{ - WorldUtil.emptyBucket(tank, slots, 0, 1); - } - - if(!this.isPlacer && this.tank.getFluidAmount() > 0){ - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.DOWN, this.tank); - if(!this.isRedstonePowered){ - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.NORTH, this.tank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.EAST, this.tank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.SOUTH, this.tank); - WorldUtil.pushFluid(worldObj, this.pos, EnumFacing.WEST, this.tank); - } - } - - if(lastTankAmount != this.tank.getFluidAmount() && this.sendUpdateWithInterval()){ - lastTankAmount = this.tank.getFluidAmount(); + if(this.lastTankAmount != this.tank.getFluidAmount() && this.sendUpdateWithInterval()){ + this.lastTankAmount = this.tank.getFluidAmount(); } } } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - if(i == 0){ - if(this.isPlacer){ - return FluidContainerRegistry.isFilledContainer(stack); - } - else{ - return stack.isItemEqual(FluidContainerRegistry.EMPTY_BUCKET); - } - } - return false; - } - @SideOnly(Side.CLIENT) public int getTankScaled(int i){ return this.tank.getFluidAmount()*i/this.tank.getCapacity(); } @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); + public int fill(EnumFacing from, FluidStack resource, boolean doFill){ + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? 0 : handler.fill(resource, doFill); } @Override - public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return slot == 1; + public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(resource, doDrain); } @Override - public FluidStack[] getFluids(){ - return new FluidStack[]{this.tank.getFluid()}; + public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain){ + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(maxDrain, doDrain); } @Override - public void setFluids(FluidStack[] fluids){ - this.tank.setFluid(fluids[0]); - } - - public static class TileEntityFluidPlacer extends TileEntityFluidCollector{ - - public TileEntityFluidPlacer(){ - super(2, "fluidPlacer"); - this.isPlacer = true; + public boolean canFill(EnumFacing from, Fluid fluid){ + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canFillFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } } - + return false; } + @Override + public boolean canDrain(EnumFacing from, Fluid fluid){ + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canDrainFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } + return false; + } + + @Override + public FluidTankInfo[] getTankInfo(EnumFacing from){ + IFluidHandler handler = this.getFluidHandler(from); + if(handler instanceof IFluidTank){ + return new FluidTankInfo[]{((IFluidTank)handler).getInfo()}; + } + else{ + return null; + } + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidPlacer.java new file mode 100644 index 000000000..de7bc752d --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidPlacer.java @@ -0,0 +1,20 @@ +/* + * This file ("TileEntityFluidPlacer.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +public class TileEntityFluidPlacer extends TileEntityFluidCollector{ + + public TileEntityFluidPlacer(){ + super("fluidPlacer"); + this.isPlacer = true; + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java index 3be5c827d..dbac070c3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java @@ -1,18 +1,19 @@ /* - * This file ("TileEntityFurnaceDouble.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityFurnaceDouble.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; @@ -20,7 +21,7 @@ import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements IEnergyReceiver, IEnergySaver{ +public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements IEnergyReceiver{ public static final int SLOT_INPUT_1 = 0; public static final int SLOT_OUTPUT_1 = 1; @@ -28,7 +29,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements public static final int SLOT_OUTPUT_2 = 3; public static final int ENERGY_USE = 25; private static final int SMELT_TIME = 80; - public EnergyStorage storage = new EnergyStorage(30000); + public final EnergyStorage storage = new EnergyStorage(30000); public int firstSmeltTime; public int secondSmeltTime; private int lastEnergy; @@ -40,26 +41,29 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("FirstSmeltTime", this.firstSmeltTime); - compound.setInteger("SecondSmeltTime", this.secondSmeltTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("FirstSmeltTime", this.firstSmeltTime); + compound.setInteger("SecondSmeltTime", this.secondSmeltTime); + } this.storage.writeToNBT(compound); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.firstSmeltTime = compound.getInteger("FirstSmeltTime"); - this.secondSmeltTime = compound.getInteger("SecondSmeltTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.firstSmeltTime = compound.getInteger("FirstSmeltTime"); + this.secondSmeltTime = compound.getInteger("SecondSmeltTime"); + } this.storage.readFromNBT(compound); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ boolean flag = this.firstSmeltTime > 0 || this.secondSmeltTime > 0; boolean canSmeltOnFirst = this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1); @@ -72,6 +76,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements this.finishBurning(SLOT_INPUT_1, SLOT_OUTPUT_1); this.firstSmeltTime = 0; } + this.storage.extractEnergy(ENERGY_USE, false); } } else{ @@ -85,30 +90,29 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements this.finishBurning(SLOT_INPUT_2, SLOT_OUTPUT_2); this.secondSmeltTime = 0; } + this.storage.extractEnergy(ENERGY_USE, false); } } else{ this.secondSmeltTime = 0; } - if(this.storage.getEnergyStored() >= ENERGY_USE && (this.firstSmeltTime > 0 || this.secondSmeltTime > 0)){ - this.storage.extractEnergy(ENERGY_USE, false); - } - if(flag != (this.firstSmeltTime > 0 || this.secondSmeltTime > 0)){ this.markDirty(); - int meta = PosUtil.getMetadata(this.pos, worldObj); + IBlockState state = this.worldObj.getBlockState(this.pos); + Block block = state.getBlock(); + int meta = block.getMetaFromState(state); if(meta > 3){ if(!this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1) && !this.canSmeltOn(SLOT_INPUT_2, SLOT_OUTPUT_2)){ - PosUtil.setMetadata(this.pos, worldObj, meta-4, 2); + this.worldObj.setBlockState(this.pos, block.getStateFromMeta(meta-4), 2); } } else{ - PosUtil.setMetadata(this.pos, worldObj, meta+4, 2); + this.worldObj.setBlockState(this.pos, block.getStateFromMeta(meta+4), 2); } } - if((lastEnergy != this.storage.getEnergyStored() || this.lastFirstSmelt != this.firstSmeltTime || this.lastSecondSmelt != this.secondSmeltTime) && this.sendUpdateWithInterval()){ + if((this.lastEnergy != this.storage.getEnergyStored() || this.lastFirstSmelt != this.firstSmeltTime || this.lastSecondSmelt != this.secondSmeltTime) && this.sendUpdateWithInterval()){ this.lastEnergy = this.storage.getEnergyStored(); this.lastFirstSmelt = this.firstSmeltTime; this.lastSecondSmelt = this.secondSmeltTime; @@ -194,14 +198,4 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements public boolean canConnectEnergy(EnumFacing from){ return true; } - - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java index 213ec304e..f5825dfed 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java @@ -1,31 +1,34 @@ /* - * This file ("TileEntityFurnaceSolar.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityFurnaceSolar.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyProvider, IEnergySaver, IEnergyDisplay{ +public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyProvider, IEnergyDisplay{ public static final int PRODUCE = 8; - public EnergyStorage storage = new EnergyStorage(30000); + public final EnergyStorage storage = new EnergyStorage(30000); private int oldEnergy; + public TileEntityFurnaceSolar(){ + super("solarPanel"); + } + @Override public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate){ return this.storage.extractEnergy(maxExtract, simulate); @@ -47,32 +50,28 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - if(!this.hasBlockAbove() && worldObj.isDaytime()){ + if(!this.worldObj.isRemote){ + if(!this.hasBlockAbove() && this.worldObj.isDaytime()){ if(PRODUCE <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ this.storage.receiveEnergy(PRODUCE, false); this.markDirty(); } } - if(this.storage.getEnergyStored() > 0){ - WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage); - } - if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ this.oldEnergy = this.storage.getEnergyStored(); } @@ -80,9 +79,10 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro } public boolean hasBlockAbove(){ - for(int y = 1; y <= worldObj.getHeight(); y++){ - BlockPos offset = PosUtil.offset(this.pos, 0, y, 0); - if(!PosUtil.getBlock(offset, worldObj).isAir(worldObj, offset)){ + for(int y = 1; y <= this.worldObj.getHeight(); y++){ + BlockPos offset = this.pos.down(y); + IBlockState state = this.worldObj.getBlockState(offset); + if(!state.getBlock().isAir(state, this.worldObj, offset)){ return true; } } @@ -94,14 +94,14 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements IEnergyPro return this.storage.getEnergyStored(); } - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - @Override @SideOnly(Side.CLIENT) public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java index 5c22be285..9dfc862d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java @@ -1,23 +1,31 @@ /* - * This file ("TileEntityGiantChest.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityGiantChest.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; +import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; -public class TileEntityGiantChest extends TileEntityInventoryBase{ +public class TileEntityGiantChest extends TileEntityInventoryBase implements IButtonReactor{ + + public TileEntityGiantChest(int slotAmount, String name){ + super(slotAmount, name); + } public TileEntityGiantChest(){ - super(9*13, "giantChest"); + this(9*13, "giantChest"); } @Override @@ -34,4 +42,21 @@ public class TileEntityGiantChest extends TileEntityInventoryBase{ public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return true; } + + @Override + public void onButtonPressed(int buttonID, EntityPlayer player){ + GuiHandler.GuiTypes type; + + if(buttonID == 0){ + type = GuiHandler.GuiTypes.GIANT_CHEST; + } + else if(buttonID == 1){ + type = GuiHandler.GuiTypes.GIANT_CHEST_PAGE_2; + } + else{ + type = GuiHandler.GuiTypes.GIANT_CHEST_PAGE_3; + } + + player.openGui(ActuallyAdditions.instance, type.ordinal(), this.worldObj, this.pos.getX(), this.pos.getY(), this.pos.getZ()); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChestLarge.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChestLarge.java new file mode 100644 index 000000000..364577a8b --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChestLarge.java @@ -0,0 +1,18 @@ +/* + * This file ("TileEntityGiantChestLarge.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +public class TileEntityGiantChestLarge extends TileEntityGiantChest{ + + public TileEntityGiantChestLarge(){ + super(9*13*3, "giantChestLarge"); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChestMedium.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChestMedium.java new file mode 100644 index 000000000..1af9a8bfd --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChestMedium.java @@ -0,0 +1,18 @@ +/* + * This file ("TileEntityGiantChestMedium.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +public class TileEntityGiantChestMedium extends TileEntityGiantChest{ + + public TileEntityGiantChestMedium(){ + super(9*13*2, "giantChestMedium"); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java index 5d0cb8ace..67d5bdf0c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java @@ -1,56 +1,66 @@ /* - * This file ("TileEntityGreenhouseGlass.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityGreenhouseGlass.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; - -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.Block; import net.minecraft.block.BlockGrass; import net.minecraft.block.IGrowable; +import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.IPlantable; public class TileEntityGreenhouseGlass extends TileEntityBase{ private int timeUntilNextFert; - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.writeSyncableNBT(compound, isForSync); - this.timeUntilNextFert = compound.getInteger("Time"); + public TileEntityGreenhouseGlass(){ + super("greenhouseGlass"); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.readSyncableNBT(compound, isForSync); - compound.setInteger("Time", this.timeUntilNextFert); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.timeUntilNextFert = compound.getInteger("Time"); + } + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("Time", this.timeUntilNextFert); + } } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - if(worldObj.canBlockSeeSky(this.getPos()) && worldObj.isDaytime()){ + if(!this.worldObj.isRemote){ + if(this.worldObj.canBlockSeeSky(this.getPos()) && this.worldObj.isDaytime()){ if(this.timeUntilNextFert > 0){ this.timeUntilNextFert--; - if(timeUntilNextFert <= 0){ + if(this.timeUntilNextFert <= 0){ BlockPos blockToFert = this.blockToFertilize(); if(blockToFert != null){ - int metaBefore = PosUtil.getMetadata(blockToFert, worldObj); - PosUtil.getBlock(blockToFert, worldObj).updateTick(worldObj, blockToFert, worldObj.getBlockState(blockToFert), Util.RANDOM); + IBlockState state = this.worldObj.getBlockState(blockToFert); + Block block = state.getBlock(); + int metaBefore = block.getMetaFromState(state); + block.updateTick(this.worldObj, blockToFert, this.worldObj.getBlockState(blockToFert), Util.RANDOM); - if(PosUtil.getMetadata(blockToFert, worldObj) != metaBefore){ - worldObj.playAuxSFX(2005, blockToFert, 0); + IBlockState newState = this.worldObj.getBlockState(blockToFert); + if(newState.getBlock().getMetaFromState(newState) != metaBefore){ + this.worldObj.playEvent(2005, blockToFert, 0); } } } @@ -64,10 +74,10 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ } public BlockPos blockToFertilize(){ - for(int i = -1; i > 0; i--){ - BlockPos offset = PosUtil.offset(this.pos, 0, i, 0); - Block block = PosUtil.getBlock(pos, worldObj); - if(block != null && !(worldObj.isAirBlock(offset))){ + for(int i = this.pos.getY()-1; i > 0; i--){ + BlockPos offset = new BlockPos(this.pos.getX(), i, this.pos.getZ()); + Block block = this.worldObj.getBlockState(this.pos).getBlock(); + if(block != null && !(this.worldObj.isAirBlock(offset))){ if((block instanceof IGrowable || block instanceof IPlantable) && !(block instanceof BlockGrass)){ return offset; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java index 90d944eeb..6522ceb99 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityGrinder.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityGrinder.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -13,20 +13,22 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; +import net.minecraft.util.SoundCategory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; -public class TileEntityGrinder extends TileEntityInventoryBase implements IEnergyReceiver, IEnergySaver{ +public class TileEntityGrinder extends TileEntityInventoryBase implements IEnergyReceiver{ public static final int SLOT_INPUT_1 = 0; public static final int SLOT_OUTPUT_1_1 = 1; @@ -34,7 +36,8 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg public static final int SLOT_INPUT_2 = 3; public static final int SLOT_OUTPUT_2_1 = 4; public static final int SLOT_OUTPUT_2_2 = 5; - public EnergyStorage storage = new EnergyStorage(60000); + public static final int ENERGY_USE = 40; + public final EnergyStorage storage = new EnergyStorage(60000); public int firstCrushTime; public int secondCrushTime; public boolean isDouble; @@ -51,10 +54,6 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg this.isDouble = false; } - public static int getEnergyUse(boolean isDouble){ - return isDouble ? 60 : 40; - } - @Override public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ return this.storage.receiveEnergy(maxReceive, simulate); @@ -76,26 +75,29 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("FirstCrushTime", this.firstCrushTime); - compound.setInteger("SecondCrushTime", this.secondCrushTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("FirstCrushTime", this.firstCrushTime); + compound.setInteger("SecondCrushTime", this.secondCrushTime); + } this.storage.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); + super.writeSyncableNBT(compound, type); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.firstCrushTime = compound.getInteger("FirstCrushTime"); - this.secondCrushTime = compound.getInteger("SecondCrushTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + this.firstCrushTime = compound.getInteger("FirstCrushTime"); + this.secondCrushTime = compound.getInteger("SecondCrushTime"); + } this.storage.readFromNBT(compound); - super.readSyncableNBT(compound, sync); + super.readSyncableNBT(compound, type); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ boolean flag = this.firstCrushTime > 0 || this.secondCrushTime > 0; boolean canCrushOnFirst = this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2); @@ -107,15 +109,16 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg boolean shouldPlaySound = false; if(canCrushOnFirst){ - if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble)){ + if(this.storage.getEnergyStored() >= ENERGY_USE){ if(this.firstCrushTime%30 == 0){ shouldPlaySound = true; } this.firstCrushTime++; - if(this.firstCrushTime >= getMaxCrushTime()){ + if(this.firstCrushTime >= this.getMaxCrushTime()){ this.finishCrushing(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2); this.firstCrushTime = 0; } + this.storage.extractEnergy(ENERGY_USE, false); } } else{ @@ -124,15 +127,16 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg if(this.isDouble){ if(canCrushOnSecond){ - if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble)){ + if(this.storage.getEnergyStored() >= ENERGY_USE){ if(this.secondCrushTime%30 == 0){ shouldPlaySound = true; } this.secondCrushTime++; - if(this.secondCrushTime >= getMaxCrushTime()){ + if(this.secondCrushTime >= this.getMaxCrushTime()){ this.finishCrushing(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2); this.secondCrushTime = 0; } + this.storage.extractEnergy(ENERGY_USE, false); } } else{ @@ -140,31 +144,29 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg } } - if(this.storage.getEnergyStored() >= getEnergyUse(this.isDouble) && (this.firstCrushTime > 0 || this.secondCrushTime > 0)){ - this.storage.extractEnergy(getEnergyUse(this.isDouble), false); - } - if(flag != (this.firstCrushTime > 0 || this.secondCrushTime > 0)){ this.markDirty(); - int meta = PosUtil.getMetadata(this.pos, worldObj); + IBlockState state = this.worldObj.getBlockState(this.pos); + Block block = state.getBlock(); + int meta = block.getMetaFromState(state); if(meta == 1){ if(!this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2) && (!this.isDouble || !this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2))){ - PosUtil.setMetadata(this.pos, worldObj, 0, 2); + this.worldObj.setBlockState(this.pos, block.getStateFromMeta(0), 2); } } else{ - PosUtil.setMetadata(this.pos, worldObj, 1, 2); + this.worldObj.setBlockState(this.pos, block.getStateFromMeta(1), 2); } } - if((lastEnergy != this.storage.getEnergyStored() || this.lastFirstCrush != this.firstCrushTime || this.lastSecondCrush != this.secondCrushTime) && this.sendUpdateWithInterval()){ + if((this.lastEnergy != this.storage.getEnergyStored() || this.lastFirstCrush != this.firstCrushTime || this.lastSecondCrush != this.secondCrushTime) && this.sendUpdateWithInterval()){ this.lastEnergy = this.storage.getEnergyStored(); this.lastFirstCrush = this.firstCrushTime; this.lastSecondCrush = this.secondCrushTime; } - if(shouldPlaySound && !ConfigValues.lessSound){ - this.worldObj.playSoundEffect(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), ModUtil.MOD_ID_LOWER+":crusher", 0.25F, 1.0F); + if(shouldPlaySound && !ConfigBoolValues.LESS_SOUND.isEnabled()){ + this.worldObj.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.crusher, SoundCategory.BLOCKS, 0.25F, 1.0F); } } } @@ -268,22 +270,4 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg return slot == SLOT_OUTPUT_1_1 || slot == SLOT_OUTPUT_1_2 || slot == SLOT_OUTPUT_2_1 || slot == SLOT_OUTPUT_2_2; } - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - - public static class TileEntityGrinderDouble extends TileEntityGrinder{ - - public TileEntityGrinderDouble(){ - super(6, "grinderDouble"); - this.isDouble = true; - } - - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinderDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinderDouble.java new file mode 100644 index 000000000..fd809f905 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinderDouble.java @@ -0,0 +1,20 @@ +/* + * This file ("TileEntityGrinderDouble.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +public class TileEntityGrinderDouble extends TileEntityGrinder{ + + public TileEntityGrinderDouble(){ + super(6, "grinderDouble"); + this.isDouble = true; + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java index 7f99db7ab..4a3711cee 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java @@ -1,62 +1,65 @@ /* - * This file ("TileEntityHeatCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityHeatCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.ArrayList; -public class TileEntityHeatCollector extends TileEntityBase implements IEnergyProvider, IEnergySaver, IEnergyDisplay{ +public class TileEntityHeatCollector extends TileEntityBase implements IEnergyProvider, IEnergyDisplay{ public static final int ENERGY_PRODUCE = 40; public static final int BLOCKS_NEEDED = 4; - public EnergyStorage storage = new EnergyStorage(30000); + public final EnergyStorage storage = new EnergyStorage(30000); private int oldEnergy; + public TileEntityHeatCollector(){ + super("heatCollector"); + } + @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.writeSyncableNBT(compound, isForSync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.readSyncableNBT(compound, isForSync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ ArrayList blocksAround = new ArrayList(); if(ENERGY_PRODUCE <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ for(int i = 1; i <= 5; i++){ - BlockPos coords = WorldUtil.getCoordsFromSide(WorldUtil.getDirectionBySidesInOrder(i), this.pos, 0); - if(coords != null){ - Block block = PosUtil.getBlock(coords, worldObj); - if(block != null && block.getMaterial() == Material.lava && PosUtil.getMetadata(coords, worldObj) == 0){ - blocksAround.add(i); - } + BlockPos coords = this.pos.offset(WorldUtil.getDirectionBySidesInOrder(i)); + IBlockState state = this.worldObj.getBlockState(coords); + Block block = state.getBlock(); + if(block != null && block.getMaterial(this.worldObj.getBlockState(coords)) == Material.LAVA && block.getMetaFromState(state) == 0){ + blocksAround.add(i); } } @@ -66,15 +69,11 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr if(Util.RANDOM.nextInt(10000) == 0){ int randomSide = blocksAround.get(Util.RANDOM.nextInt(blocksAround.size())); - WorldUtil.breakBlockAtSide(WorldUtil.getDirectionBySidesInOrder(randomSide), worldObj, this.pos); + this.worldObj.setBlockToAir(this.pos.offset(WorldUtil.getDirectionBySidesInOrder(randomSide))); } } } - if(this.storage.getEnergyStored() > 0){ - WorldUtil.pushEnergy(worldObj, this.pos, EnumFacing.UP, this.storage); - } - if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ this.oldEnergy = this.storage.getEnergyStored(); } @@ -106,14 +105,14 @@ public class TileEntityHeatCollector extends TileEntityBase implements IEnergyPr return this.storage.getEnergyStored(); } - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - @Override @SideOnly(Side.CLIENT) public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index a1e750691..9b8e2cdd9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityInputter.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityInputter.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -38,8 +38,8 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt public int slotToPullEnd; public TileEntity placeToPull; public boolean isAdvanced; - public boolean isPullWhitelist = true; - public boolean isPutWhitelist = true; + public boolean isPullWhitelist; + public boolean isPutWhitelist; private int lastPutSide; private int lastPutStart; private int lastPutEnd; @@ -49,6 +49,8 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt private boolean lastPullWhite; private boolean lastPutWhite; + private boolean hasCheckedTilesAround; + public TileEntityInputter(int slots, String name){ super(slots, name); } @@ -61,88 +63,29 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt @Override public void onNumberReceived(int text, int textID, EntityPlayer player){ if(text != -1){ - //TODO Find a better solution for the Math.max and Math.min stuff here (also below in initVars()!) if(textID == 0){ - this.slotToPutStart = this.placeToPut instanceof IInventory ? Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()-1), 0) : text; + this.slotToPutStart = Math.max(text, 0); } if(textID == 1){ - this.slotToPutEnd = this.placeToPut instanceof IInventory ? Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()), 0) : text; + this.slotToPutEnd = Math.max(text, 0); } if(textID == 2){ - this.slotToPullStart = this.placeToPull instanceof IInventory ? Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()-1), 0) : text; + this.slotToPullStart = Math.max(text, 0); } if(textID == 3){ - this.slotToPullEnd = this.placeToPull instanceof IInventory ? Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()), 0) : text; + this.slotToPullEnd = Math.max(text, 0); } } this.markDirty(); } - //TODO Fix for new item system - private boolean newPull(){ - /*for(EnumFacing facing : EnumFacing.values()){ - IItemHandler handler = this.placeToPull.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing); - if(handler != null){ - for(int i = Math.max(this.lastPullStart, 0); i < Math.min(this.slotToPullEnd, handler.getSlots()); i++){ - ItemStack stackInOtherInv = handler.getStackInSlot(i); - if(stackInOtherInv != null){ - if(this.slots[0] == null || ItemUtil.areItemsEqual(stackInOtherInv, this.slots[0], false)){ - - ItemStack pulled = handler.extractItem(i, this.slots[0] == null ? stackInOtherInv.stackSize : Math.min(stackInOtherInv.stackSize, this.slots[0].getMaxStackSize()-this.slots[0].stackSize), false); - if(pulled != null){ - ItemStack slotCopy = this.slots[0] == null ? null : this.slots[0].copy(); - - if(this.slots[0] == null){ - this.slots[0] = pulled.copy(); - } - else{ - this.slots[0].stackSize+=pulled.stackSize; - } - - if(!ItemUtil.areStacksEqualAndSameSize(slotCopy, this.slots[0], false)){ - return true; - } - } - } - } - } - } - }*/ - return false; - } - - private boolean newPut(){ - /*if(this.slots[0] != null){ - for(EnumFacing facing : EnumFacing.values()){ - IItemHandler handler = this.placeToPut.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing); - if(handler != null){ - for(int i = Math.max(this.slotToPutStart, 0); i < Math.min(this.slotToPutEnd, handler.getSlots()); i++){ - ItemStack slotCopy = this.slots[0].copy(); - - ItemStack remaining = handler.insertItem(i, slotCopy, false); - this.slots[0] = remaining == null ? null : remaining.copy(); - - if(!ItemUtil.areStacksEqualAndSameSize(slotCopy, this.slots[0], false)){ - return true; - } - } - } - } - }*/ - return false; - } - /** * Pulls Items from the specified Slots on the specified Side */ private void pull(){ - if(this.newPull()){ - return; - } - //The Inventory to pull from - IInventory theInventory = (IInventory)placeToPull; + IInventory theInventory = (IInventory)this.placeToPull; //Does the Inventory even have Slots!? if(theInventory.getSizeInventory() > 0){ //The slot currently pulling from (for later) @@ -173,7 +116,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt } } //If ESD has enough Space & Item in question is on whitelist - if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < maxSize)) && this.checkBothFilters(tempStack)){ + if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < maxSize)) && this.checkBothFilters(tempStack, false)){ //Deal with ISided if(theSided != null){ //Check if Item can be inserted from any Side (Because Sidedness gets ignored!) @@ -240,11 +183,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt * (Check pull() for Description, similar to this) */ private void put(){ - if(this.newPut()){ - return; - } - - IInventory theInventory = (IInventory)placeToPut; + IInventory theInventory = (IInventory)this.placeToPut; if(theInventory.getSizeInventory() > 0){ int theSlotToPut = this.slotToPutStart; int maxSize = theInventory.getInventoryStackLimit(); @@ -266,7 +205,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt maxSize = theInventory.getInventoryStackLimit(); } } - if(theInventory.isItemValidForSlot(i, this.slots[0]) && (tempStack == null || (tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)) && this.checkBothFilters(this.slots[0])){ + if(theInventory.isItemValidForSlot(i, this.slots[0]) && (tempStack == null || (tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)) && this.checkBothFilters(this.slots[0], true)){ if(theSided != null){ for(int j = 0; j <= 5; j++){ if(theSided.canInsertItem(i, this.slots[0], EnumFacing.values()[j])){ @@ -323,57 +262,41 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt /** * Checks if one of the filters contains the ItemStack - * (Whitelist or empty Blacklist in one of them always lets the Item through!) * * @param stack The ItemStack * @return If the Item is filtered correctly */ - private boolean checkBothFilters(ItemStack stack){ - return this.checkFilter(stack, true, isPullWhitelist) || this.checkFilter(stack, false, isPutWhitelist); - } - - /** - * Checks the Whitelist/Blacklist to see if Item fits - * - * @param stack The Stack to check for - * @param isPull If we're pulling or putting - * @param isWhitelist If it's set to white- or Blacklist - * @return Is Item on White-/Blacklist? - */ - private boolean checkFilter(ItemStack stack, boolean isPull, boolean isWhitelist){ + private boolean checkBothFilters(ItemStack stack, boolean output){ if(!this.isAdvanced){ return true; } - - int slotStart = isPull ? PULL_FILTER_START : PUT_FILTER_START; - int slotStop = slotStart+12; - - for(int i = slotStart; i < slotStop; i++){ - if(this.slots[i] != null && this.slots[i].isItemEqual(stack)){ - return isWhitelist; - } + else{ + int slotStart = output ? PUT_FILTER_START : PULL_FILTER_START; + return TileEntityLaserRelayItemWhitelist.checkFilter(stack, output ? this.isPutWhitelist : this.isPullWhitelist, this.slots, slotStart, slotStart+12); } - return !isWhitelist; } /** * Sets all of the relevant variables */ public void initVars(){ + if(this.sideToPull != -1){ + this.placeToPull = this.worldObj.getTileEntity(this.pos.offset(WorldUtil.getDirectionBySidesInOrder(this.sideToPull))); - //Gets the Place to put and Pull - this.placeToPull = WorldUtil.getTileEntityFromSide(WorldUtil.getDirectionBySidesInOrder(this.sideToPull), this.worldObj, this.pos); - this.placeToPut = WorldUtil.getTileEntityFromSide(WorldUtil.getDirectionBySidesInOrder(this.sideToPut), this.worldObj, this.pos); - - //Resets the Variables - if(this.placeToPull instanceof IInventory){ - if(this.slotToPullEnd <= 0){ - this.slotToPullEnd = ((IInventory)this.placeToPull).getSizeInventory(); + if(this.placeToPull instanceof IInventory){ + if(this.slotToPullEnd <= 0){ + this.slotToPullEnd = ((IInventory)this.placeToPull).getSizeInventory(); + } } } - if(this.placeToPut instanceof IInventory){ - if(this.slotToPutEnd <= 0){ - this.slotToPutEnd = ((IInventory)this.placeToPut).getSizeInventory(); + + if(this.sideToPut != -1){ + this.placeToPut = this.worldObj.getTileEntity(this.pos.offset(WorldUtil.getDirectionBySidesInOrder(this.sideToPut))); + + if(this.placeToPut instanceof IInventory){ + if(this.slotToPutEnd <= 0){ + this.slotToPutEnd = ((IInventory)this.placeToPut).getSizeInventory(); + } } } } @@ -427,54 +350,62 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt } this.markDirty(); + this.initVars(); } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("SideToPut", this.sideToPut); - compound.setInteger("SlotToPut", this.slotToPutStart); - compound.setInteger("SlotToPutEnd", this.slotToPutEnd); - compound.setInteger("SideToPull", this.sideToPull); - compound.setInteger("SlotToPull", this.slotToPullStart); - compound.setInteger("SlotToPullEnd", this.slotToPullEnd); - compound.setBoolean("PullWhitelist", this.isPullWhitelist); - compound.setBoolean("PutWhitelist", this.isPutWhitelist); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("SideToPut", this.sideToPut); + compound.setInteger("SlotToPut", this.slotToPutStart); + compound.setInteger("SlotToPutEnd", this.slotToPutEnd); + compound.setInteger("SideToPull", this.sideToPull); + compound.setInteger("SlotToPull", this.slotToPullStart); + compound.setInteger("SlotToPullEnd", this.slotToPullEnd); + compound.setBoolean("PullWhitelist", this.isPullWhitelist); + compound.setBoolean("PutWhitelist", this.isPutWhitelist); + } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.sideToPut = compound.getInteger("SideToPut"); - this.slotToPutStart = compound.getInteger("SlotToPut"); - this.slotToPutEnd = compound.getInteger("SlotToPutEnd"); - this.sideToPull = compound.getInteger("SideToPull"); - this.slotToPullStart = compound.getInteger("SlotToPull"); - this.slotToPullEnd = compound.getInteger("SlotToPullEnd"); - this.isPullWhitelist = compound.getBoolean("PullWhitelist"); - this.isPutWhitelist = compound.getBoolean("PutWhitelist"); - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + this.sideToPut = compound.getInteger("SideToPut"); + this.slotToPutStart = compound.getInteger("SlotToPut"); + this.slotToPutEnd = compound.getInteger("SlotToPutEnd"); + this.sideToPull = compound.getInteger("SideToPull"); + this.slotToPullStart = compound.getInteger("SlotToPull"); + this.slotToPullEnd = compound.getInteger("SlotToPullEnd"); + this.isPullWhitelist = compound.getBoolean("PullWhitelist"); + this.isPutWhitelist = compound.getBoolean("PutWhitelist"); + } + super.readSyncableNBT(compound, type); } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - this.initVars(); + if(!this.worldObj.isRemote){ + if(!this.hasCheckedTilesAround){ + this.initVars(); + this.hasCheckedTilesAround = true; + } //Is Block not powered by Redstone? if(!this.isRedstonePowered){ if(!(this.sideToPull == this.sideToPut && this.slotToPullStart == this.slotToPutStart && this.slotToPullEnd == this.slotToPutEnd)){ - if(sideToPull != -1 && this.placeToPull instanceof IInventory){ + if(this.sideToPull != -1 && this.placeToPull instanceof IInventory){ this.pull(); } - if(sideToPut != -1 && this.placeToPut instanceof IInventory){ + if(this.sideToPut != -1 && this.placeToPut instanceof IInventory){ this.put(); } } } //Update the Client - if((this.sideToPut != this.lastPutSide || this.sideToPull != this.lastPullSide || this.slotToPullStart != this.lastPullStart || this.slotToPullEnd != this.lastPullEnd || this.slotToPutStart != this.lastPutStart || this.slotToPutEnd != this.lastPutEnd || this.isPullWhitelist != lastPullWhite || this.isPutWhitelist != this.lastPutWhite) && this.sendUpdateWithInterval()){ + if((this.sideToPut != this.lastPutSide || this.sideToPull != this.lastPullSide || this.slotToPullStart != this.lastPullStart || this.slotToPullEnd != this.lastPullEnd || this.slotToPutStart != this.lastPutStart || this.slotToPutEnd != this.lastPutEnd || this.isPullWhitelist != this.lastPullWhite || this.isPutWhitelist != this.lastPutWhite) && this.sendUpdateWithInterval()){ this.lastPutSide = this.sideToPut; this.lastPullSide = this.sideToPull; this.lastPullStart = this.slotToPullStart; @@ -501,13 +432,4 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return slot == 0; } - - public static class TileEntityInputterAdvanced extends TileEntityInputter{ - - public TileEntityInputterAdvanced(){ - super(25, "inputterAdvanced"); - this.isAdvanced = true; - } - - } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputterAdvanced.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputterAdvanced.java new file mode 100644 index 000000000..f6f441c7c --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputterAdvanced.java @@ -0,0 +1,20 @@ +/* + * This file ("TileEntityInputterAdvanced.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +public class TileEntityInputterAdvanced extends TileEntityInputter{ + + public TileEntityInputterAdvanced(){ + super(25, "inputterAdvanced"); + this.isAdvanced = true; + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 8af8f3240..a47733d38 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -1,46 +1,65 @@ /* - * This file ("TileEntityInventoryBase.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityInventoryBase.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumFacing; -import net.minecraft.util.IChatComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; -import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.SidedInvWrapper; -import java.util.HashMap; -import java.util.Map; - public abstract class TileEntityInventoryBase extends TileEntityBase implements ISidedInventory{ + private final SidedInvWrapper[] invWrappers = new SidedInvWrapper[6]; public ItemStack slots[]; - public String name; - - private Map itemHandlers = new HashMap(); public TileEntityInventoryBase(int slots, String name){ - this.initializeSlots(slots); - this.name = "container."+ModUtil.MOD_ID_LOWER+"."+name; + super(name); - for(EnumFacing facing : EnumFacing.values()){ - this.itemHandlers.put(facing, new SidedInvWrapper(this, facing)); + this.initializeSlots(slots); + + if(this.hasInvWrapperCapabilities()){ + for(int i = 0; i < this.invWrappers.length; i++){ + this.invWrappers[i] = new SidedInvWrapper(this, EnumFacing.values()[i]); + } + } + } + + public static void saveSlots(ItemStack[] slots, NBTTagCompound compound){ + if(slots != null && slots.length > 0){ + NBTTagList tagList = new NBTTagList(); + for(ItemStack slot : slots){ + NBTTagCompound tagCompound = new NBTTagCompound(); + if(slot != null){ + slot.writeToNBT(tagCompound); + } + tagList.appendTag(tagCompound); + } + compound.setTag("Items", tagList); + } + } + + public static void loadSlots(ItemStack[] slots, NBTTagCompound compound){ + if(slots != null && slots.length > 0){ + NBTTagList tagList = compound.getTagList("Items", 10); + for(int i = 0; i < slots.length; i++){ + NBTTagCompound tagCompound = tagList.getCompoundTagAt(i); + slots[i] = tagCompound != null && tagCompound.hasKey("id") ? ItemStack.loadItemStackFromNBT(tagCompound) : null; + } } } @@ -49,21 +68,10 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.writeSyncableNBT(compound, isForSync); - if(!isForSync || this.shouldSyncSlots()){ - if(this.slots.length > 0){ - NBTTagList tagList = new NBTTagList(); - for(int currentIndex = 0; currentIndex < slots.length; currentIndex++){ - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte)currentIndex); - if(slots[currentIndex] != null){ - slots[currentIndex].writeToNBT(tagCompound); - } - tagList.appendTag(tagCompound); - } - compound.setTag("Items", tagList); - } + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type == NBTType.SAVE_TILE || (type == NBTType.SYNC && this.shouldSyncSlots())){ + saveSlots(this.slots, compound); } } @@ -72,31 +80,19 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.readSyncableNBT(compound, isForSync); - if(!isForSync || this.shouldSyncSlots()){ - if(this.slots.length > 0){ - NBTTagList tagList = compound.getTagList("Items", 10); - for(int i = 0; i < tagList.tagCount(); i++){ - NBTTagCompound tagCompound = tagList.getCompoundTagAt(i); - byte slotIndex = tagCompound.getByte("Slot"); - if(slotIndex >= 0 && slotIndex < slots.length){ - slots[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound); - } - } - } + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type == NBTType.SAVE_TILE || (type == NBTType.SYNC && this.shouldSyncSlots())){ + loadSlots(this.slots, compound); } } - @Override - public void updateEntity(){ - super.updateEntity(); - } @Override public int[] getSlotsForFace(EnumFacing side){ - if(this.slots.length > 0){ - int[] theInt = new int[slots.length]; + int invSize = this.getSizeInventory(); + if(invSize > 0){ + int[] theInt = new int[invSize]; for(int i = 0; i < theInt.length; i++){ theInt[i] = i; } @@ -107,32 +103,16 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } } - @Override - public boolean hasCapability(net.minecraftforge.common.capabilities.Capability capability, net.minecraft.util.EnumFacing facing){ - return this.getCapability(capability, facing) != null; - } - @Override public int getInventoryStackLimit(){ return 64; } - @Override - public T getCapability(Capability capability, EnumFacing facing){ - if(facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){ - return (T)this.itemHandlers.get(facing); - } - else{ - return super.getCapability(capability, facing); - } - } - @Override public boolean isUseableByPlayer(EntityPlayer player){ - return player.getDistanceSq(this.getPos().getX()+0.5D, this.pos.getY()+0.5D, this.pos.getZ()+0.5D) <= 64 && !this.isInvalid() && this.worldObj.getTileEntity(this.pos) == this; + return this.canPlayerUse(player); } - @Override public void openInventory(EntityPlayer player){ @@ -143,11 +123,6 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } - @Override - public boolean isItemValidForSlot(int index, ItemStack stack){ - return false; - } - @Override public int getField(int id){ return 0; @@ -176,31 +151,31 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public int getSizeInventory(){ - return slots.length; + return this.slots.length; } @Override public ItemStack getStackInSlot(int i){ if(i < this.getSizeInventory()){ - return slots[i]; + return this.slots[i]; } return null; } @Override public ItemStack decrStackSize(int i, int j){ - if(slots[i] != null){ + if(this.slots[i] != null){ ItemStack stackAt; - if(slots[i].stackSize <= j){ - stackAt = slots[i]; - slots[i] = null; + if(this.slots[i].stackSize <= j){ + stackAt = this.slots[i]; + this.slots[i] = null; this.markDirty(); return stackAt; } else{ - stackAt = slots[i].splitStack(j); - if(slots[i].stackSize == 0){ - slots[i] = null; + stackAt = this.slots[i].splitStack(j); + if(this.slots[i].stackSize <= 0){ + this.slots[i] = null; } this.markDirty(); return stackAt; @@ -227,8 +202,16 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } @Override - public IChatComponent getDisplayName(){ - return new ChatComponentText(StringUtil.localize(this.getName())); + public T getCapability(Capability capability, EnumFacing facing){ + if(this.hasInvWrapperCapabilities() && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){ + return (T)this.invWrappers[facing == null ? 0 : facing.ordinal()]; + } + else{ + return super.getCapability(capability, facing); + } } + public boolean hasInvWrapperCapabilities(){ + return true; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java index b0abbbe7f..4b9c8fb5c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java @@ -1,29 +1,31 @@ /* - * This file ("TileEntityItemRepairer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityItemRepairer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityItemRepairer extends TileEntityInventoryBase implements IEnergyReceiver, IEnergySaver{ +public class TileEntityItemRepairer extends TileEntityInventoryBase implements IEnergyReceiver{ public static final int SLOT_INPUT = 0; public static final int SLOT_OUTPUT = 1; public static final int ENERGY_USE = 1500; - public EnergyStorage storage = new EnergyStorage(300000); + public final EnergyStorage storage = new EnergyStorage(300000); public int nextRepairTick; private int lastEnergy; @@ -32,28 +34,49 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I } public static boolean canBeRepaired(ItemStack stack){ - return stack != null && stack.getItem().isRepairable(); + if(stack != null){ + Item item = stack.getItem(); + if(item != null){ + if(item.isRepairable()){ + return true; + } + else{ + String reg = item.getRegistryName().toString(); + if(reg != null){ + for(String strg : ConfigStringListValues.REPAIRER_EXTRA_WHITELIST.getValue()){ + if(reg.equals(strg)){ + return true; + } + } + } + } + } + } + return false; } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("NextRepairTick", this.nextRepairTick); - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("NextRepairTick", this.nextRepairTick); + } + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.nextRepairTick = compound.getInteger("NextRepairTick"); - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + this.nextRepairTick = compound.getInteger("NextRepairTick"); + } + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(this.slots[SLOT_OUTPUT] == null && canBeRepaired(this.slots[SLOT_INPUT])){ if(this.slots[SLOT_INPUT].getItemDamage() <= 0){ this.slots[SLOT_OUTPUT] = this.slots[SLOT_INPUT].copy(); @@ -128,14 +151,4 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I public boolean canConnectEnergy(EnumFacing from){ return true; } - - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java new file mode 100644 index 000000000..a3e1cad34 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java @@ -0,0 +1,267 @@ +/* + * This file ("TileEntityItemViewer.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; +import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.items.IItemHandler; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class TileEntityItemViewer extends TileEntityInventoryBase{ + + public TileEntityLaserRelayItem connectedRelay; + private boolean hasCheckedRelayOnLoad; + + public TileEntityItemViewer(){ + super(0, "itemViewer"); + } + + @Override + public void updateEntity(){ + super.updateEntity(); + + if(!this.worldObj.isRemote && !this.hasCheckedRelayOnLoad){ + this.saveConnectedRelay(); + this.hasCheckedRelayOnLoad = true; + } + } + + private List getItemHandlerInfos(){ + TileEntityLaserRelayItem relay = this.connectedRelay; + if(relay != null){ + LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getNetworkFor(relay.getPos(), this.worldObj); + if(network != null){ + return relay.getItemHandlersInNetwork(network); + } + } + return null; + } + + private SpecificItemHandlerInfo getSwitchedIndexHandler(int i){ + List infos = this.getItemHandlerInfos(); + if(infos != null && !infos.isEmpty()){ + Collections.sort(infos); + int currentI = 0; + if(!infos.isEmpty()){ + for(GenericItemHandlerInfo info : infos){ + for(IItemHandler handler : info.handlers){ + int slotAmount = handler.getSlots(); + if(currentI+slotAmount > i){ + return new SpecificItemHandlerInfo(handler, i-currentI, info.relayInQuestion); + } + else{ + currentI += slotAmount; + } + } + } + } + } + return null; + } + + public void saveConnectedRelay(){ + TileEntityLaserRelayItem tileFound = null; + if(this.worldObj != null){ //Why is that even possible..? + for(int i = 0; i <= 5; i++){ + EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); + BlockPos pos = this.getPos().offset(side); + TileEntity tile = this.worldObj.getTileEntity(pos); + + if(tile instanceof TileEntityLaserRelayItem){ + if(tileFound != null){ + this.connectedRelay = null; + return; + } + else{ + tileFound = (TileEntityLaserRelayItem)tile; + } + } + } + } + this.connectedRelay = tileFound; + } + + @Override + public boolean canInsertItem(int index, ItemStack stack, EnumFacing direction){ + return this.isItemValidForSlot(index, stack); + } + + @Override + public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction){ + SpecificItemHandlerInfo handler = this.getSwitchedIndexHandler(index); + if(handler != null){ + if(this.isWhitelisted(handler, stack, true)){ + if(ItemStack.areItemsEqual(handler.handler.getStackInSlot(handler.switchedIndex), stack)){ + ItemStack gaveBack = handler.handler.extractItem(handler.switchedIndex, stack.stackSize, true); + return gaveBack != null; + } + } + } + return false; + } + + private boolean isWhitelisted(SpecificItemHandlerInfo handler, ItemStack stack, boolean output){ + boolean whitelisted = handler.relayInQuestion.isWhitelisted(stack, output); + TileEntityLaserRelayItem connected = this.connectedRelay; + if(connected != null && connected != handler.relayInQuestion){ + return whitelisted && connected.isWhitelisted(stack, !output); + } + else{ + return whitelisted; + } + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack){ + SpecificItemHandlerInfo handler = this.getSwitchedIndexHandler(index); + if(handler != null){ + if(this.isWhitelisted(handler, stack, false)){ + ItemStack gaveBack = handler.handler.insertItem(handler.switchedIndex, stack, true); + return !ItemStack.areItemStacksEqual(gaveBack, stack); + } + } + return false; + } + + @Override + public void clear(){ + for(int i = 0; i < this.getSizeInventory(); i++){ + this.removeStackFromSlot(i); + } + } + + @Override + public void setInventorySlotContents(int i, ItemStack stack){ + if(stack != null){ + SpecificItemHandlerInfo handler = this.getSwitchedIndexHandler(i); + if(handler != null){ + ItemStack toInsert = stack.copy(); + ItemStack inSlot = handler.handler.getStackInSlot(handler.switchedIndex); + if(inSlot != null){ + toInsert.stackSize -= inSlot.stackSize; + } + handler.handler.insertItem(handler.switchedIndex, toInsert, false); + } + } + else{ + this.removeStackFromSlot(i); + } + } + + @Override + public int getSizeInventory(){ + int size = 0; + List infos = this.getItemHandlerInfos(); + if(infos != null){ + for(GenericItemHandlerInfo info : infos){ + for(IItemHandler handler : info.handlers){ + size += handler.getSlots(); + } + } + } + return size; + } + + @Override + public ItemStack getStackInSlot(int i){ + SpecificItemHandlerInfo handler = this.getSwitchedIndexHandler(i); + if(handler != null){ + return handler.handler.getStackInSlot(handler.switchedIndex); + } + return null; + } + + @Override + public ItemStack decrStackSize(int i, int j){ + SpecificItemHandlerInfo handler = this.getSwitchedIndexHandler(i); + if(handler != null){ + return handler.handler.extractItem(handler.switchedIndex, j, false); + } + return null; + } + + @Override + public ItemStack removeStackFromSlot(int index){ + SpecificItemHandlerInfo handler = this.getSwitchedIndexHandler(index); + if(handler != null){ + ItemStack stackInSlot = handler.handler.getStackInSlot(handler.switchedIndex); + if(stackInSlot != null){ + handler.handler.extractItem(handler.switchedIndex, stackInSlot.stackSize, false); + } + return stackInSlot; + } + return null; + } + + private static class SpecificItemHandlerInfo{ + + public final IItemHandler handler; + public final int switchedIndex; + public final TileEntityLaserRelayItem relayInQuestion; + + public SpecificItemHandlerInfo(IItemHandler handler, int switchedIndex, TileEntityLaserRelayItem relayInQuestion){ + this.handler = handler; + this.switchedIndex = switchedIndex; + this.relayInQuestion = relayInQuestion; + } + } + + public static class GenericItemHandlerInfo implements Comparable{ + + public final List handlers = new ArrayList(); + public final TileEntityLaserRelayItem relayInQuestion; + + public GenericItemHandlerInfo(TileEntityLaserRelayItem relayInQuestion){ + this.relayInQuestion = relayInQuestion; + } + + public static boolean containsHandler(List infos, IItemHandler handler){ + for(GenericItemHandlerInfo info : infos){ + if(info.handlers.contains(handler)){ + return true; + } + } + return false; + } + + public static boolean containsTile(List infos, TileEntityLaserRelayItem tile){ + for(GenericItemHandlerInfo info : infos){ + if(info.relayInQuestion == tile){ + return true; + } + } + return false; + } + + @Override + public int compareTo(GenericItemHandlerInfo other){ + boolean thisWhitelist = this.relayInQuestion instanceof TileEntityLaserRelayItemWhitelist; + boolean otherWhitelist = other.relayInQuestion instanceof TileEntityLaserRelayItemWhitelist; + + if(!thisWhitelist && otherWhitelist){ + return 1; + } + else if(thisWhitelist && !otherWhitelist){ + return -1; + } + else{ + return 0; + } + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java index 976991cc0..8a7deb848 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java @@ -1,69 +1,81 @@ /* - * This file ("TileEntityLaserRelay.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityLaserRelay.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; -import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.data.PlayerData; +import de.ellpeck.actuallyadditions.mod.items.ItemLaserWrench; +import de.ellpeck.actuallyadditions.mod.items.ItemLaserWrench.WrenchMode; import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; -import de.ellpeck.actuallyadditions.mod.network.PacketParticle; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler.ConnectionPair; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import io.netty.util.internal.ConcurrentSet; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.BlockPos; -import net.minecraft.util.EnumFacing; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityLaserRelay extends TileEntityBase implements IEnergyReceiver{ +import java.util.Set; + +public abstract class TileEntityLaserRelay extends TileEntityBase{ public static final int MAX_DISTANCE = 15; private static final float[] COLOR = new float[]{1F, 0F, 0F}; + private static final float[] COLOR_ITEM = new float[]{139F/255F, 94F/255F, 1F}; - @Override - public void receiveSyncCompound(NBTTagCompound compound){ - BlockPos thisPos = this.pos; - if(compound != null){ - LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(thisPos); + public final boolean isItem; - NBTTagList list = compound.getTagList("Connections", 10); - for(int i = 0; i < list.tagCount(); i++){ - LaserRelayConnectionHandler.ConnectionPair pair = LaserRelayConnectionHandler.ConnectionPair.readFromNBT(list.getCompoundTagAt(i)); - LaserRelayConnectionHandler.getInstance().addConnection(pair.firstRelay, pair.secondRelay); - } - } - else{ - LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(thisPos); - } + private Set tempConnectionStorage; + + private boolean hasCheckedHandlersAround; + + public TileEntityLaserRelay(String name, boolean isItem){ + super(name); + this.isItem = isItem; } @Override - public NBTTagCompound getSyncCompound(){ - NBTTagCompound compound = new NBTTagCompound(); + public void receiveSyncCompound(NBTTagCompound compound){ + LaserRelayConnectionHandler.removeRelayFromNetwork(this.pos, this.worldObj); - BlockPos thisPos = this.pos; - ConcurrentSet connections = LaserRelayConnectionHandler.getInstance().getConnectionsFor(thisPos); + NBTTagList list = compound.getTagList("Connections", 10); + if(!list.hasNoTags()){ + for(int i = 0; i < list.tagCount(); i++){ + ConnectionPair pair = ConnectionPair.readFromNBT(list.getCompoundTagAt(i)); + LaserRelayConnectionHandler.addConnection(pair.positions[0], pair.positions[1], this.worldObj); + } + } - if(connections != null){ - NBTTagList list = new NBTTagList(); - for(LaserRelayConnectionHandler.ConnectionPair pair : connections){ + super.receiveSyncCompound(compound); + } + + + @Override + public NBTTagCompound getUpdateTag(){ + NBTTagCompound compound = super.getUpdateTag(); + NBTTagList list = new NBTTagList(); + + ConcurrentSet connections = LaserRelayConnectionHandler.getConnectionsFor(this.pos, this.worldObj); + if(connections != null && !connections.isEmpty()){ + for(ConnectionPair pair : connections){ list.appendTag(pair.writeToNBT()); } - compound.setTag("Connections", list); - return compound; } - return null; + + compound.setTag("Connections", list); + return compound; } @Override @@ -72,17 +84,34 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei if(this.worldObj.isRemote){ this.renderParticles(); } + else if(!this.hasCheckedHandlersAround){ + this.saveAllHandlersAround(); + this.hasCheckedHandlersAround = true; + } + } + + public void saveAllHandlersAround(){ + } @SideOnly(Side.CLIENT) public void renderParticles(){ - if(Util.RANDOM.nextInt(ConfigValues.lessParticles ? 15 : 8) == 0){ - BlockPos thisPos = this.pos; - LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(thisPos); - if(network != null){ - for(LaserRelayConnectionHandler.ConnectionPair aPair : network.connections){ - if(aPair.contains(thisPos) && PosUtil.areSamePos(thisPos, aPair.firstRelay)){ - PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigValues.lessParticles ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, COLOR, 1F); + if(Util.RANDOM.nextInt(ConfigBoolValues.LESS_PARTICLES.isEnabled() ? 16 : 8) == 0){ + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if(player != null){ + PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); + WrenchMode mode = WrenchMode.values()[data.theCompound.getInteger("LaserWrenchMode")]; + if(mode != WrenchMode.NO_PARTICLES){ + ItemStack stack = player.getHeldItemMainhand(); + if(mode == WrenchMode.ALWAYS_PARTICLES || (stack != null && stack.getItem() instanceof ItemLaserWrench)){ + LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getNetworkFor(this.pos, this.worldObj); + if(network != null){ + for(ConnectionPair aPair : network.connections){ + if(aPair.contains(this.pos) && this.pos.equals(aPair.positions[0])){ + AssetUtil.renderParticlesFromAToB(aPair.positions[0].getX(), aPair.positions[0].getY(), aPair.positions[0].getZ(), aPair.positions[1].getX(), aPair.positions[1].getY(), aPair.positions[1].getZ(), ConfigBoolValues.LESS_PARTICLES.isEnabled() ? 1 : Util.RANDOM.nextInt(3)+1, 0.8F, this.isItem ? COLOR_ITEM : COLOR, 1F); + } + } + } } } } @@ -92,37 +121,22 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei @Override public void invalidate(){ super.invalidate(); - LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(this.pos); + //This is because Minecraft randomly invalidates tiles on world join and then validates them again + //We need to compensate for this so that connections don't get broken randomly + this.tempConnectionStorage = LaserRelayConnectionHandler.getConnectionsFor(this.pos, this.worldObj); + + LaserRelayConnectionHandler.removeRelayFromNetwork(this.pos, this.worldObj); } @Override - public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ - return this.transmitEnergy(WorldUtil.getCoordsFromSide(from, this.pos, 0), maxReceive, simulate); - } - - @Override - public int getEnergyStored(EnumFacing from){ - return 0; - } - - @Override - public int getMaxEnergyStored(EnumFacing from){ - return 0; - } - - public int transmitEnergy(BlockPos blockFrom, int maxTransmit, boolean simulate){ - int transmitted = 0; - if(maxTransmit > 0){ - LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(this.pos); - if(network != null){ - transmitted = LaserRelayConnectionHandler.getInstance().transferEnergyToReceiverInNeed(worldObj, blockFrom, network, Math.min(ConfigIntValues.LASER_RELAY_MAX_TRANSFER.getValue(), maxTransmit), simulate); + public void validate(){ + if(this.tempConnectionStorage != null){ + for(ConnectionPair pair : this.tempConnectionStorage){ + LaserRelayConnectionHandler.addConnection(pair.positions[0], pair.positions[1], this.worldObj); } + this.tempConnectionStorage = null; } - return transmitted; - } - @Override - public boolean canConnectEnergy(EnumFacing from){ - return true; + super.validate(); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java new file mode 100644 index 000000000..76faac6cf --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java @@ -0,0 +1,115 @@ +/* + * This file ("TileEntityLaserRelayEnergy.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; +import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; +import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay implements IEnergyReceiver{ + + public final Map receiversAround = new HashMap(); + + public TileEntityLaserRelayEnergy(){ + super("laserRelay", false); + } + + @Override + public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ + return this.transmitEnergy(from, maxReceive, simulate); + } + + @Override + public int getEnergyStored(EnumFacing from){ + return 0; + } + + @Override + public int getMaxEnergyStored(EnumFacing from){ + return 0; + } + + public int transmitEnergy(EnumFacing from, int maxTransmit, boolean simulate){ + int transmitted = 0; + if(maxTransmit > 0){ + LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getNetworkFor(this.pos, this.worldObj); + if(network != null){ + transmitted = this.transferEnergyToReceiverInNeed(from, network, Math.min(ConfigIntValues.LASER_RELAY_MAX_TRANSFER.getValue(), maxTransmit), simulate); + } + } + return transmitted; + } + + @Override + public boolean canConnectEnergy(EnumFacing from){ + return true; + } + + @Override + public void saveAllHandlersAround(){ + this.receiversAround.clear(); + + for(EnumFacing side : EnumFacing.values()){ + BlockPos pos = this.getPos().offset(side); + TileEntity tile = this.worldObj.getTileEntity(pos); + if(tile instanceof IEnergyReceiver && !(tile instanceof TileEntityLaserRelay)){ + this.receiversAround.put(side, (IEnergyReceiver)tile); + } + } + } + + private int transferEnergyToReceiverInNeed(EnumFacing from, LaserRelayConnectionHandler.Network network, int maxTransfer, boolean simulate){ + int transmitted = 0; + List alreadyChecked = new ArrayList(); + //Go through all of the connections in the network + for(LaserRelayConnectionHandler.ConnectionPair pair : network.connections){ + //Go through both relays in the connection + for(BlockPos relay : pair.positions){ + if(relay != null && !alreadyChecked.contains(relay)){ + alreadyChecked.add(relay); + TileEntity relayTile = this.worldObj.getTileEntity(relay); + if(relayTile instanceof TileEntityLaserRelayEnergy){ + for(Map.Entry receiver : ((TileEntityLaserRelayEnergy)relayTile).receiversAround.entrySet()){ + if(receiver != null && receiver.getKey() != null && receiver.getValue() != null){ + if(receiver.getKey() != from){ + if(receiver.getValue().canConnectEnergy(receiver.getKey().getOpposite())){ + //Transfer the energy (with the energy loss!) + int theoreticalReceived = receiver.getValue().receiveEnergy(receiver.getKey().getOpposite(), maxTransfer-transmitted, true); + //The amount of energy lost during a transfer + int deduct = (int)(theoreticalReceived*((double)ConfigIntValues.LASER_RELAY_LOSS.getValue()/100)); + + transmitted += receiver.getValue().receiveEnergy(receiver.getKey().getOpposite(), theoreticalReceived-deduct, simulate); + transmitted += deduct; + + //If everything that could be transmitted was transmitted + if(transmitted >= maxTransfer){ + return transmitted; + } + } + } + } + } + } + } + } + } + return transmitted; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java new file mode 100644 index 000000000..fff75745b --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java @@ -0,0 +1,86 @@ +/* + * This file ("TileEntityLaserRelayItem.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; +import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler.Network; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer.GenericItemHandlerInfo; +import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; + +import java.util.ArrayList; +import java.util.List; + +public class TileEntityLaserRelayItem extends TileEntityLaserRelay{ + + public final List handlersAround = new ArrayList(); + + public TileEntityLaserRelayItem(String name){ + super(name, true); + } + + public TileEntityLaserRelayItem(){ + this("laserRelayItem"); + } + + public boolean isWhitelisted(ItemStack stack, boolean output){ + return true; + } + + @Override + public void saveAllHandlersAround(){ + this.handlersAround.clear(); + + for(int i = 0; i <= 5; i++){ + EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); + BlockPos pos = this.getPos().offset(side); + TileEntity tile = this.worldObj.getTileEntity(pos); + if(tile != null && !(tile instanceof TileEntityItemViewer)){ + IItemHandler handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite()); + if(handler != null){ + this.handlersAround.add(handler); + } + } + } + } + + public List getItemHandlersInNetwork(Network network){ + List handlers = new ArrayList(); + for(LaserRelayConnectionHandler.ConnectionPair pair : network.connections){ + for(BlockPos relay : pair.positions){ + if(relay != null){ + TileEntity aRelayTile = this.worldObj.getTileEntity(relay); + if(aRelayTile instanceof TileEntityLaserRelayItem){ + TileEntityLaserRelayItem relayTile = (TileEntityLaserRelayItem)aRelayTile; + if(!GenericItemHandlerInfo.containsTile(handlers, relayTile)){ + GenericItemHandlerInfo info = new GenericItemHandlerInfo(relayTile); + + List handlersAroundTile = relayTile.handlersAround; + for(IItemHandler handler : handlersAroundTile){ + if(!GenericItemHandlerInfo.containsHandler(handlers, handler)){ + info.handlers.add(handler); + } + } + + handlers.add(info); + } + } + } + } + } + return handlers; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java new file mode 100644 index 000000000..0391f274e --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java @@ -0,0 +1,290 @@ +/* + * This file ("TileEntityLaserRelayItemWhitelist.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter; +import de.ellpeck.actuallyadditions.mod.items.ItemDrill; +import de.ellpeck.actuallyadditions.mod.items.ItemFilter; +import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraftforge.items.IItemHandler; + +import java.util.List; + +public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem implements IButtonReactor{ + + public final IInventory filterInventory; + public boolean isLeftWhitelist; + public boolean isRightWhitelist; + private ItemStack[] slots = new ItemStack[24]; + private boolean lastLeftWhitelist; + private boolean lastRightWhitelist; + + public TileEntityLaserRelayItemWhitelist(){ + super("laserRelayItemWhitelist"); + + this.filterInventory = new IInventory(){ + + private TileEntityLaserRelayItemWhitelist tile; + + private IInventory setTile(TileEntityLaserRelayItemWhitelist tile){ + this.tile = tile; + return this; + } + + + @Override + public String getName(){ + return this.tile.name; + } + + @Override + public int getInventoryStackLimit(){ + return 64; + } + + @Override + public void markDirty(){ + + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player){ + return this.tile.canPlayerUse(player); + } + + @Override + public void openInventory(EntityPlayer player){ + + } + + @Override + public void closeInventory(EntityPlayer player){ + + } + + @Override + public int getField(int id){ + return 0; + } + + @Override + public void setField(int id, int value){ + + } + + @Override + public int getFieldCount(){ + return 0; + } + + @Override + public void clear(){ + int length = this.tile.slots.length; + this.tile.slots = new ItemStack[length]; + } + + @Override + public void setInventorySlotContents(int i, ItemStack stack){ + this.tile.slots[i] = stack; + this.markDirty(); + } + + @Override + public int getSizeInventory(){ + return this.tile.slots.length; + } + + @Override + public ItemStack getStackInSlot(int i){ + if(i < this.getSizeInventory()){ + return this.tile.slots[i]; + } + return null; + } + + @Override + public ItemStack decrStackSize(int i, int j){ + if(this.tile.slots[i] != null){ + ItemStack stackAt; + if(this.tile.slots[i].stackSize <= j){ + stackAt = this.tile.slots[i]; + this.tile.slots[i] = null; + this.markDirty(); + return stackAt; + } + else{ + stackAt = this.tile.slots[i].splitStack(j); + if(this.tile.slots[i].stackSize <= 0){ + this.tile.slots[i] = null; + } + this.markDirty(); + return stackAt; + } + } + return null; + } + + @Override + public ItemStack removeStackFromSlot(int index){ + ItemStack stack = this.tile.slots[index]; + this.tile.slots[index] = null; + return stack; + } + + @Override + public boolean hasCustomName(){ + return false; + } + + + @Override + public ITextComponent getDisplayName(){ + return new TextComponentTranslation(this.getName()); + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack){ + return false; + } + }.setTile(this); + } + + public static boolean checkFilter(ItemStack stack, boolean isWhitelist, ItemStack[] slots, int start, int end){ + if(stack != null){ + for(int i = start; i < end; i++){ + if(slots[i] != null){ + if(slots[i].isItemEqual(stack)){ + return isWhitelist; + } + else if(slots[i].getItem() instanceof ItemFilter){ + ItemStack[] filterSlots = new ItemStack[ContainerFilter.SLOT_AMOUNT]; + ItemDrill.loadSlotsFromNBT(filterSlots, slots[i]); + if(filterSlots != null && filterSlots.length > 0){ + for(ItemStack filterSlot : filterSlots){ + if(filterSlot != null && filterSlot.isItemEqual(stack)){ + return isWhitelist; + } + } + } + } + } + } + } + return !isWhitelist; + } + + @Override + public boolean isWhitelisted(ItemStack stack, boolean output){ + int slotStart = output ? 12 : 0; + return checkFilter(stack, output ? this.isRightWhitelist : this.isLeftWhitelist, this.slots, slotStart, slotStart+12); + } + + @Override + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type == NBTType.SAVE_TILE){ + TileEntityInventoryBase.saveSlots(this.slots, compound); + } + compound.setBoolean("LeftWhitelist", this.isLeftWhitelist); + compound.setBoolean("RightWhitelist", this.isRightWhitelist); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type == NBTType.SAVE_TILE){ + TileEntityInventoryBase.loadSlots(this.slots, compound); + } + this.isLeftWhitelist = compound.getBoolean("LeftWhitelist"); + this.isRightWhitelist = compound.getBoolean("RightWhitelist"); + } + + @Override + public void onButtonPressed(int buttonID, EntityPlayer player){ + if(buttonID == 0){ + this.isLeftWhitelist = !this.isLeftWhitelist; + } + else if(buttonID == 1){ + this.isRightWhitelist = !this.isRightWhitelist; + } + else if(buttonID == 2){ + this.addWhitelistSmart(false); + } + else if(buttonID == 3){ + this.addWhitelistSmart(true); + } + } + + private void addWhitelistSmart(boolean output){ + int slotStart = output ? 12 : 0; + int slotStop = slotStart+12; + + List handlers = this.handlersAround; + for(IItemHandler handler : handlers){ + for(int i = 0; i < handler.getSlots(); i++){ + ItemStack stack = handler.getStackInSlot(i); + if(stack != null){ + ItemStack copy = stack.copy(); + copy.stackSize = 1; + + if(!checkFilter(copy, true, this.slots, slotStart, slotStop)){ + for(int k = slotStart; k < slotStop; k++){ + if(this.slots[k] != null){ + if(this.slots[k].getItem() instanceof ItemFilter){ + ItemStack[] filterSlots = new ItemStack[ContainerFilter.SLOT_AMOUNT]; + ItemDrill.loadSlotsFromNBT(filterSlots, this.slots[k]); + + boolean did = false; + if(filterSlots != null && filterSlots.length > 0){ + for(int j = 0; j < filterSlots.length; j++){ + if(filterSlots[j] == null || filterSlots[j].stackSize <= 0){ + filterSlots[j] = copy; + did = true; + break; + } + } + } + + if(did){ + ItemDrill.writeSlotsToNBT(filterSlots, this.slots[k]); + break; + } + } + } + else{ + this.slots[k] = copy; + break; + } + } + } + } + } + } + } + + @Override + public void updateEntity(){ + super.updateEntity(); + + if(!this.worldObj.isRemote){ + if((this.isLeftWhitelist != this.lastLeftWhitelist || this.isRightWhitelist != this.lastRightWhitelist) && this.sendUpdateWithInterval()){ + this.lastLeftWhitelist = this.isLeftWhitelist; + this.lastRightWhitelist = this.isRightWhitelist; + } + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java index b0ff839a3..5a48e48bf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityLavaFactoryController.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityLavaFactoryController.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -14,49 +14,57 @@ import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityLavaFactoryController extends TileEntityBase implements IEnergyReceiver, IEnergySaver, IEnergyDisplay{ +public class TileEntityLavaFactoryController extends TileEntityBase implements IEnergyReceiver, IEnergyDisplay{ public static final int NOT_MULTI = 0; public static final int HAS_LAVA = 1; public static final int HAS_AIR = 2; public static final int ENERGY_USE = 150000; - public EnergyStorage storage = new EnergyStorage(3000000); + public final EnergyStorage storage = new EnergyStorage(3000000); private int currentWorkTime; private int oldEnergy; + public TileEntityLavaFactoryController(){ + super("lavaFactory"); + } + @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); - compound.setInteger("WorkTime", this.currentWorkTime); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("WorkTime", this.currentWorkTime); + } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); - this.currentWorkTime = compound.getInteger("WorkTime"); + if(type != NBTType.SAVE_BLOCK){ + this.currentWorkTime = compound.getInteger("WorkTime"); + } } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(this.storage.getEnergyStored() >= ENERGY_USE && this.isMultiblock() == HAS_AIR){ this.currentWorkTime++; if(this.currentWorkTime >= 200){ this.currentWorkTime = 0; - PosUtil.setBlock(PosUtil.offset(this.pos, 0, 1, 0), worldObj, Blocks.lava, 0, 2); + this.worldObj.setBlockState(this.pos.up(), Blocks.LAVA.getDefaultState(), 2); this.storage.extractEnergy(ENERGY_USE, false); } } @@ -73,18 +81,20 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I public int isMultiblock(){ BlockPos thisPos = this.pos; BlockPos[] positions = new BlockPos[]{ - PosUtil.offset(thisPos, 1, 1, 0), - PosUtil.offset(thisPos, -1, 1, 0), - PosUtil.offset(thisPos, 0, 1, 1), - PosUtil.offset(thisPos, 0, 1, -1) + thisPos.add(1, 1, 0), + thisPos.add(-1, 1, 0), + thisPos.add(0, 1, 1), + thisPos.add(0, 1, -1) }; - if(WorldUtil.hasBlocksInPlacesGiven(positions, InitBlocks.blockMisc, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal(), worldObj)){ - BlockPos pos = PosUtil.offset(thisPos, 0, 1, 0); - if(PosUtil.getBlock(pos, worldObj) == Blocks.lava || PosUtil.getBlock(pos, worldObj) == Blocks.flowing_lava){ + if(WorldUtil.hasBlocksInPlacesGiven(positions, InitBlocks.blockMisc, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal(), this.worldObj)){ + BlockPos pos = thisPos.up(); + IBlockState state = this.worldObj.getBlockState(pos); + Block block = state.getBlock(); + if(block == Blocks.LAVA || block == Blocks.FLOWING_LAVA){ return HAS_LAVA; } - if(PosUtil.getBlock(pos, worldObj) == null || worldObj.isAirBlock(pos)){ + if(block == null || this.worldObj.isAirBlock(pos)){ return HAS_AIR; } } @@ -116,14 +126,14 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I return this.storage.getEnergyStored(); } - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - @Override @SideOnly(Side.CLIENT) public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java index ed5a5bf1d..21ec7ba3a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java @@ -1,72 +1,72 @@ /* - * This file ("TileEntityLeafGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityLeafGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.PacketParticle; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; -import net.minecraftforge.fml.common.network.NetworkRegistry; +import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Collections; +import java.util.List; -public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyProvider, IEnergySaver, IEnergyDisplay{ +public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyProvider, IEnergyDisplay{ public static final int RANGE = 7; public static final int ENERGY_PRODUCED = 300; - public EnergyStorage storage = new EnergyStorage(35000); + public final EnergyStorage storage = new EnergyStorage(35000); private int nextUseCounter; private int oldEnergy; + public TileEntityLeafGenerator(){ + super("leafGenerator"); + } + @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(!this.isRedstonePowered){ if(this.nextUseCounter >= 5){ this.nextUseCounter = 0; if(ENERGY_PRODUCED <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ - ArrayList breakPositions = new ArrayList(); + List breakPositions = new ArrayList(); for(int reachX = -RANGE; reachX < RANGE+1; reachX++){ for(int reachZ = -RANGE; reachZ < RANGE+1; reachZ++){ for(int reachY = -RANGE; reachY < RANGE+1; reachY++){ - BlockPos pos = PosUtil.offset(this.pos, reachX, reachY, reachZ); - Block block = PosUtil.getBlock(pos, worldObj); - if(block != null && block.isLeaves(this.worldObj, pos)){ + BlockPos pos = this.pos.add(reachX, reachY, reachZ); + Block block = this.worldObj.getBlockState(pos).getBlock(); + if(block != null && block.isLeaves(this.worldObj.getBlockState(pos), this.worldObj, pos)){ breakPositions.add(pos); } } @@ -77,16 +77,16 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr Collections.shuffle(breakPositions); BlockPos theCoord = breakPositions.get(0); - if(!ConfigValues.lessBlockBreakingEffects){ - this.worldObj.playAuxSFX(2001, theCoord, Block.getStateId(worldObj.getBlockState(theCoord))); + if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ + this.worldObj.playEvent(2001, theCoord, Block.getStateId(this.worldObj.getBlockState(theCoord))); } this.worldObj.setBlockToAir(theCoord); this.storage.receiveEnergy(ENERGY_PRODUCED, false); - if(!ConfigValues.lessParticles){ - PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), 64)); + if(!ConfigBoolValues.LESS_PARTICLES.isEnabled()){ + AssetUtil.shootParticles(this.worldObj, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F); } } } @@ -96,10 +96,6 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr } } - if(this.storage.getEnergyStored() > 0){ - WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage); - } - if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ this.oldEnergy = this.storage.getEnergyStored(); } @@ -131,14 +127,14 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr return this.storage.getEnergyStored(); } - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - @Override @SideOnly(Side.CLIENT) public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index 1ed6d9606..a2bd10001 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -1,45 +1,47 @@ /* - * This file ("TileEntityMiner.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityMiner.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyReceiver; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; -import de.ellpeck.actuallyadditions.mod.network.PacketHandler; -import de.ellpeck.actuallyadditions.mod.network.PacketParticle; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; +import de.ellpeck.actuallyadditions.mod.items.ItemDrill; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fluids.IFluidBlock; -import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; +import java.util.List; -public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyReceiver, IButtonReactor, IEnergySaver, IEnergyDisplay{ +public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyReceiver, IButtonReactor, IEnergyDisplay{ - public static final int ENERGY_USE_PER_BLOCK = 500; + public static final int ENERGY_USE_PER_BLOCK = 1000; public static final int DEFAULT_RANGE = 2; - public EnergyStorage storage = new EnergyStorage(1000000); + public final EnergyStorage storage = new EnergyStorage(200000); public int layerAt = -1; - public boolean onlyMineOres = true; + public boolean onlyMineOres; private int oldLayerAt; private int oldEnergy; @@ -48,18 +50,24 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); - compound.setInteger("Layer", this.layerAt); - compound.setBoolean("OnlyOres", this.onlyMineOres); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("Layer", this.layerAt); + } + if(type != NBTType.SAVE_BLOCK || this.onlyMineOres){ + compound.setBoolean("OnlyOres", this.onlyMineOres); + } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); - this.layerAt = compound.getInteger("Layer"); + if(type != NBTType.SAVE_BLOCK){ + this.layerAt = compound.getInteger("Layer"); + } this.onlyMineOres = compound.getBoolean("OnlyOres"); } @@ -74,7 +82,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR if(!this.isRedstonePowered && this.ticksElapsed%5 == 0){ if(this.layerAt > 0){ - if(this.mine(TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, worldObj, this.pos))){ + if(this.mine(TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.worldObj, this.pos))){ this.layerAt--; } } @@ -94,24 +102,27 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR if(this.storage.getEnergyStored() >= actualUse){ BlockPos pos = new BlockPos(this.pos.getX()+anX, this.layerAt, this.pos.getZ()+aZ); - Block block = PosUtil.getBlock(pos, worldObj); - int meta = PosUtil.getMetadata(pos, worldObj); - if(block != null && !block.isAir(this.worldObj, pos)){ - if(block.getHarvestLevel(worldObj.getBlockState(pos)) <= 3F && block.getBlockHardness(this.worldObj, pos) >= 0F && !(block instanceof BlockLiquid) && !(block instanceof IFluidBlock) && this.isMinable(block, meta)){ - ArrayList drops = new ArrayList(); - drops.addAll(block.getDrops(worldObj, pos, worldObj.getBlockState(pos), 0)); + IBlockState state = this.worldObj.getBlockState(pos); + Block block = state.getBlock(); + int meta = block.getMetaFromState(state); + if(!block.isAir(this.worldObj.getBlockState(pos), this.worldObj, pos)){ + if(block.getHarvestLevel(this.worldObj.getBlockState(pos)) <= ItemDrill.HARVEST_LEVEL && state.getBlockHardness(this.worldObj, pos) >= 0F && !(block instanceof BlockLiquid) && !(block instanceof IFluidBlock) && this.isMinable(block, meta)){ + List drops = block.getDrops(this.worldObj, pos, this.worldObj.getBlockState(pos), 0); + float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.worldObj, pos, this.worldObj.getBlockState(pos), 0, 1, false, null); - if(WorldUtil.addToInventory(this, drops, false, true)){ - if(!ConfigValues.lessBlockBreakingEffects){ - worldObj.playAuxSFX(2001, pos, Block.getStateId(worldObj.getBlockState(pos))); + if(Util.RANDOM.nextFloat() <= chance){ + if(WorldUtil.addToInventory(this, drops, false, true)){ + if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ + this.worldObj.playEvent(2001, pos, Block.getStateId(this.worldObj.getBlockState(pos))); + } + this.worldObj.setBlockToAir(pos); + + WorldUtil.addToInventory(this, drops, true, true); + this.markDirty(); + + this.storage.extractEnergy(actualUse, false); + this.shootParticles(pos.getX(), pos.getY(), pos.getZ()); } - worldObj.setBlockToAir(pos); - - WorldUtil.addToInventory(this, drops, true, true); - this.markDirty(); - - this.storage.extractEnergy(actualUse, false); - this.shootParticles(pos.getX(), pos.getY(), pos.getZ()); } return false; } @@ -126,42 +137,48 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR } private boolean isMinable(Block block, int meta){ - if(!this.isBlacklisted(block)){ - if(!this.onlyMineOres){ - return true; - } - else{ - int[] ids = OreDictionary.getOreIDs(new ItemStack(block, 1, meta)); - for(int id : ids){ - String name = OreDictionary.getOreName(id); - if(name.startsWith("ore") || name.startsWith("denseore")){ - return true; - } + if(block != null){ + if(!this.isBlacklisted(block)){ + if(!this.onlyMineOres){ + return true; } + else{ + ItemStack stack = new ItemStack(block, 1, meta); + if(stack.getItem() != null){ + int[] ids = OreDictionary.getOreIDs(stack); + for(int id : ids){ + String name = OreDictionary.getOreName(id); + if(name.startsWith("ore") || name.startsWith("denseore")){ + return true; + } + } - String reg = block.getRegistryName(); - if(reg != null && !reg.isEmpty()){ - for(String string : ConfigValues.minerExtraWhitelist){ - if(reg.equals(string)){ - return true; + String reg = block.getRegistryName().toString(); + if(!reg.isEmpty()){ + for(String string : ConfigStringListValues.MINER_EXTRA_WHITELIST.getValue()){ + if(reg.equals(string)){ + return true; + } + } } } } } } + return false; } private void shootParticles(int endX, int endY, int endZ){ - if(!ConfigValues.lessParticles){ - PacketHandler.theNetwork.sendToAllAround(new PacketParticle(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F), new NetworkRegistry.TargetPoint(worldObj.provider.getDimensionId(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 96)); + if(!ConfigBoolValues.LESS_PARTICLES.isEnabled()){ + AssetUtil.shootParticles(this.worldObj, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F); } } private boolean isBlacklisted(Block block){ - String reg = block.getRegistryName(); - if(reg != null && !reg.isEmpty()){ - for(String string : ConfigValues.minerBlacklist){ + String reg = block.getRegistryName().toString(); + if(!reg.isEmpty()){ + for(String string : ConfigStringListValues.MINER_BLACKLIST.getValue()){ if(reg.equals(string)){ return true; } @@ -221,14 +238,14 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IEnergyR return this.storage.getEnergyStored(); } - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - @Override @SideOnly(Side.CLIENT) public int getMaxEnergy(){ return this.storage.getMaxEnergyStored(); } + + @Override + public boolean needsHoldShift(){ + return false; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java index 8f6806283..b5f040978 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityOilGenerator.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityOilGenerator.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -13,28 +13,38 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; -import net.minecraft.item.ItemStack; +import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.IFluidTankProperties; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityOilGenerator extends TileEntityInventoryBase implements IEnergyProvider, IFluidHandler, IEnergySaver, IFluidSaver{ +public class TileEntityOilGenerator extends TileEntityBase implements IEnergyProvider, net.minecraftforge.fluids.IFluidHandler{ public static final int ENERGY_PRODUCED = 76; private static final int BURN_TIME = 100; - public EnergyStorage storage = new EnergyStorage(50000); - public FluidTank tank = new FluidTank(2*FluidContainerRegistry.BUCKET_VOLUME); + public final EnergyStorage storage = new EnergyStorage(50000); + public final FluidTank tank = new FluidTank(2*Util.BUCKET){ + @Override + public boolean canDrain(){ + return false; + } + + @Override + public boolean canFillFluidType(FluidStack fluid){ + return fluid.getFluid() == InitFluids.fluidOil; + } + }; public int currentBurnTime; private int lastEnergy; private int lastTank; private int lastBurnTime; public TileEntityOilGenerator(){ - super(2, "oilGenerator"); + super("oilGenerator"); } @SideOnly(Side.CLIENT) @@ -53,26 +63,29 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - compound.setInteger("BurnTime", this.currentBurnTime); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("BurnTime", this.currentBurnTime); + } this.storage.writeToNBT(compound); this.tank.writeToNBT(compound); - super.writeSyncableNBT(compound, sync); + super.writeSyncableNBT(compound, type); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - this.currentBurnTime = compound.getInteger("BurnTime"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + if(type != NBTType.SAVE_BLOCK){ + this.currentBurnTime = compound.getInteger("BurnTime"); + } this.storage.readFromNBT(compound); this.tank.readFromNBT(compound); - super.readSyncableNBT(compound, sync); + super.readSyncableNBT(compound, type); } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ boolean flag = this.currentBurnTime > 0; if(this.currentBurnTime > 0){ @@ -84,27 +97,12 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I if(ENERGY_PRODUCED*BURN_TIME <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ if(this.currentBurnTime <= 0 && this.tank.getFluidAmount() >= fuelUsed){ this.currentBurnTime = BURN_TIME; - this.tank.drain(fuelUsed, true); + this.tank.drainInternal(fuelUsed, true); } } - WorldUtil.emptyBucket(tank, slots, 0, 1, InitFluids.fluidOil); - - if(this.storage.getEnergyStored() > 0){ - WorldUtil.pushEnergyToAllSides(worldObj, this.pos, this.storage); - } - if(flag != this.currentBurnTime > 0){ this.markDirty(); - int meta = PosUtil.getMetadata(pos, worldObj); - if(meta == 1){ - if(!(ENERGY_PRODUCED*BURN_TIME <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored() && this.currentBurnTime <= 0 && this.tank.getFluidAmount() >= fuelUsed)){ - PosUtil.setMetadata(this.pos, worldObj, 0, 2); - } - } - else{ - PosUtil.setMetadata(this.pos, worldObj, 1, 2); - } } if((this.storage.getEnergyStored() != this.lastEnergy || this.tank.getFluidAmount() != this.lastTank || this.lastBurnTime != this.currentBurnTime) && this.sendUpdateWithInterval()){ @@ -115,21 +113,6 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I } } - @Override - public boolean isItemValidForSlot(int i, ItemStack stack){ - return FluidContainerRegistry.containsFluid(stack, new FluidStack(InitFluids.fluidOil, FluidContainerRegistry.BUCKET_VOLUME)) && i == 0; - } - - @Override - public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ - return this.isItemValidForSlot(slot, stack); - } - - @Override - public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ - return slot == 1; - } - @Override public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate){ return this.storage.extractEnergy(maxExtract, simulate); @@ -150,56 +133,63 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I return true; } + @Override + public IFluidHandler getFluidHandler(EnumFacing facing){ + return facing != EnumFacing.DOWN ? this.tank : null; + } + @Override public int fill(EnumFacing from, FluidStack resource, boolean doFill){ - if(resource.getFluid() == InitFluids.fluidOil){ - return this.tank.fill(resource, doFill); - } - return 0; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? 0 : handler.fill(resource, doFill); } @Override public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain){ - return null; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(resource, doDrain); } @Override public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain){ - return null; + IFluidHandler handler = this.getFluidHandler(from); + return handler == null ? null : handler.drain(maxDrain, doDrain); } @Override public boolean canFill(EnumFacing from, Fluid fluid){ - return from != EnumFacing.DOWN && fluid == InitFluids.fluidOil; + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canFillFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } + return false; } @Override public boolean canDrain(EnumFacing from, Fluid fluid){ + IFluidHandler handler = this.getFluidHandler(from); + if(handler != null){ + for(IFluidTankProperties prop : handler.getTankProperties()){ + if(prop != null && prop.canDrainFluidType(new FluidStack(fluid, Integer.MAX_VALUE))){ + return true; + } + } + } return false; } @Override public FluidTankInfo[] getTankInfo(EnumFacing from){ - return new FluidTankInfo[]{this.tank.getInfo()}; - } - - @Override - public int getEnergy(){ - return this.storage.getEnergyStored(); - } - - @Override - public void setEnergy(int energy){ - this.storage.setEnergyStored(energy); - } - - @Override - public FluidStack[] getFluids(){ - return new FluidStack[]{this.tank.getFluid()}; - } - - @Override - public void setFluids(FluidStack[] fluids){ - this.tank.setFluid(fluids[0]); + IFluidHandler handler = this.getFluidHandler(from); + if(handler instanceof IFluidTank){ + return new FluidTankInfo[]{((IFluidTank)handler).getInfo()}; + } + else{ + return null; + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBooster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBooster.java index f6d4c700c..4627b68c6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBooster.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBooster.java @@ -1,15 +1,18 @@ /* - * This file ("TileEntityPhantomBooster.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityPhantomBooster.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; public class TileEntityPhantomBooster extends TileEntityBase{ + public TileEntityPhantomBooster(){ + super("phantomBooster"); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBreaker.java new file mode 100644 index 000000000..808fe96ed --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomBreaker.java @@ -0,0 +1,20 @@ +/* + * This file ("TileEntityPhantomBreaker.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +public class TileEntityPhantomBreaker extends TileEntityPhantomPlacer{ + + public TileEntityPhantomBreaker(){ + super(9, "phantomBreaker"); + this.isBreaker = true; + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java index 7d4599288..3609a9822 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java @@ -1,24 +1,22 @@ /* - * This file ("TileEntityPhantomEnergyface.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityPhantomEnergyface.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; -import cofh.api.energy.IEnergyHandler; import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; -public class TileEntityPhantomEnergyface extends TileEntityPhantomface implements IEnergyHandler{ +public class TileEntityPhantomEnergyface extends TileEntityPhantomface implements IEnergyReceiver, IEnergyProvider{ public TileEntityPhantomEnergyface(){ super("energyface"); @@ -63,7 +61,7 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement public IEnergyProvider getProvider(){ if(this.boundPosition != null){ - TileEntity tile = worldObj.getTileEntity(boundPosition); + TileEntity tile = this.worldObj.getTileEntity(this.boundPosition); if(tile instanceof IEnergyProvider){ return (IEnergyProvider)tile; } @@ -73,7 +71,7 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement public IEnergyReceiver getReceiver(){ if(this.boundPosition != null){ - TileEntity tile = worldObj.getTileEntity(boundPosition); + TileEntity tile = this.worldObj.getTileEntity(this.boundPosition); if(tile instanceof IEnergyReceiver){ return (IEnergyReceiver)tile; } @@ -81,36 +79,9 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement return null; } - @Override - public void updateEntity(){ - super.updateEntity(); - - if(!worldObj.isRemote){ - if(this.isBoundThingInRange() && this.getProvider() != null){ - this.pushEnergy(EnumFacing.UP); - this.pushEnergy(EnumFacing.DOWN); - this.pushEnergy(EnumFacing.NORTH); - this.pushEnergy(EnumFacing.EAST); - this.pushEnergy(EnumFacing.SOUTH); - this.pushEnergy(EnumFacing.WEST); - } - } - } - @Override public boolean isBoundThingInRange(){ - return super.isBoundThingInRange() && (worldObj.getTileEntity(boundPosition) instanceof IEnergyReceiver || worldObj.getTileEntity(boundPosition) instanceof IEnergyProvider); - } - - private void pushEnergy(EnumFacing side){ - TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, this.getPos()); - if(tile != null && tile instanceof IEnergyReceiver && this.getProvider().getEnergyStored(side.getOpposite()) > 0){ - if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite()) && this.canConnectEnergy(side)){ - int receive = this.extractEnergy(side, Math.min(((IEnergyReceiver)tile).getMaxEnergyStored(side.getOpposite())-((IEnergyReceiver)tile).getEnergyStored(side.getOpposite()), this.getEnergyStored(side)), true); - int actualReceive = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), receive, false); - this.extractEnergy(side, actualReceive, false); - } - } + return super.isBoundThingInRange() && (this.worldObj.getTileEntity(this.boundPosition) instanceof IEnergyReceiver || this.worldObj.getTileEntity(this.boundPosition) instanceof IEnergyProvider); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index f2307db89..b25360e4b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityPhantomItemface.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityPhantomItemface.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -16,9 +16,7 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.capabilities.Capability; -//TODO completely adapt to new item system? public class TileEntityPhantomItemface extends TileEntityPhantomface{ public TileEntityPhantomItemface(){ @@ -26,6 +24,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ this.type = BlockPhantom.Type.FACE; } + @Override public int[] getSlotsForFace(EnumFacing side){ if(this.isBoundThingInRange()){ @@ -86,18 +85,13 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return null; } - @Override - public String getName(){ - return this.name; - } - public ISidedInventory getSided(){ return this.getInventory() instanceof ISidedInventory ? (ISidedInventory)this.getInventory() : null; } public IInventory getInventory(){ if(this.boundPosition != null){ - TileEntity tile = worldObj.getTileEntity(boundPosition); + TileEntity tile = this.worldObj.getTileEntity(this.boundPosition); if(tile instanceof IInventory){ return (IInventory)tile; } @@ -105,17 +99,6 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return null; } - @Override - public T getCapability(Capability capability, EnumFacing facing){ - if(this.isBoundThingInRange()){ - TileEntity tile = worldObj.getTileEntity(this.boundPosition); - if(tile != null){ - return tile.getCapability(capability, facing); - } - } - return super.getCapability(capability, facing); - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return this.isBoundThingInRange() && this.getInventory().isItemValidForSlot(i, stack); @@ -123,7 +106,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ @Override public boolean isBoundThingInRange(){ - return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition) instanceof IInventory; + return super.isBoundThingInRange() && this.getInventory() != null; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java index 005dca4a5..3c5ddc8e6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java @@ -1,23 +1,23 @@ /* - * This file ("TileEntityPhantomLiquiface.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityPhantomLiquiface.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements IFluidHandler{ @@ -26,54 +26,15 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements this.type = BlockPhantom.Type.LIQUIFACE; } - @Override - public void updateEntity(){ - super.updateEntity(); - - if(!worldObj.isRemote){ - if(this.isRedstonePowered && this.isBoundThingInRange() && this.getHandler() != null){ - this.pushFluid(EnumFacing.UP); - this.pushFluid(EnumFacing.DOWN); - this.pushFluid(EnumFacing.NORTH); - this.pushFluid(EnumFacing.EAST); - this.pushFluid(EnumFacing.SOUTH); - this.pushFluid(EnumFacing.WEST); - } - } - } - - public IFluidHandler getHandler(){ - if(this.boundPosition != null){ - TileEntity tile = worldObj.getTileEntity(boundPosition); - if(tile instanceof IFluidHandler){ - return (IFluidHandler)tile; - } - } - return null; - } - - private void pushFluid(EnumFacing side){ - TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, this.pos); - if(tile != null && tile instanceof IFluidHandler && this.getTankInfo(side) != null && this.getTankInfo(side).length > 0 && ((IFluidHandler)tile).getTankInfo(side.getOpposite()) != null && ((IFluidHandler)tile).getTankInfo(side.getOpposite()).length > 0){ - for(FluidTankInfo myInfo : this.getTankInfo(side)){ - for(FluidTankInfo hisInfo : ((IFluidHandler)tile).getTankInfo(side.getOpposite())){ - if(myInfo != null && hisInfo != null && myInfo.fluid != null && myInfo.fluid.getFluid() != null){ - if(((IFluidHandler)tile).canFill(side.getOpposite(), myInfo.fluid.getFluid()) && this.canDrain(side, myInfo.fluid.getFluid())){ - FluidStack receive = this.drain(side, Math.min(hisInfo.capacity-(hisInfo.fluid == null ? 0 : hisInfo.fluid.amount), myInfo.fluid.amount), false); - if(receive != null){ - int actualReceive = ((IFluidHandler)tile).fill(side.getOpposite(), receive, true); - this.drain(side, new FluidStack(receive.getFluid(), actualReceive), true); - } - } - } - } - } - } - } - @Override public boolean isBoundThingInRange(){ - return super.isBoundThingInRange() && worldObj.getTileEntity(boundPosition) instanceof IFluidHandler; + if(super.isBoundThingInRange()){ + TileEntity tile = this.worldObj.getTileEntity(this.boundPosition); + if(tile != null){ + return tile instanceof IFluidHandler || tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, null); + } + } + return false; } @Override @@ -117,4 +78,14 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements } return new FluidTankInfo[0]; } + + public IFluidHandler getHandler(){ + if(this.boundPosition != null){ + TileEntity tile = this.worldObj.getTileEntity(this.boundPosition); + if(tile instanceof IFluidHandler){ + return (IFluidHandler)tile; + } + } + return null; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index 07bc698f8..88035ce51 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -1,42 +1,40 @@ /* - * This file ("TileEntityPhantomPlacer.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityPhantomPlacer.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.api.tile.IPhantomTile; -import de.ellpeck.actuallyadditions.mod.config.ConfigValues; +import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; -import de.ellpeck.actuallyadditions.mod.network.PacketParticle; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; -import net.minecraft.util.Vec3; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.util.ArrayList; -public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements IPhantomTile, IRedstoneToggle{ +public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements IPhantomTile{ public static final int RANGE = 3; public BlockPos boundPosition; public int currentTime; public int range; public boolean isBreaker; - private boolean activateOnceWithSignal; private int oldRange; public TileEntityPhantomPlacer(int slots, String name){ @@ -49,41 +47,45 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("Range", this.range); - if(this.boundPosition != null){ - compound.setInteger("XCoordOfTileStored", boundPosition.getX()); - compound.setInteger("YCoordOfTileStored", boundPosition.getY()); - compound.setInteger("ZCoordOfTileStored", boundPosition.getZ()); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("Range", this.range); + if(this.boundPosition != null){ + compound.setInteger("XCoordOfTileStored", this.boundPosition.getX()); + compound.setInteger("YCoordOfTileStored", this.boundPosition.getY()); + compound.setInteger("ZCoordOfTileStored", this.boundPosition.getZ()); + } } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - int x = compound.getInteger("XCoordOfTileStored"); - int y = compound.getInteger("YCoordOfTileStored"); - int z = compound.getInteger("ZCoordOfTileStored"); - this.range = compound.getInteger("Range"); - if(!(x == 0 && y == 0 && z == 0)){ - this.boundPosition = new BlockPos(x, y, z); - this.markDirty(); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + int x = compound.getInteger("XCoordOfTileStored"); + int y = compound.getInteger("YCoordOfTileStored"); + int z = compound.getInteger("ZCoordOfTileStored"); + this.range = compound.getInteger("Range"); + if(!(x == 0 && y == 0 && z == 0)){ + this.boundPosition = new BlockPos(x, y, z); + this.markDirty(); + } } } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - this.range = TileEntityPhantomface.upgradeRange(RANGE, worldObj, this.pos); + if(!this.worldObj.isRemote){ + this.range = TileEntityPhantomface.upgradeRange(RANGE, this.worldObj, this.pos); if(!this.hasBoundPosition()){ this.boundPosition = null; } if(this.isBoundThingInRange()){ - if(!this.isRedstonePowered && !this.activateOnceWithSignal){ + if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; if(this.currentTime <= 0){ @@ -112,27 +114,27 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements @Override public boolean hasBoundPosition(){ if(this.boundPosition != null){ - if(this.worldObj.getTileEntity(boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ() && this.worldObj.provider.getDimensionId() == this.worldObj.provider.getDimensionId())){ + if(this.worldObj.getTileEntity(this.boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ() && this.worldObj.provider.getDimension() == this.worldObj.provider.getDimension())){ this.boundPosition = null; return false; } - return this.worldObj.provider.getDimensionId() == this.worldObj.provider.getDimensionId(); + return this.worldObj.provider.getDimension() == this.worldObj.provider.getDimension(); } return false; } private void doWork(){ if(this.isBreaker){ - Block blockToBreak = PosUtil.getBlock(boundPosition, worldObj); - if(blockToBreak != null && blockToBreak.getBlockHardness(worldObj, boundPosition) > -1.0F){ + Block blockToBreak = this.worldObj.getBlockState(this.boundPosition).getBlock(); + if(blockToBreak != null && blockToBreak.getBlockHardness(this.worldObj.getBlockState(this.boundPosition), this.worldObj, this.boundPosition) > -1.0F){ ArrayList drops = new ArrayList(); - drops.addAll(blockToBreak.getDrops(worldObj, boundPosition, worldObj.getBlockState(boundPosition), 0)); + drops.addAll(blockToBreak.getDrops(this.worldObj, this.boundPosition, this.worldObj.getBlockState(this.boundPosition), 0)); if(WorldUtil.addToInventory(this, drops, false, true)){ - if(!ConfigValues.lessBlockBreakingEffects){ - worldObj.playAuxSFX(2001, this.boundPosition, Block.getStateId(worldObj.getBlockState(this.boundPosition))); + if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ + this.worldObj.playEvent(2001, this.boundPosition, Block.getStateId(this.worldObj.getBlockState(this.boundPosition))); } - worldObj.setBlockToAir(this.boundPosition); + this.worldObj.setBlockToAir(this.boundPosition); WorldUtil.addToInventory(this, drops, true, true); this.markDirty(); } @@ -140,7 +142,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements } else{ int theSlot = WorldUtil.findFirstFilledSlot(this.slots); - this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(EnumFacing.UP, worldObj, boundPosition, this.slots[theSlot])); + this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(EnumFacing.UP, this.worldObj, this.boundPosition, this.slots[theSlot])); if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){ this.slots[theSlot] = null; } @@ -158,17 +160,17 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements double d5 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)j1); double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1; double d3 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)i1); - worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5); + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5); } if(this.ticksElapsed%80 == 0){ - PacketParticle.renderParticlesFromAToB(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), 2, 0.35F, TileEntityPhantomface.COLORS, 3); + AssetUtil.renderParticlesFromAToB(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), this.boundPosition.getX(), this.boundPosition.getY(), this.boundPosition.getZ(), 2, 0.35F, TileEntityPhantomface.COLORS, 3); } } @Override public boolean isBoundThingInRange(){ - return this.hasBoundPosition() && PosUtil.toVec(this.boundPosition).distanceTo(new Vec3(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ())) <= this.range; + return this.hasBoundPosition() && this.boundPosition.distanceSq(this.pos) <= this.range*this.range; } @Override @@ -178,7 +180,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements @Override public void setBoundPosition(BlockPos pos){ - this.boundPosition = pos == null ? null : PosUtil.copyPos(pos); + this.boundPosition = pos; } @Override @@ -207,13 +209,8 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements } @Override - public void toggle(boolean to){ - this.activateOnceWithSignal = to; - } - - @Override - public boolean isPulseMode(){ - return this.activateOnceWithSignal; + public boolean isRedstoneToggle(){ + return true; } @Override @@ -221,12 +218,4 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements this.doWork(); } - public static class TileEntityPhantomBreaker extends TileEntityPhantomPlacer{ - - public TileEntityPhantomBreaker(){ - super(9, "phantomBreaker"); - this.isBreaker = true; - } - - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java new file mode 100644 index 000000000..1bc3f50cb --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java @@ -0,0 +1,64 @@ +/* + * This file ("TileEntityPhantomRedstoneface.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.EnumFacing; + +import java.util.Arrays; + +public class TileEntityPhantomRedstoneface extends TileEntityPhantomface{ + + public final int[] providesStrong = new int[EnumFacing.values().length]; + public final int[] providesWeak = new int[EnumFacing.values().length]; + + private final int[] lastProvidesStrong = new int[this.providesStrong.length]; + private final int[] lastProvidesWeak = new int[this.providesWeak.length]; + + public TileEntityPhantomRedstoneface(){ + super("redstoneface"); + } + + @Override + public void updateEntity(){ + if(!this.worldObj.isRemote){ + if(this.isBoundThingInRange()){ + IBlockState boundState = this.worldObj.getBlockState(this.boundPosition); + if(boundState != null){ + Block boundBlock = boundState.getBlock(); + if(boundBlock != null){ + for(int i = 0; i < EnumFacing.values().length; i++){ + EnumFacing facing = EnumFacing.values()[i]; + this.providesWeak[i] = boundBlock.getWeakPower(boundState, this.worldObj, this.boundPosition, facing); + this.providesStrong[i] = boundBlock.getStrongPower(boundState, this.worldObj, this.boundPosition, facing); + } + } + } + } + } + + super.updateEntity(); + } + + @Override + protected boolean doesNeedUpdateSend(){ + return super.doesNeedUpdateSend() || !Arrays.equals(this.providesStrong, this.lastProvidesStrong) || !Arrays.equals(this.providesWeak, this.lastProvidesWeak); + } + + @Override + protected void onUpdateSent(){ + System.arraycopy(this.providesWeak, 0, this.lastProvidesWeak, 0, this.providesWeak.length); + System.arraycopy(this.providesStrong, 0, this.lastProvidesStrong, 0, this.providesStrong.length); + + super.onUpdateSent(); + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java index 5950f7ab0..ad788ee9a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityPhantomface.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityPhantomface.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -13,19 +13,16 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.api.tile.IPhantomTile; import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.network.PacketParticle; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; +import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.CapabilityDispatcher; -import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -40,18 +37,14 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP private BlockPos boundPosBefore; private Block boundBlockBefore; - private CapabilityDispatcher capabilities; - public TileEntityPhantomface(String name){ super(0, name); - - this.capabilities = ForgeEventFactory.gatherCapabilities(this); } public static int upgradeRange(int defaultRange, World world, BlockPos pos){ int newRange = defaultRange; for(int i = 0; i < 3; i++){ - Block block = PosUtil.getBlock(PosUtil.offset(pos, 0, 1+i, 0), world); + Block block = world.getBlockState(pos.up(1+i)).getBlock(); if(block == InitBlocks.blockPhantomBooster){ newRange = newRange*2; } @@ -63,52 +56,45 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setInteger("Range", this.range); - if(this.boundPosition != null){ - compound.setInteger("XCoordOfTileStored", boundPosition.getX()); - compound.setInteger("YCoordOfTileStored", boundPosition.getY()); - compound.setInteger("ZCoordOfTileStored", boundPosition.getZ()); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setInteger("Range", this.range); + if(this.boundPosition != null){ + compound.setInteger("XCoordOfTileStored", this.boundPosition.getX()); + compound.setInteger("YCoordOfTileStored", this.boundPosition.getY()); + compound.setInteger("ZCoordOfTileStored", this.boundPosition.getZ()); + } } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - int x = compound.getInteger("XCoordOfTileStored"); - int y = compound.getInteger("YCoordOfTileStored"); - int z = compound.getInteger("ZCoordOfTileStored"); - this.range = compound.getInteger("Range"); - if(!(x == 0 && y == 0 && z == 0)){ - this.boundPosition = new BlockPos(x, y, z); - this.markDirty(); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + int x = compound.getInteger("XCoordOfTileStored"); + int y = compound.getInteger("YCoordOfTileStored"); + int z = compound.getInteger("ZCoordOfTileStored"); + this.range = compound.getInteger("Range"); + if(!(x == 0 && y == 0 && z == 0)){ + this.boundPosition = new BlockPos(x, y, z); + this.markDirty(); + } } } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - this.range = upgradeRange(RANGE, worldObj, this.getPos()); + if(!this.worldObj.isRemote){ + this.range = upgradeRange(RANGE, this.worldObj, this.getPos()); if(!this.hasBoundPosition()){ this.boundPosition = null; } - if(this.boundPosition != this.boundPosBefore || (this.boundPosition != null && PosUtil.getBlock(this.boundPosition, worldObj) != this.boundBlockBefore) || this.rangeBefore != this.range){ - this.rangeBefore = this.range; - this.boundPosBefore = this.boundPosition; - this.boundBlockBefore = this.boundPosition == null ? null : PosUtil.getBlock(this.boundPosition, this.worldObj); - - this.worldObj.markBlockForUpdate(PosUtil.offset(this.pos, 1, 0, 0)); - this.worldObj.markBlockForUpdate(PosUtil.offset(this.pos, -1, 0, 0)); - this.worldObj.markBlockForUpdate(PosUtil.offset(this.pos, 0, 1, 0)); - this.worldObj.markBlockForUpdate(PosUtil.offset(this.pos, 0, -1, 0)); - this.worldObj.markBlockForUpdate(PosUtil.offset(this.pos, 0, 0, 1)); - this.worldObj.markBlockForUpdate(PosUtil.offset(this.pos, 0, 0, -1)); - this.sendUpdate(); - this.markDirty(); + if(this.doesNeedUpdateSend()){ + this.onUpdateSent(); } } else{ @@ -118,9 +104,19 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP } } - @Override - public T getCapability(Capability capability, EnumFacing facing){ - return this.capabilities.getCapability(capability, facing); + protected boolean doesNeedUpdateSend(){ + return this.boundPosition != this.boundPosBefore || (this.boundPosition != null && this.worldObj.getBlockState(this.boundPosition).getBlock() != this.boundBlockBefore) || this.rangeBefore != this.range; + } + + protected void onUpdateSent(){ + this.rangeBefore = this.range; + this.boundPosBefore = this.boundPosition; + this.boundBlockBefore = this.boundPosition == null ? null : this.worldObj.getBlockState(this.boundPosition).getBlock(); + + this.worldObj.notifyNeighborsOfStateChange(this.pos, this.worldObj.getBlockState(this.boundPosition).getBlock()); + + this.sendUpdate(); + this.markDirty(); } @Override @@ -131,7 +127,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP @Override public boolean hasBoundPosition(){ if(this.boundPosition != null){ - if(worldObj.getTileEntity(boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ())){ + if(this.worldObj.getTileEntity(this.boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ())){ this.boundPosition = null; return false; } @@ -151,17 +147,17 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP double d5 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)j1); double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1; double d3 = (double)(Util.RANDOM.nextFloat()*1.0F*(float)i1); - worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5); + this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5); } if(this.ticksElapsed%80 == 0){ - PacketParticle.renderParticlesFromAToB(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), 2, 0.35F, COLORS, 3); + AssetUtil.renderParticlesFromAToB(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), this.boundPosition.getX(), this.boundPosition.getY(), this.boundPosition.getZ(), 2, 0.35F, COLORS, 3); } } @Override public boolean isBoundThingInRange(){ - return this.hasBoundPosition() && PosUtil.toVec(this.boundPosition).distanceTo(PosUtil.toVec(this.getPos())) <= this.range; + return this.hasBoundPosition() && this.boundPosition.distanceSq(this.getPos()) <= this.range*this.range; } @Override @@ -171,7 +167,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP @Override public void setBoundPosition(BlockPos pos){ - this.boundPosition = pos == null ? null : PosUtil.copyPos(pos); + this.boundPosition = pos; } @Override @@ -193,4 +189,19 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ return false; } + + @Override + public boolean hasInvWrapperCapabilities(){ + return false; + } + + @Override + public boolean hasCapability(Capability capability, EnumFacing facing){ + return this.isBoundThingInRange() ? this.worldObj.getTileEntity(this.boundPosition).hasCapability(capability, facing) : super.hasCapability(capability, facing); + } + + @Override + public T getCapability(Capability capability, EnumFacing facing){ + return this.isBoundThingInRange() ? this.worldObj.getTileEntity(this.boundPosition).getCapability(capability, facing) : super.getCapability(capability, facing); + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlacer.java new file mode 100644 index 000000000..c68c2e5f6 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlacer.java @@ -0,0 +1,20 @@ +/* + * This file ("TileEntityPlacer.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +public class TileEntityPlacer extends TileEntityBreaker{ + + public TileEntityPlacer(){ + super(9, "placer"); + this.isPlacer = true; + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java new file mode 100644 index 000000000..879ad4f84 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java @@ -0,0 +1,224 @@ +/* + * This file ("TileEntityPlayerInterface.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import cofh.api.energy.EnergyStorage; +import cofh.api.energy.IEnergyContainerItem; +import cofh.api.energy.IEnergyReceiver; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; + +import java.util.UUID; + +public class TileEntityPlayerInterface extends TileEntityInventoryBase implements IEnergyReceiver, IEnergyDisplay{ + + public static final int DEFAULT_RANGE = 32; + public UUID connectedPlayer; + private final EnergyStorage storage = new EnergyStorage(30000); + private int range; + + public TileEntityPlayerInterface(){ + super(0, "playerInterface"); + } + + private EntityPlayer getPlayer(){ + if(this.connectedPlayer != null){ + EntityPlayer player = this.worldObj.getPlayerEntityByUUID(this.connectedPlayer); + if(player != null){ + if(player.getDistance(this.pos.getX(), this.pos.getY(), this.pos.getZ()) <= this.range){ + return player; + } + } + } + return null; + } + + @Override + public void updateEntity(){ + super.updateEntity(); + if(!this.worldObj.isRemote){ + boolean changed = false; + + this.range = TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.worldObj, this.pos); + + EntityPlayer player = this.getPlayer(); + if(player != null){ + for(int i = 0; i < player.inventory.getSizeInventory(); i++){ + if(this.storage.getEnergyStored() > 0){ + ItemStack slot = player.inventory.getStackInSlot(i); + if(slot != null && slot.getItem() instanceof IEnergyContainerItem){ + int received = ((IEnergyContainerItem)slot.getItem()).receiveEnergy(slot, this.storage.getEnergyStored(), false); + this.storage.extractEnergy(received, false); + changed = true; + } + } + else{ + break; + } + } + } + + if(changed){ + this.markDirty(); + this.sendUpdate(); + } + } + } + + @Override + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + this.storage.writeToNBT(compound); + if(this.connectedPlayer != null && type != NBTType.SAVE_BLOCK){ + compound.setUniqueId("Player", this.connectedPlayer); + } + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + this.storage.readFromNBT(compound); + if(compound.hasKey("PlayerLeast") && type != NBTType.SAVE_BLOCK){ + this.connectedPlayer = compound.getUniqueId("Player"); + } + } + + @Override + public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ + return this.storage.receiveEnergy(maxReceive, simulate); + } + + @Override + public int getEnergyStored(EnumFacing from){ + return this.storage.getEnergyStored(); + } + + @Override + public int getMaxEnergyStored(EnumFacing from){ + return this.storage.getMaxEnergyStored(); + } + + @Override + public boolean canConnectEnergy(EnumFacing from){ + return true; + } + + @Override + public int[] getSlotsForFace(EnumFacing side){ + if(this.getPlayer() != null){ + int[] theInt = new int[this.getSizeInventory()]; + for(int i = 0; i < theInt.length; i++){ + theInt[i] = i; + } + return theInt; + } + return new int[0]; + } + + @Override + public int getInventoryStackLimit(){ + EntityPlayer player = this.getPlayer(); + return player != null ? player.inventory.getInventoryStackLimit() : 0; + } + + @Override + public void clear(){ + EntityPlayer player = this.getPlayer(); + if(player != null){ + player.inventory.clear(); + } + } + + @Override + public void setInventorySlotContents(int i, ItemStack stack){ + EntityPlayer player = this.getPlayer(); + if(player != null){ + player.inventory.setInventorySlotContents(i, stack); + } + } + + @Override + public int getSizeInventory(){ + EntityPlayer player = this.getPlayer(); + if(player != null){ + return player.inventory.getSizeInventory(); + } + else{ + return 0; + } + } + + @Override + public ItemStack getStackInSlot(int i){ + EntityPlayer player = this.getPlayer(); + if(player != null){ + return player.inventory.getStackInSlot(i); + } + else{ + return null; + } + } + + @Override + public ItemStack decrStackSize(int i, int j){ + EntityPlayer player = this.getPlayer(); + if(player != null){ + ItemStack stack = player.inventory.decrStackSize(i, j); + if(stack != null){ + return stack; + } + } + return null; + } + + @Override + public ItemStack removeStackFromSlot(int index){ + EntityPlayer player = this.getPlayer(); + if(player != null){ + ItemStack stack = player.inventory.removeStackFromSlot(index); + if(stack != null){ + return stack; + } + } + return null; + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack stack){ + EntityPlayer player = this.getPlayer(); + return player != null && player.inventory.isItemValidForSlot(i, stack); + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){ + return this.isItemValidForSlot(slot, stack); + } + + @Override + public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ + return true; + } + + @Override + public int getEnergy(){ + return this.storage.getEnergyStored(); + } + + @Override + public int getMaxEnergy(){ + return this.storage.getMaxEnergyStored(); + } + + @Override + public boolean needsHoldShift(){ + return false; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java index bad0d1d95..caedbe252 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityRangedCollector.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityRangedCollector.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -16,8 +16,8 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; import java.util.ArrayList; @@ -33,29 +33,32 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement } @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - compound.setBoolean("Whitelist", this.isWhitelist); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + compound.setBoolean("Whitelist", this.isWhitelist); + } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.isWhitelist = compound.getBoolean("Whitelist"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.isWhitelist = compound.getBoolean("Whitelist"); + } } @Override - @SuppressWarnings("unchecked") public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(!this.isRedstonePowered){ - ArrayList items = (ArrayList)this.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.fromBounds(this.pos.getX()-RANGE, this.pos.getY()-RANGE, this.pos.getZ()-RANGE, this.pos.getX()+RANGE, this.pos.getY()+RANGE, this.pos.getZ()+RANGE)); + ArrayList items = (ArrayList)this.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(this.pos.getX()-RANGE, this.pos.getY()-RANGE, this.pos.getZ()-RANGE, this.pos.getX()+RANGE, this.pos.getY()+RANGE, this.pos.getZ()+RANGE)); if(!items.isEmpty()){ for(EntityItem item : items){ if(!item.isDead && item.getEntityItem() != null){ ItemStack toAdd = item.getEntityItem().copy(); - if(this.checkFilter(toAdd)){ + if(TileEntityLaserRelayItemWhitelist.checkFilter(toAdd, this.isWhitelist, this.slots, WHITELIST_START, WHITELIST_START+12)){ ArrayList checkList = new ArrayList(); checkList.add(toAdd); if(WorldUtil.addToInventory(this, 0, WHITELIST_START, checkList, EnumFacing.UP, false, true)){ @@ -74,17 +77,6 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement } } - private boolean checkFilter(ItemStack stack){ - int slotStop = WHITELIST_START+12; - - for(int i = WHITELIST_START; i < slotStop; i++){ - if(this.slots[i] != null && this.slots[i].isItemEqual(stack)){ - return this.isWhitelist; - } - } - return !this.isWhitelist; - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return false; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java new file mode 100644 index 000000000..b45203bfa --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java @@ -0,0 +1,114 @@ +/* + * This file ("TileEntityShockSuppressor.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.tile; + +import cofh.api.energy.EnergyStorage; +import cofh.api.energy.IEnergyReceiver; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; + +import java.util.ArrayList; +import java.util.List; + +public class TileEntityShockSuppressor extends TileEntityBase implements IEnergyReceiver, IEnergyDisplay{ + + public static final List SUPPRESSORS = new ArrayList(); + + public static final int USE_PER = 300; + public static final int RANGE = 5; + + public EnergyStorage storage = new EnergyStorage(300000); + private int oldEnergy; + + public TileEntityShockSuppressor(){ + super("shockSuppressor"); + } + + @Override + public void onChunkUnload(){ + super.onChunkUnload(); + + if(!this.worldObj.isRemote){ + SUPPRESSORS.remove(this); + } + } + + @Override + public void invalidate(){ + super.invalidate(); + + if(!this.worldObj.isRemote){ + SUPPRESSORS.remove(this); + } + } + + @Override + public void updateEntity(){ + super.updateEntity(); + + if(!this.worldObj.isRemote){ + if(!this.isInvalid() && !SUPPRESSORS.contains(this)){ + SUPPRESSORS.add(this); + } + + if(this.oldEnergy != this.storage.getEnergyStored() && this.sendUpdateWithInterval()){ + this.oldEnergy = this.storage.getEnergyStored(); + } + } + } + + @Override + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + this.storage.writeToNBT(compound); + } + + @Override + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + this.storage.readFromNBT(compound); + } + + @Override + public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ + return this.storage.receiveEnergy(maxReceive, simulate); + } + + @Override + public int getEnergyStored(EnumFacing from){ + return this.storage.getEnergyStored(); + } + + @Override + public int getMaxEnergyStored(EnumFacing from){ + return this.storage.getMaxEnergyStored(); + } + + @Override + public boolean canConnectEnergy(EnumFacing from){ + return true; + } + + @Override + public int getEnergy(){ + return this.storage.getEnergyStored(); + } + + @Override + public int getMaxEnergy(){ + return this.storage.getMaxEnergyStored(); + } + + @Override + public boolean needsHoldShift(){ + return false; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java index db120168a..88065560c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java @@ -1,51 +1,52 @@ /* - * This file ("TileEntitySmileyCloud.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntitySmileyCloud.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.network.gui.IStringReactor; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.util.Objects; public class TileEntitySmileyCloud extends TileEntityBase implements IStringReactor{ public String name; - @SideOnly(Side.CLIENT) - public double lastFlyHeight; - @SideOnly(Side.CLIENT) - public int flyHeight; private String nameBefore; + public TileEntitySmileyCloud(){ + super("smileyCloud"); + } + @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); - if(this.name != null){ + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); + if(this.name != null && type != NBTType.SAVE_BLOCK){ compound.setString("Name", this.name); } } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); - this.name = compound.getString("Name"); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); + if(type != NBTType.SAVE_BLOCK){ + this.name = compound.getString("Name"); + } } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ - if(!Objects.equals(this.name, this.nameBefore) && this.sendUpdateWithInterval()){ + if(!this.worldObj.isRemote){ + boolean nameChanged = this.name != null ? !this.name.equals(this.nameBefore) : this.nameBefore != null; + if(nameChanged && this.sendUpdateWithInterval()){ this.nameBefore = this.name; this.markDirty(); } @@ -56,4 +57,20 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IStringReac public void onTextReceived(String text, int textID, EntityPlayer player){ this.name = text; } + + public void setStatus(boolean pinkAndFluffy){ + IBlockState state = this.worldObj.getBlockState(this.pos); + Block block = state.getBlock(); + int meta = block.getMetaFromState(state); + if(pinkAndFluffy){ + if(meta <= 3){ + this.worldObj.setBlockState(this.pos, block.getStateFromMeta(meta+4), 2); + } + } + else{ + if(meta >= 4){ + this.worldObj.setBlockState(this.pos, block.getStateFromMeta(meta-4), 2); + } + } + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java index bc1617e78..cf5190a36 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java @@ -1,11 +1,11 @@ /* - * This file ("TileEntityXPSolidifier.java") is part of the Actually Additions Mod for Minecraft. + * This file ("TileEntityXPSolidifier.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.tile; @@ -21,30 +21,98 @@ import net.minecraft.util.EnumFacing; public class TileEntityXPSolidifier extends TileEntityInventoryBase implements IButtonReactor{ + private static final Integer[] XP_MAP = new Integer[256]; + + static{ + for(int i = 0; i < XP_MAP.length; i++){ + XP_MAP[i] = getExperienceForLevelImpl(i); + } + } + + private final int[] buttonAmounts = new int[]{1, 5, 10, 20, 30, 40, 50, 64, -999}; public short amount; private short lastAmount; - private int[] buttonAmounts = new int[]{1, 5, 10, 20, 30, 40, 50, 64, -999}; public TileEntityXPSolidifier(){ super(1, "xpSolidifier"); } + public static int getExperienceForLevel(int level){ + if(level >= 0 && level < XP_MAP.length){ + return XP_MAP[level]; + } + if(level >= 21863){ + return Integer.MAX_VALUE; + } + return getExperienceForLevelImpl(level); + } + + private static int getExperienceForLevelImpl(int level){ + int res = 0; + for(int i = 0; i < level; i++){ + res += getXpBarCapacity(i); + if(res < 0){ + return Integer.MAX_VALUE; + } + } + return res; + } + + public static int getXpBarCapacity(int level){ + if(level >= 30){ + return 112+(level-30)*9; + } + else if(level >= 15){ + return 37+(level-15)*5; + } + return 7+level*2; + } + + public static int getLevelForExperience(int experience){ + for(int i = 0; i < XP_MAP.length; i++){ + if(XP_MAP[i] > experience){ + return i-1; + } + } + int i = XP_MAP.length; + while(getExperienceForLevel(i) <= experience){ + i++; + } + return i-1; + } + + public static int getPlayerXP(EntityPlayer player){ + return (int)(getExperienceForLevel(player.experienceLevel)+(player.experience*player.xpBarCap())); + } + + /* + * The below methods were excerpted from EnderIO by SleepyTrousers with permission, thanks! + */ + + public static void addPlayerXP(EntityPlayer player, int amount){ + int experience = Math.max(0, getPlayerXP(player)+amount); + player.experienceTotal = experience; + player.experienceLevel = getLevelForExperience(experience); + int expForLevel = getExperienceForLevel(player.experienceLevel); + player.experience = (float)(experience-expForLevel)/(float)player.xpBarCap(); + } + @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ - super.writeSyncableNBT(compound, sync); + public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ + super.writeSyncableNBT(compound, type); compound.setShort("Amount", this.amount); } @Override - public void readSyncableNBT(NBTTagCompound compound, boolean sync){ - super.readSyncableNBT(compound, sync); + public void readSyncableNBT(NBTTagCompound compound, NBTType type){ + super.readSyncableNBT(compound, type); this.amount = compound.getShort("Amount"); } @Override public void updateEntity(){ super.updateEntity(); - if(!worldObj.isRemote){ + if(!this.worldObj.isRemote){ if(this.amount > 0){ if(this.slots[0] == null){ int toSet = this.amount > 64 ? 64 : this.amount; @@ -83,71 +151,15 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I @Override public void onButtonPressed(int buttonID, EntityPlayer player){ if(buttonID < this.buttonAmounts.length){ - if(this.getPlayerXP(player) > 0){ - int xp = this.buttonAmounts[buttonID] == -999 ? this.getPlayerXP(player)/ItemSolidifiedExperience.SOLID_XP_AMOUNT : this.buttonAmounts[buttonID]; - if(this.amount < Short.MAX_VALUE-xp && this.getPlayerXP(player) >= ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp){ - this.addPlayerXP(player, -(ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp)); - if(!worldObj.isRemote){ + if(getPlayerXP(player) > 0){ + int xp = this.buttonAmounts[buttonID] == -999 ? getPlayerXP(player)/ItemSolidifiedExperience.SOLID_XP_AMOUNT : this.buttonAmounts[buttonID]; + if(this.amount < Short.MAX_VALUE-xp && getPlayerXP(player) >= ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp){ + addPlayerXP(player, -(ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp)); + if(!this.worldObj.isRemote){ this.amount += xp; } } } } } - - //TODO Fix XP System to fit points needed in 1.8 (OpenBlocks?) - - /** - * Gets the Player's XP - * (Excerpted from OpenBlocks' XP system with permission, thanks guys!) - * - * @param player The Player - * @return The XP - */ - private int getPlayerXP(EntityPlayer player){ - return (int)(this.getExperienceForLevel(player.experienceLevel)+(player.experience*player.xpBarCap())); - } - - /** - * Adds (or removes, if negative) a certain amount of XP from a player - * (Excerpted from OpenBlocks' XP system with permission, thanks guys!) - * - * @param player The Player - * @param amount The Amount - */ - private void addPlayerXP(EntityPlayer player, int amount){ - int experience = getPlayerXP(player)+amount; - player.experienceTotal = experience; - - int level = 0; - while(getExperienceForLevel(level) <= experience){ - level++; - } - player.experienceLevel = level-1; - - int expForLevel = this.getExperienceForLevel(player.experienceLevel); - player.experience = (float)(experience-expForLevel)/(float)player.xpBarCap(); - } - - /** - * Gets the amount of experience a certain level contains - * (Excerpted from OpenBlocks' XP system with permission, thanks guys!) - * - * @param level The Level in question - * @return The total XP the level has - */ - private int getExperienceForLevel(int level){ - if(level > 0){ - if(level > 0 && level < 16){ - return level*17; - } - else if(level > 15 && level < 31){ - return (int)(1.5*Math.pow(level, 2)-29.5*level+360); - } - else{ - return (int)(3.5*Math.pow(level, 2)-151.5*level+2220); - } - } - return 0; - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/update/ThreadUpdateChecker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/update/ThreadUpdateChecker.java index 9535467f1..8db0addf9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/update/ThreadUpdateChecker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/update/ThreadUpdateChecker.java @@ -1,11 +1,11 @@ /* - * This file ("ThreadUpdateChecker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ThreadUpdateChecker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.update; @@ -20,7 +20,7 @@ import java.util.Properties; public class ThreadUpdateChecker extends Thread{ public ThreadUpdateChecker(){ - this.setName(ModUtil.MOD_ID+" Update Checker"); + this.setName(ModUtil.NAME+" Update Checker"); this.setDaemon(true); this.start(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java index cf2d896ab..4e7a8a3b2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java @@ -1,32 +1,70 @@ /* - * This file ("UpdateChecker.java") is part of the Actually Additions Mod for Minecraft. + * This file ("UpdateChecker.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.update; +import com.sun.deploy.util.UpdateCheck; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.text.ITextComponent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public class UpdateChecker{ public static final String DOWNLOAD_LINK = "http://ellpeck.de/actadddownload"; - public static final String CHANGELOG_LINK = "http://ellpeck.de/actaddchangelog/"; + public static final String CHANGELOG_LINK = "http://ellpeck.de/actaddchangelog"; public static boolean checkFailed; public static boolean needsUpdateNotify; public static int updateVersionInt; public static String updateVersionString; - public static void init(){ + private static boolean notified = false; + private static int ticksElapsedBeforeInfo; + + public UpdateChecker(){ if(ConfigBoolValues.DO_UPDATE_CHECK.isEnabled() && !Util.isDevVersion()){ ModUtil.LOGGER.info("Initializing Update Checker..."); + new ThreadUpdateChecker(); + MinecraftForge.EVENT_BUS.register(this); + } + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent(receiveCanceled = true) + public void onTick(TickEvent.ClientTickEvent event){ + //Don't notify directly to prevent the Message getting lost in Spam on World Joining + if(!notified && Minecraft.getMinecraft().thePlayer != null){ + ticksElapsedBeforeInfo++; + if(ticksElapsedBeforeInfo >= 800){ + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if(UpdateChecker.checkFailed){ + player.addChatComponentMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID+".update.failed"))); + notified = true; + } + else if(UpdateChecker.needsUpdateNotify){ + player.addChatComponentMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID+".update.generic"))); + player.addChatComponentMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".update.versionCompare", ModUtil.VERSION, UpdateChecker.updateVersionString))); + player.addChatComponentMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".update.buttons", UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK))); + notified = true; + } + ticksElapsedBeforeInfo = 0; + } } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateCheckerClientNotificationEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateCheckerClientNotificationEvent.java deleted file mode 100644 index 372f29bd5..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateCheckerClientNotificationEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file ("UpdateCheckerClientNotificationEvent.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.update; - -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.IChatComponent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; - -public class UpdateCheckerClientNotificationEvent{ - - private static boolean notified = false; - private static int ticksElapsedBeforeInfo; - - @SubscribeEvent(receiveCanceled = true) - public void onTick(TickEvent.ClientTickEvent event){ - //Don't notify directly to prevent the Message getting lost in Spam on World Joining - if(!notified && Minecraft.getMinecraft().thePlayer != null){ - ticksElapsedBeforeInfo++; - if(ticksElapsedBeforeInfo >= 800){ - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - if(UpdateChecker.checkFailed){ - player.addChatComponentMessage(IChatComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.failed"))); - notified = true; - } - else if(UpdateChecker.needsUpdateNotify){ - player.addChatComponentMessage(IChatComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.generic"))); - player.addChatComponentMessage(IChatComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".update.versionCompare", ModUtil.VERSION, UpdateChecker.updateVersionString))); - player.addChatComponentMessage(IChatComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID_LOWER+".update.buttons", UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK))); - notified = true; - } - ticksElapsedBeforeInfo = 0; - } - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java index 9babd4f7f..54fcb1c52 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java @@ -1,46 +1,61 @@ /* - * This file ("AssetUtil.java") is part of the Actually Additions Mod for Minecraft. + * This file ("AssetUtil.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.util; -import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; +import de.ellpeck.actuallyadditions.mod.misc.ParticleColored; +import de.ellpeck.actuallyadditions.mod.network.PacketHandler; +import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.VertexBuffer; import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; -public class AssetUtil{ +public final class AssetUtil{ + @SideOnly(Side.CLIENT) public static final ResourceLocation GUI_INVENTORY_LOCATION = getGuiLocation("guiInventory"); + @SideOnly(Side.CLIENT) public static ResourceLocation getGuiLocation(String file){ - return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/"+file+".png"); + return new ResourceLocation(ModUtil.MOD_ID, "textures/gui/"+file+".png"); } + @SideOnly(Side.CLIENT) public static ResourceLocation getBookletGuiLocation(String file){ - return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/booklet/"+file+".png"); + return new ResourceLocation(ModUtil.MOD_ID, "textures/gui/booklet/"+file+".png"); } - public static void displayNameString(FontRenderer font, int xSize, int yPositionOfMachineText, String machineName){ - String localMachineName = StringUtil.localize(machineName+".name"); - font.drawString(localMachineName, xSize/2-font.getStringWidth(localMachineName)/2, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE); + @SideOnly(Side.CLIENT) + public static void displayNameString(FontRenderer font, int xSize, int yPositionOfMachineText, String text){ + font.drawString(text, xSize/2-font.getStringWidth(text)/2, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE); + } + + @SideOnly(Side.CLIENT) + public static void displayNameString(FontRenderer font, int xSize, int yPositionOfMachineText, TileEntity tile){ + displayNameString(font, xSize, yPositionOfMachineText, tile.getDisplayName().getFormattedText()); } @SideOnly(Side.CLIENT) @@ -79,14 +94,12 @@ public class AssetUtil{ Minecraft.getMinecraft().getRenderItem().renderItemOverlayIntoGUI(mc.fontRendererObj, stack, 0, 0, null); mc.fontRendererObj.setUnicodeFlag(flagBefore); - //GL+MC+NEI suck - if(mc.currentScreen instanceof GuiBooklet || mc.currentScreen == null){ - RenderHelper.disableStandardItemLighting(); - } + RenderHelper.disableStandardItemLighting(); GlStateManager.popMatrix(); } //Copied from Gui.class and changed + @SideOnly(Side.CLIENT) public static void drawHorizontalGradientRect(int left, int top, int right, int bottom, int startColor, int endColor, float zLevel){ float f = (float)(startColor >> 24 & 255)/255.0F; float f1 = (float)(startColor >> 16 & 255)/255.0F; @@ -102,16 +115,92 @@ public class AssetUtil{ GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GlStateManager.shadeModel(7425); Tessellator tessellator = Tessellator.getInstance(); - WorldRenderer worldrenderer = tessellator.getWorldRenderer(); - worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); - worldrenderer.pos((double)left, (double)top, (double)zLevel).color(f1, f2, f3, f).endVertex(); - worldrenderer.pos((double)left, (double)bottom, (double)zLevel).color(f1, f2, f3, f).endVertex(); - worldrenderer.pos((double)right, (double)bottom, (double)zLevel).color(f5, f6, f7, f4).endVertex(); - worldrenderer.pos((double)right, (double)top, (double)zLevel).color(f5, f6, f7, f4).endVertex(); + VertexBuffer renderer = tessellator.getBuffer(); + renderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + renderer.pos((double)left, (double)top, (double)zLevel).color(f1, f2, f3, f).endVertex(); + renderer.pos((double)left, (double)bottom, (double)zLevel).color(f1, f2, f3, f).endVertex(); + renderer.pos((double)right, (double)bottom, (double)zLevel).color(f5, f6, f7, f4).endVertex(); + renderer.pos((double)right, (double)top, (double)zLevel).color(f5, f6, f7, f4).endVertex(); tessellator.draw(); GlStateManager.shadeModel(7424); GlStateManager.disableBlend(); GlStateManager.enableAlpha(); GlStateManager.enableTexture2D(); } + + @SideOnly(Side.CLIENT) + public static void renderNameTag(String tag, double x, double y, double z){ + FontRenderer fontrenderer = Minecraft.getMinecraft().fontRendererObj; + float f = 1.6F; + float f1 = 0.016666668F*f; + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); + GlStateManager.scale(-f1, -f1, f1); + GlStateManager.disableLighting(); + GlStateManager.depthMask(false); + GlStateManager.disableDepth(); + GlStateManager.enableBlend(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + Tessellator tessellator = Tessellator.getInstance(); + VertexBuffer renderer = tessellator.getBuffer(); + int i = 0; + int j = fontrenderer.getStringWidth(tag)/2; + GlStateManager.disableTexture2D(); + renderer.begin(7, DefaultVertexFormats.POSITION_COLOR); + renderer.pos((double)(-j-1), (double)(-1+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + renderer.pos((double)(-j-1), (double)(8+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + renderer.pos((double)(j+1), (double)(8+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + renderer.pos((double)(j+1), (double)(-1+i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag)/2, i, 553648127); + GlStateManager.enableDepth(); + GlStateManager.depthMask(true); + fontrenderer.drawString(tag, -fontrenderer.getStringWidth(tag)/2, i, -1); + GlStateManager.enableLighting(); + GlStateManager.disableBlend(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.popMatrix(); + } + + public static void shootParticles(World world, double startX, double startY, double startZ, double endX, double endY, double endZ, float[] color, int particleAmount, float particleSize){ + if(!world.isRemote){ + NBTTagCompound data = new NBTTagCompound(); + data.setDouble("StartX", startX); + data.setDouble("StartY", startY); + data.setDouble("StartZ", startZ); + data.setDouble("EndX", endX); + data.setDouble("EndY", endY); + data.setDouble("EndZ", endZ); + data.setFloat("Color1", color[0]); + data.setFloat("Color2", color[1]); + data.setFloat("Color3", color[2]); + data.setInteger("ParticleAmount", particleAmount); + data.setFloat("ParticleSize", particleSize); + data.setFloat("AgeMultiplier", 1F); + PacketHandler.theNetwork.sendToAllAround(new PacketServerToClient(data, PacketHandler.PARTICLE_HANDLER), new NetworkRegistry.TargetPoint(world.provider.getDimension(), startX, startY, startZ, 96)); + } + } + + @SideOnly(Side.CLIENT) + public static void renderParticlesFromAToB(double startX, double startY, double startZ, double endX, double endY, double endZ, int particleAmount, float particleSize, float[] color, float ageMultiplier){ + World world = Minecraft.getMinecraft().theWorld; + + if(Minecraft.getMinecraft().thePlayer.getDistance(startX, startY, startZ) <= 64 || Minecraft.getMinecraft().thePlayer.getDistance(endX, endY, endZ) <= 64){ + double difX = startX-endX; + double difY = startY-endY; + double difZ = startZ-endZ; + double distance = new Vec3d(startX, startY, startZ).distanceTo(new Vec3d(endX, endY, endZ)); + + for(int times = 0; times < Math.max(particleAmount/2, 1); times++){ + for(double i = 0; i <= 1; i += 1/(distance*particleAmount)){ + ParticleColored fx = new ParticleColored(world, (difX*i)+endX+0.5, (difY*i)+endY+0.5, (difZ*i)+endZ+0.5, particleSize, color[0], color[1], color[2], ageMultiplier); + Minecraft.getMinecraft().effectRenderer.addEffect(fx); + } + } + } + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java deleted file mode 100644 index cf56da7b2..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file ("FakePlayerUtil.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.util; - -import com.mojang.authlib.GameProfile; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.common.util.FakePlayerFactory; - -import java.util.UUID; - -public class FakePlayerUtil{ - - private static final String FAKE_NAME = "EllpecksActuallyAdditionsFakePlayer"; - private static final GameProfile FAKE_PROFILE = new GameProfile(UUID.nameUUIDFromBytes(FAKE_NAME.getBytes()), FAKE_NAME); - private static FakePlayer theFakePlayer; - - public static void info(){ - ModUtil.LOGGER.info(ModUtil.NAME+"' Fake Player: '"+FAKE_PROFILE.getName()+"', UUID: "+FAKE_PROFILE.getId()); - } - - public static FakePlayer getFakePlayer(World world){ - if(world instanceof WorldServer){ - if(theFakePlayer == null){ - theFakePlayer = FakePlayerFactory.get((WorldServer)world, FAKE_PROFILE); - } - return theFakePlayer; - } - else{ - return null; - } - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java index cc0bd4652..1112b9373 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FluidStateMapper.java @@ -1,19 +1,19 @@ /* - * This file ("FluidStateMapper.java") is part of the Actually Additions Mod for Minecraft. + * This file ("FluidStateMapper.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.util; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.ItemMeshDefinition; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMapperBase; -import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.Fluid; @@ -32,16 +32,18 @@ public class FluidStateMapper extends StateMapperBase implements ItemMeshDefinit public FluidStateMapper(Fluid fluid){ this.fluid = fluid; - this.location = new ModelResourceLocation(new ResourceLocation(ModUtil.MOD_ID_LOWER, "fluids"), fluid.getName()); + this.location = new ModelResourceLocation(new ResourceLocation(ModUtil.MOD_ID, "fluids"), fluid.getName()); } + @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state){ - return location; + return this.location; } + @Override public ModelResourceLocation getModelLocation(ItemStack stack){ - return location; + return this.location; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/IColorProvidingItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/IColorProvidingItem.java new file mode 100644 index 000000000..b28fd3e32 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/IColorProvidingItem.java @@ -0,0 +1,22 @@ +/* + * This file ("IColorProvidingItem.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.util; + +import net.minecraft.client.renderer.color.IItemColor; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public interface IColorProvidingItem{ + + @SideOnly(Side.CLIENT) + IItemColor getColor(); + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java index 63ad713fd..5c5c198ad 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java @@ -1,34 +1,64 @@ /* - * This file ("ItemUtil.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ItemUtil.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.util; +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; +import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; +import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.registry.GameRegistry; import java.util.List; -public class ItemUtil{ +public final class ItemUtil{ public static Item getItemFromName(String name){ ResourceLocation resLoc = new ResourceLocation(name); - if(Item.itemRegistry.containsKey(resLoc)){ - return Item.itemRegistry.getObject(resLoc); + if(Item.REGISTRY.containsKey(resLoc)){ + return Item.REGISTRY.getObject(resLoc); } return null; } + public static void registerBlock(Block block, ItemBlockBase itemBlock, String name, boolean addTab){ + block.setUnlocalizedName(ModUtil.MOD_ID+"."+name); + + block.setRegistryName(ModUtil.MOD_ID, name); + GameRegistry.register(block); + + itemBlock.setRegistryName(block.getRegistryName()); + GameRegistry.register(itemBlock); + + block.setCreativeTab(addTab ? CreativeTab.INSTANCE : null); + } + + public static void registerItem(Item item, String name, boolean addTab){ + item.setUnlocalizedName(ModUtil.MOD_ID+"."+name); + + item.setRegistryName(ModUtil.MOD_ID, name); + GameRegistry.register(item); + + item.setCreativeTab(addTab ? CreativeTab.INSTANCE : null); + + if(item instanceof IColorProvidingItem){ + ActuallyAdditions.proxy.addColoredItem(item); + } + } + /** * Returns true if array contains stack or if both contain null */ @@ -54,10 +84,6 @@ public class ItemUtil{ return stack1 != null && stack2 != null && (stack1.isItemEqual(stack2) || (checkWildcard && stack1.getItem() == stack2.getItem() && (stack1.getItemDamage() == Util.WILDCARD || stack2.getItemDamage() == Util.WILDCARD))); } - public static boolean areStacksEqualAndSameSize(ItemStack stack1, ItemStack stack2, boolean checkWildcard){ - return areItemsEqual(stack1, stack2, checkWildcard) && stack1.stackSize == stack2.stackSize; - } - /** * Returns true if list contains stack or if both contain null */ @@ -76,7 +102,7 @@ public class ItemUtil{ if(ench != null){ for(int i = 0; i < ench.tagCount(); i++){ short id = ench.getCompoundTagAt(i).getShort("id"); - if(id == e.effectId){ + if(id == Enchantment.getEnchantmentID(e)){ return true; } } @@ -89,7 +115,7 @@ public class ItemUtil{ if(ench != null){ for(int i = 0; i < ench.tagCount(); i++){ short id = ench.getCompoundTagAt(i).getShort("id"); - if(id == e.effectId){ + if(id == Enchantment.getEnchantmentID(e)){ ench.removeTag(i); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/KeyUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/KeyUtil.java deleted file mode 100644 index 33cb3886c..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/KeyUtil.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file ("KeyUtil.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.util; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import org.lwjgl.input.Keyboard; - -@SideOnly(Side.CLIENT) -public class KeyUtil{ - - public static boolean isShiftPressed(){ - return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); - } - - public static boolean isControlPressed(){ - return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); - } - - public static boolean isAltPressed(){ - return Keyboard.isKeyDown(Keyboard.KEY_LMENU) || Keyboard.isKeyDown(Keyboard.KEY_RMENU); - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java index 0f052f5e3..ddf051598 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java @@ -1,11 +1,11 @@ /* - * This file ("ModUtil.java") is part of the Actually Additions Mod for Minecraft. + * This file ("ModUtil.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.util; @@ -14,15 +14,14 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.util.Locale; - -public class ModUtil{ +public final class ModUtil{ public static final String VERSION = "@VERSION@"; //build.gradle public static final String MOD_ID = ActuallyAdditionsAPI.MOD_ID; public static final String NAME = "Actually Additions"; - public static final String MOD_ID_LOWER = MOD_ID.toLowerCase(Locale.ROOT); - - public static final Logger LOGGER = LogManager.getLogger(MOD_ID); + public static final Logger LOGGER = LogManager.getLogger(NAME); + private static final String PROXY_BASE = "de.ellpeck.actuallyadditions.mod.proxy."; + public static final String PROXY_CLIENT = PROXY_BASE+"ClientProxy"; + public static final String PROXY_SERVER = PROXY_BASE+"ServerProxy"; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java deleted file mode 100644 index cf56f862d..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This file ("PosUtil.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.util; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.util.BlockPos; -import net.minecraft.util.Vec3; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -public class PosUtil{ - - public static Material getMaterial(BlockPos pos, IBlockAccess world){ - return getBlock(pos, world).getMaterial(); - } - - public static Block getBlock(BlockPos pos, IBlockAccess world){ - if(pos != null){ - IBlockState state = world.getBlockState(pos); - if(state != null){ - return state.getBlock(); - } - } - return null; - } - - public static int getMetadata(BlockPos pos, IBlockAccess world){ - return getBlock(pos, world).getMetaFromState(world.getBlockState(pos)); - } - - public static BlockPos offset(BlockPos pos, int x, int y, int z){ - return new BlockPos(pos.getX()+x, pos.getY()+y, pos.getZ()+z); - } - - public static boolean setBlock(BlockPos pos, World world, Block block, int meta, int flag){ - return world.setBlockState(pos, block.getStateFromMeta(meta), flag); - } - - public static Vec3 toVec(BlockPos pos){ - return new Vec3(pos.getX(), pos.getY(), pos.getZ()); - } - - public static BlockPos copyPos(BlockPos pos){ - return new BlockPos(pos.getX(), pos.getY(), pos.getZ()); - } - - public static ItemBlock getItemBlock(BlockPos pos, IBlockAccess world){ - Item item = Item.getItemFromBlock(getBlock(pos, world)); - if(item instanceof ItemBlock){ - return (ItemBlock)item; - } - return null; - } - - public static void setMetadata(BlockPos pos, World world, int meta, int flag){ - world.setBlockState(pos, getBlock(pos, world).getStateFromMeta(meta), flag); - } - - public static boolean areSamePos(BlockPos first, BlockPos second){ - return first.getX() == second.getX() && first.getY() == second.getY() && first.getZ() == second.getZ(); - } -} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/RecipeUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/RecipeUtil.java new file mode 100644 index 000000000..084b5d91c --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/RecipeUtil.java @@ -0,0 +1,38 @@ +/* + * This file ("RecipeUtil.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.util; + +import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; +import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; +import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; + +import java.util.List; + +public final class RecipeUtil{ + + public static LensConversionRecipe lastReconstructorRecipe(){ + List list = ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES; + return list.get(list.size()-1); + } + + public static CrusherRecipe lastCrusherRecipe(){ + List list = ActuallyAdditionsAPI.CRUSHER_RECIPES; + return list.get(list.size()-1); + } + + public static IRecipe lastIRecipe(){ + List list = CraftingManager.getInstance().getRecipeList(); + Object recipe = list.get(list.size()-1); + return recipe instanceof IRecipe ? (IRecipe)recipe : null; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java index 1086099db..edd6df90d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java @@ -1,57 +1,45 @@ /* - * This file ("StringUtil.java") is part of the Actually Additions Mod for Minecraft. + * This file ("StringUtil.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.util; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.util.StatCollector; +import net.minecraft.util.text.translation.I18n; import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import java.util.List; -import java.util.Locale; -import java.util.Objects; -public class StringUtil{ +public final class StringUtil{ public static final int DECIMAL_COLOR_WHITE = 16777215; public static final int DECIMAL_COLOR_GRAY_TEXT = 4210752; - public static final String BUGGED_ITEM_NAME = ModUtil.MOD_ID_LOWER+".lolWutHowUDoDis"; + public static final String BUGGED_ITEM_NAME = ModUtil.MOD_ID+".lolWutHowUDoDis"; /** * Localizes a given String via StatCollector */ public static String localize(String text){ - return StatCollector.translateToLocal(text); + return I18n.translateToLocal(text); } /** * Localizes a given formatted String with the given Replacements */ public static String localizeFormatted(String text, Object... replace){ - return StatCollector.translateToLocalFormatted(text, replace); - } - - public static boolean equalsToLowerCase(String one, String two){ - return Objects.equals(toLowerCase(one), toLowerCase(two)); - } - - public static String toLowerCase(String string){ - if(string == null){ - return null; - } - else{ - return string.toLowerCase(Locale.ROOT); - } + return I18n.translateToLocalFormatted(text, replace); } + @SideOnly(Side.CLIENT) public static void drawSplitString(FontRenderer renderer, String strg, int x, int y, int width, int color, boolean shadow){ List list = renderer.listFormattedStringToWidth(strg, width); for(int i = 0; i < list.size(); i++){ @@ -60,6 +48,7 @@ public class StringUtil{ } } + @SideOnly(Side.CLIENT) public static String getFluidInfo(FluidTank tank){ return tank.getFluid() == null || tank.getFluid().getFluid() == null ? "0/"+tank.getCapacity()+" mB" : tank.getFluidAmount()+"/"+tank.getCapacity()+" mB "+tank.getFluid().getLocalizedName(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java index fff61d9e6..39e04a976 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java @@ -1,59 +1,48 @@ /* - * This file ("Util.java") is part of the Actually Additions Mod for Minecraft. + * This file ("Util.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.util; -import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; -import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; -import de.ellpeck.actuallyadditions.api.recipe.LensNoneRecipe; -import net.minecraft.block.BlockDispenser; -import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.text.TextFormatting; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.oredict.OreDictionary; -import java.util.List; +import java.util.Locale; import java.util.Random; -@SuppressWarnings("unused") -public class Util{ +public final class Util{ public static final Random RANDOM = new Random(); public static final int WILDCARD = OreDictionary.WILDCARD_VALUE; + public static final int BUCKET = Fluid.BUCKET_VOLUME; - public static final EnumRarity CRYSTAL_RED_RARITY = EnumHelper.addRarity(ModUtil.MOD_ID_LOWER+"crystalRed", EnumChatFormatting.DARK_RED, ModUtil.NAME+" Red Crystal"); - public static final EnumRarity CRYSTAL_BLUE_RARITY = EnumHelper.addRarity(ModUtil.MOD_ID_LOWER+"crystalBlue", EnumChatFormatting.DARK_BLUE, ModUtil.NAME+" Blue Crystal"); - public static final EnumRarity CRYSTAL_LIGHT_BLUE_RARITY = EnumHelper.addRarity(ModUtil.MOD_ID_LOWER+"crystalLightBlue", EnumChatFormatting.BLUE, ModUtil.NAME+" Light Blue Crystal"); - public static final EnumRarity CRYSTAL_BLACK_RARITY = EnumHelper.addRarity(ModUtil.MOD_ID_LOWER+"crystalBlack", EnumChatFormatting.DARK_GRAY, ModUtil.NAME+" Black Crystal"); - public static final EnumRarity CRYSTAL_GREEN_RARITY = EnumHelper.addRarity(ModUtil.MOD_ID_LOWER+"crystalGreen", EnumChatFormatting.DARK_GREEN, ModUtil.NAME+" Green Crystal"); - public static final EnumRarity CRYSTAL_WHITE_RARITY = EnumHelper.addRarity(ModUtil.MOD_ID_LOWER+"crystalWhite", EnumChatFormatting.GRAY, ModUtil.NAME+" White Crystal"); + public static final EnumRarity CRYSTAL_RED_RARITY = addRarity("crystalRed", TextFormatting.DARK_RED, ModUtil.NAME+" Red Crystal"); + public static final EnumRarity CRYSTAL_BLUE_RARITY = addRarity("crystalBlue", TextFormatting.DARK_BLUE, ModUtil.NAME+" Blue Crystal"); + public static final EnumRarity CRYSTAL_LIGHT_BLUE_RARITY = addRarity("crystalLightBlue", TextFormatting.BLUE, ModUtil.NAME+" Light Blue Crystal"); + public static final EnumRarity CRYSTAL_BLACK_RARITY = addRarity("crystalBlack", TextFormatting.DARK_GRAY, ModUtil.NAME+" Black Crystal"); + public static final EnumRarity CRYSTAL_GREEN_RARITY = addRarity("crystalGreen", TextFormatting.DARK_GREEN, ModUtil.NAME+" Green Crystal"); + public static final EnumRarity CRYSTAL_WHITE_RARITY = addRarity("crystalWhite", TextFormatting.GRAY, ModUtil.NAME+" White Crystal"); - public static final EnumRarity FALLBACK_RARITY = EnumHelper.addRarity(ModUtil.MOD_ID_LOWER+".fallback", EnumChatFormatting.STRIKETHROUGH, ModUtil.NAME+" Fallback"); + public static final EnumRarity FALLBACK_RARITY = addRarity("fallback", TextFormatting.STRIKETHROUGH, ModUtil.NAME+" Fallback"); - public static void registerEvent(Object o){ - MinecraftForge.EVENT_BUS.register(o); + private static EnumRarity addRarity(String name, TextFormatting color, String displayName){ + return EnumHelper.addRarity((ModUtil.MOD_ID+"_"+name).toUpperCase(Locale.ROOT), color, displayName); } public static boolean isDevVersion(){ return ModUtil.VERSION.equals("@VERSION@"); } - public static void registerDispenserHandler(Item item, BehaviorDefaultDispenseItem handler){ - BlockDispenser.dispenseBehaviorRegistry.putObject(item, handler); - } - public static int arrayContains(Object[] array, Object obj){ if(obj != null){ for(int i = 0; i < array.length; i++){ @@ -64,32 +53,4 @@ public class Util{ } return -1; } - - public static int arrayContains(int[] array, int num){ - for(int i = 0; i < array.length; i++){ - if(num == array[i]){ - return i; - } - } - return -1; - } - - public static class GetRecipes{ - - public static LensNoneRecipe lastReconstructorRecipe(){ - List list = ActuallyAdditionsAPI.reconstructorLensNoneRecipes; - return list.get(list.size()-1); - } - - public static CrusherRecipe lastCrusherRecipe(){ - List list = ActuallyAdditionsAPI.crusherRecipes; - return list.get(list.size()-1); - } - - public static IRecipe lastIRecipe(){ - List list = CraftingManager.getInstance().getRecipeList(); - Object recipe = list.get(list.size()-1); - return recipe instanceof IRecipe ? (IRecipe)recipe : null; - } - } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index a0a47372c..ac4c13168 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -1,17 +1,19 @@ /* - * This file ("WorldUtil.java") is part of the Actually Additions Mod for Minecraft. + * This file ("WorldUtil.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ package de.ellpeck.actuallyadditions.mod.util; -import cofh.api.energy.EnergyStorage; +import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.block.material.Material; @@ -22,64 +24,105 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; +import net.minecraft.init.Enchantments; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; -import net.minecraft.network.play.client.C07PacketPlayerDigging; -import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.client.CPacketPlayerDigging; +import net.minecraft.network.play.server.SPacketBlockChange; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.*; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.IPlantable; -import net.minecraftforge.fluids.*; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.common.util.FakePlayerFactory; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidBlock; +import net.minecraftforge.fluids.IFluidContainerItem; +import net.minecraftforge.fluids.capability.CapabilityFluidHandler; +import net.minecraftforge.fluids.capability.IFluidHandler; import java.util.ArrayList; +import java.util.List; -public class WorldUtil{ +public final class WorldUtil{ - public static void breakBlockAtSide(EnumFacing side, World world, BlockPos pos){ - breakBlockAtSide(side, world, pos, 0); - } + public static void doEnergyInteraction(TileEntity tile){ + for(EnumFacing side : EnumFacing.values()){ + TileEntity otherTile = tile.getWorld().getTileEntity(tile.getPos().offset(side)); + if(otherTile != null){ + IEnergyReceiver handlerTo = null; + IEnergyProvider handlerFrom = null; - public static void breakBlockAtSide(EnumFacing side, World world, BlockPos pos, int offset){ - BlockPos c = getCoordsFromSide(side, pos, offset); - if(c != null){ - world.setBlockToAir(c); - } - } + //Push RF + if(tile instanceof IEnergyProvider && otherTile instanceof IEnergyReceiver){ + handlerTo = (IEnergyReceiver)otherTile; + handlerFrom = (IEnergyProvider)tile; + } + //Pull RF + else if(tile instanceof IEnergyReceiver && otherTile instanceof IEnergyProvider){ + handlerTo = (IEnergyReceiver)tile; + handlerFrom = (IEnergyProvider)otherTile; + } - public static BlockPos getCoordsFromSide(EnumFacing side, BlockPos pos, int offset){ - return new BlockPos(pos.getX()+side.getFrontOffsetX()*(offset+1), pos.getY()+side.getFrontOffsetY()*(offset+1), pos.getZ()+side.getFrontOffsetZ()*(offset+1)); - } - - public static void pushEnergyToAllSides(World world, BlockPos pos, EnergyStorage storage){ - pushEnergy(world, pos, EnumFacing.UP, storage); - pushEnergy(world, pos, EnumFacing.DOWN, storage); - pushEnergy(world, pos, EnumFacing.NORTH, storage); - pushEnergy(world, pos, EnumFacing.EAST, storage); - pushEnergy(world, pos, EnumFacing.SOUTH, storage); - pushEnergy(world, pos, EnumFacing.WEST, storage); - } - - public static void pushEnergy(World world, BlockPos pos, EnumFacing side, EnergyStorage storage){ - TileEntity tile = getTileEntityFromSide(side, world, pos); - if(tile != null && tile instanceof IEnergyReceiver && storage.getEnergyStored() > 0){ - if(((IEnergyReceiver)tile).canConnectEnergy(side.getOpposite())){ - int receive = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), Math.min(storage.getMaxExtract(), storage.getEnergyStored()), false); - storage.extractEnergy(receive, false); + if(handlerFrom != null && handlerTo != null){ + int drain = handlerFrom.extractEnergy(side, Integer.MAX_VALUE, true); + if(drain > 0){ + if(handlerTo.canConnectEnergy(side.getOpposite())){ + int filled = handlerTo.receiveEnergy(side.getOpposite(), drain, false); + handlerFrom.extractEnergy(side, filled, false); + } + } + } + else if(TileEntityBase.teslaLoaded){ + TeslaUtil.doTeslaInteraction(tile, otherTile, side); + } } } } - public static TileEntity getTileEntityFromSide(EnumFacing side, World world, BlockPos pos){ - BlockPos c = getCoordsFromSide(side, pos, 0); - if(c != null){ - return world.getTileEntity(c); + public static void doFluidInteraction(TileEntity tile){ + for(EnumFacing side : EnumFacing.values()){ + TileEntity otherTile = tile.getWorld().getTileEntity(tile.getPos().offset(side)); + if(otherTile != null){ + for(int i = 0; i < 2; i++){ + //Push and pull with old fluid system + if(tile instanceof net.minecraftforge.fluids.IFluidHandler && otherTile instanceof net.minecraftforge.fluids.IFluidHandler){ + net.minecraftforge.fluids.IFluidHandler handlerTo = (net.minecraftforge.fluids.IFluidHandler)(i == 0 ? tile : otherTile); + net.minecraftforge.fluids.IFluidHandler handlerFrom = (net.minecraftforge.fluids.IFluidHandler)(i == 0 ? otherTile : tile); + FluidStack drain = handlerFrom.drain(side, Integer.MAX_VALUE, false); + if(drain != null){ + if(handlerTo.canFill(side.getOpposite(), drain.getFluid())){ + int filled = handlerTo.fill(side.getOpposite(), drain.copy(), true); + handlerFrom.drain(side, filled, true); + break; + } + } + } + //Push and pull with new fluid system + else{ + IFluidHandler handlerFrom = (i == 0 ? tile : otherTile).getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, i == 0 ? side : side.getOpposite()); + IFluidHandler handlerTo = (i == 0 ? otherTile : tile).getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, i == 0 ? side.getOpposite() : side); + if(handlerFrom != null && handlerTo != null){ + FluidStack drain = handlerFrom.drain(Integer.MAX_VALUE, false); + if(drain != null){ + int filled = handlerTo.fill(drain.copy(), true); + handlerFrom.drain(filled, true); + break; + } + } + } + } + } } - return null; } /** @@ -93,127 +136,77 @@ public class WorldUtil{ */ public static boolean hasBlocksInPlacesGiven(BlockPos[] positions, Block block, int meta, World world){ for(BlockPos pos : positions){ - if(!(PosUtil.getBlock(pos, world) == block && PosUtil.getMetadata(pos, world) == meta)){ + IBlockState state = world.getBlockState(pos); + if(!(state.getBlock() == block && block.getMetaFromState(state) == meta)){ return false; } } return true; } - public static void pushFluid(World world, BlockPos pos, EnumFacing side, FluidTank tank){ - TileEntity tile = getTileEntityFromSide(side, world, pos); - if(tile != null && tank.getFluid() != null && tile instanceof IFluidHandler){ - if(((IFluidHandler)tile).canFill(side.getOpposite(), tank.getFluid().getFluid())){ - int receive = ((IFluidHandler)tile).fill(side.getOpposite(), tank.getFluid(), true); - tank.drain(receive, true); - } - } - } - public static ItemStack useItemAtSide(EnumFacing side, World world, BlockPos pos, ItemStack stack){ if(world instanceof WorldServer && stack != null && stack.getItem() != null){ BlockPos offsetPos = pos.offset(side); - Block block = PosUtil.getBlock(offsetPos, world); + IBlockState state = world.getBlockState(offsetPos); + Block block = state.getBlock(); boolean replaceable = block.isReplaceable(world, offsetPos); //Fluids - if(replaceable && FluidContainerRegistry.isFilledContainer(stack) && !(block instanceof IFluidBlock) && !(block instanceof BlockLiquid)){ - FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(stack); - if(fluid != null && fluid.getFluid().getBlock() != null && fluid.getFluid().getBlock().canPlaceBlockAt(world, offsetPos)){ - if(PosUtil.setBlock(offsetPos, world, fluid.getFluid().getBlock(), 0, 2)){ + if(replaceable && !(block instanceof IFluidBlock) && !(block instanceof BlockLiquid)){ + FluidStack fluid = null; + if(FluidContainerRegistry.isFilledContainer(stack)){ + fluid = FluidContainerRegistry.getFluidForFilledItem(stack); + } + else if(stack.getItem() instanceof IFluidContainerItem){ + fluid = ((IFluidContainerItem)stack.getItem()).getFluid(stack); + } + + if(fluid != null && fluid.amount >= Util.BUCKET && fluid.getFluid().getBlock() != null && fluid.getFluid().getBlock().canPlaceBlockAt(world, offsetPos)){ + if(world.setBlockState(offsetPos, fluid.getFluid().getBlock().getDefaultState(), 2)){ return stack.getItem().getContainerItem(stack); } } } //Redstone - else if(replaceable && stack.getItem() == Items.redstone){ - PosUtil.setBlock(offsetPos, world, Blocks.redstone_wire, 0, 2); + if(replaceable && stack.getItem() == Items.REDSTONE){ + world.setBlockState(offsetPos, Blocks.REDSTONE_WIRE.getDefaultState(), 2); stack.stackSize--; + return stack; } //Plants - else if(replaceable && stack.getItem() instanceof IPlantable){ + if(replaceable && stack.getItem() instanceof IPlantable){ if(((IPlantable)stack.getItem()).getPlant(world, offsetPos).getBlock().canPlaceBlockAt(world, offsetPos)){ if(world.setBlockState(offsetPos, ((IPlantable)stack.getItem()).getPlant(world, offsetPos), 2)){ stack.stackSize--; + return stack; } } } //Everything else - else{ - try{ - stack.onItemUse(FakePlayerUtil.getFakePlayer(world), world, offsetPos, side.getOpposite(), 0.5F, 0.5F, 0.5F); + try{ + if(world instanceof WorldServer){ + FakePlayer fake = FakePlayerFactory.getMinecraft((WorldServer)world); + stack.onItemUse(fake, world, offsetPos, fake.getActiveHand(), side.getOpposite(), 0.5F, 0.5F, 0.5F); return stack; } - catch(Exception e){ - ModUtil.LOGGER.error("Something that places Blocks at "+offsetPos.getX()+", "+offsetPos.getY()+", "+offsetPos.getZ()+" in World "+world.provider.getDimensionId()+" threw an Exception! Don't let that happen again!", e); - } + } + catch(Exception e){ + ModUtil.LOGGER.error("Something that places Blocks at "+offsetPos.getX()+", "+offsetPos.getY()+", "+offsetPos.getZ()+" in World "+world.provider.getDimension()+" threw an Exception! Don't let that happen again!", e); } } return stack; } public static void dropItemAtSide(EnumFacing side, World world, BlockPos pos, ItemStack stack){ - BlockPos coords = getCoordsFromSide(side, pos, 0); - if(coords != null){ - EntityItem item = new EntityItem(world, coords.getX()+0.5, coords.getY()+0.5, coords.getZ()+0.5, stack); - item.motionX = 0; - item.motionY = 0; - item.motionZ = 0; - world.spawnEntityInWorld(item); - } - } - - public static void fillBucket(FluidTank tank, ItemStack[] slots, int inputSlot, int outputSlot){ - if(slots[inputSlot] != null && tank.getFluid() != null){ - ItemStack filled = FluidContainerRegistry.fillFluidContainer(tank.getFluid(), slots[inputSlot].copy()); - if(filled != null && FluidContainerRegistry.isEmptyContainer(slots[inputSlot]) && (slots[outputSlot] == null || (slots[outputSlot].isItemEqual(filled) && slots[outputSlot].stackSize < slots[outputSlot].getMaxStackSize()))){ - int cap = FluidContainerRegistry.getContainerCapacity(tank.getFluid(), slots[inputSlot]); - if(cap > 0 && cap <= tank.getFluidAmount()){ - if(slots[outputSlot] == null){ - slots[outputSlot] = FluidContainerRegistry.fillFluidContainer(tank.getFluid(), slots[inputSlot].copy()); - } - else{ - slots[outputSlot].stackSize++; - } - - if(slots[outputSlot] != null){ - tank.drain(cap, true); - slots[inputSlot].stackSize--; - if(slots[inputSlot].stackSize <= 0){ - slots[inputSlot] = null; - } - } - } - } - } - } - - public static void emptyBucket(FluidTank tank, ItemStack[] slots, int inputSlot, int outputSlot){ - emptyBucket(tank, slots, inputSlot, outputSlot, null); - } - - public static void emptyBucket(FluidTank tank, ItemStack[] slots, int inputSlot, int outputSlot, Fluid containedFluid){ - if(slots[inputSlot] != null && FluidContainerRegistry.isFilledContainer(slots[inputSlot]) && (slots[outputSlot] == null || (slots[outputSlot].isItemEqual(FluidContainerRegistry.drainFluidContainer(slots[inputSlot].copy())) && slots[outputSlot].stackSize < slots[outputSlot].getMaxStackSize()))){ - if(containedFluid == null || FluidContainerRegistry.containsFluid(slots[inputSlot], new FluidStack(containedFluid, 0))){ - if((tank.getFluid() == null || FluidContainerRegistry.getFluidForFilledItem(slots[inputSlot]).isFluidEqual(tank.getFluid())) && tank.getCapacity()-tank.getFluidAmount() >= FluidContainerRegistry.getContainerCapacity(slots[inputSlot])){ - if(slots[outputSlot] == null){ - slots[outputSlot] = FluidContainerRegistry.drainFluidContainer(slots[inputSlot].copy()); - } - else{ - slots[outputSlot].stackSize++; - } - - tank.fill(FluidContainerRegistry.getFluidForFilledItem(slots[inputSlot]), true); - slots[inputSlot].stackSize--; - if(slots[inputSlot].stackSize <= 0){ - slots[inputSlot] = null; - } - } - } - } + BlockPos coords = pos.offset(side); + EntityItem item = new EntityItem(world, coords.getX()+0.5, coords.getY()+0.5, coords.getZ()+0.5, stack); + item.motionX = 0; + item.motionY = 0; + item.motionZ = 0; + world.spawnEntityInWorld(item); } public static EnumFacing getDirectionBySidesInOrder(int side){ @@ -239,23 +232,22 @@ public class WorldUtil{ public static ArrayList getMaterialsAround(World world, BlockPos pos){ ArrayList blocks = new ArrayList(); - blocks.add(PosUtil.getMaterial(pos.offset(EnumFacing.NORTH), world)); - blocks.add(PosUtil.getMaterial(pos.offset(EnumFacing.EAST), world)); - blocks.add(PosUtil.getMaterial(pos.offset(EnumFacing.SOUTH), world)); - blocks.add(PosUtil.getMaterial(pos.offset(EnumFacing.WEST), world)); + blocks.add(world.getBlockState(pos.offset(EnumFacing.NORTH)).getMaterial()); + blocks.add(world.getBlockState(pos.offset(EnumFacing.EAST)).getMaterial()); + blocks.add(world.getBlockState(pos.offset(EnumFacing.SOUTH)).getMaterial()); + blocks.add(world.getBlockState(pos.offset(EnumFacing.WEST)).getMaterial()); return blocks; } - //TODO make this work for the stupid new item system - - public static boolean addToInventory(IInventory inventory, ArrayList stacks, boolean actuallyDo, boolean shouldAlwaysWork){ + public static boolean addToInventory(IInventory inventory, List stacks, boolean actuallyDo, boolean shouldAlwaysWork){ return addToInventory(inventory, stacks, EnumFacing.UP, actuallyDo, shouldAlwaysWork); } - public static boolean addToInventory(IInventory inventory, ArrayList stacks, EnumFacing side, boolean actuallyDo, boolean shouldAlwaysWork){ + public static boolean addToInventory(IInventory inventory, List stacks, EnumFacing side, boolean actuallyDo, boolean shouldAlwaysWork){ return addToInventory(inventory, 0, inventory.getSizeInventory(), stacks, side, actuallyDo, shouldAlwaysWork); } + //TODO This is disgusting and has to be updated to the capability system /** * Add an ArrayList of ItemStacks to an Array of slots * @@ -265,7 +257,7 @@ public class WorldUtil{ * @param actuallyDo Do it or just test if it works? * @return Does it work? */ - public static boolean addToInventory(IInventory inventory, int start, int end, ArrayList stacks, EnumFacing side, boolean actuallyDo, boolean shouldAlwaysWork){ + public static boolean addToInventory(IInventory inventory, int start, int end, List stacks, EnumFacing side, boolean actuallyDo, boolean shouldAlwaysWork){ //Copy the slots if just testing to later load them again ItemStack[] backupSlots = null; if(!actuallyDo){ @@ -299,7 +291,7 @@ public class WorldUtil{ } //Load the slots again - if(!actuallyDo && backupSlots != null){ + if(!actuallyDo){ for(int i = 0; i < backupSlots.length; i++){ inventory.setInventorySlotContents(i, backupSlots[i]); } @@ -317,29 +309,33 @@ public class WorldUtil{ return 0; } - public static MovingObjectPosition getNearestPositionWithAir(World world, EntityPlayer player, int reach){ + public static RayTraceResult getNearestPositionWithAir(World world, EntityPlayer player, int reach){ return getMovingObjectPosWithReachDistance(world, player, reach, false, false, true); } - private static MovingObjectPosition getMovingObjectPosWithReachDistance(World world, EntityPlayer player, double distance, boolean p1, boolean p2, boolean p3){ + private static RayTraceResult getMovingObjectPosWithReachDistance(World world, EntityPlayer player, double distance, boolean p1, boolean p2, boolean p3){ float f = player.rotationPitch; float f1 = player.rotationYaw; double d0 = player.posX; double d1 = player.posY+(double)player.getEyeHeight(); double d2 = player.posZ; - Vec3 vec3 = new Vec3(d0, d1, d2); + Vec3d vec3 = new Vec3d(d0, d1, d2); float f2 = MathHelper.cos(-f1*0.017453292F-(float)Math.PI); float f3 = MathHelper.sin(-f1*0.017453292F-(float)Math.PI); float f4 = -MathHelper.cos(-f*0.017453292F); float f5 = MathHelper.sin(-f*0.017453292F); float f6 = f3*f4; float f7 = f2*f4; - Vec3 vec31 = vec3.addVector((double)f6*distance, (double)f5*distance, (double)f7*distance); + Vec3d vec31 = vec3.addVector((double)f6*distance, (double)f5*distance, (double)f7*distance); return world.rayTraceBlocks(vec3, vec31, p1, p2, p3); } - public static MovingObjectPosition getNearestBlockWithDefaultReachDistance(World world, EntityPlayer player){ - return getMovingObjectPosWithReachDistance(world, player, player instanceof EntityPlayerMP ? ((EntityPlayerMP)player).theItemInWorldManager.getBlockReachDistance() : 5.0D, false, true, false); + public static RayTraceResult getNearestBlockWithDefaultReachDistance(World world, EntityPlayer player){ + return getNearestBlockWithDefaultReachDistance(world, player, false, true, false); + } + + public static RayTraceResult getNearestBlockWithDefaultReachDistance(World world, EntityPlayer player, boolean stopOnLiquids, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock){ + return getMovingObjectPosWithReachDistance(world, player, player instanceof EntityPlayerMP ? ((EntityPlayerMP)player).interactionManager.getBlockReachDistance() : 5.0D, stopOnLiquids, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock); } /** @@ -350,17 +346,28 @@ public class WorldUtil{ * @return If the Block could be harvested normally (so that it drops an item) */ public static boolean playerHarvestBlock(World world, BlockPos pos, EntityPlayer player){ - Block block = PosUtil.getBlock(pos, world); IBlockState state = world.getBlockState(pos); - int meta = PosUtil.getMetadata(pos, world); + if(state == null){ + return false; + } + + Block block = state.getBlock(); + if(block == null){ + return false; + } + TileEntity tile = world.getTileEntity(pos); + ItemStack stack = player.getHeldItemMainhand(); + //If the Block can be harvested or not boolean canHarvest = block.canHarvestBlock(world, pos, player); //Send Block Breaking Event + int xp = -1; if(player instanceof EntityPlayerMP){ - int event = ForgeHooks.onBlockBreakEvent(world, ((EntityPlayerMP)player).theItemInWorldManager.getGameType(), (EntityPlayerMP)player, pos); - if(event == -1){ + EntityPlayerMP playerMP = (EntityPlayerMP)player; + xp = ForgeHooks.onBlockBreakEvent(world, playerMP.interactionManager.getGameType(), playerMP, pos); + if(xp == -1){ return false; } } @@ -371,11 +378,11 @@ public class WorldUtil{ } else{ //Shows the Harvest Particles and plays the Block's Sound - world.playAuxSFX(2001, pos, Block.getStateId(state)); + world.playEvent(2001, pos, Block.getStateId(state)); } //If the Block was actually "removed", meaning it will drop an Item - boolean removed = block.removedByPlayer(world, pos, player, canHarvest); + boolean removed = block.removedByPlayer(state, world, pos, player, canHarvest); //Actually removes the Block from the World if(removed){ //Before the Block is destroyed, special cases @@ -384,12 +391,13 @@ public class WorldUtil{ if(!world.isRemote && !player.capabilities.isCreativeMode){ //Actually drops the Block's Items etc. if(canHarvest){ - block.harvestBlock(world, player, pos, state, tile); + block.harvestBlock(world, player, pos, state, tile, stack); } //Only drop XP when no Silk Touch is applied - if(!EnchantmentHelper.getSilkTouchModifier(player)){ - //Drop XP depending on Fortune Level - block.dropXpOnBlockBreak(world, pos, block.getExpDrop(world, pos, EnchantmentHelper.getFortuneModifier(player))); + if(EnchantmentHelper.getEnchantmentLevel(Enchantments.SILK_TOUCH, stack) <= 0){ + if(xp >= 0){ + block.dropXpOnBlockBreak(world, pos, xp); + } } } } @@ -397,13 +405,14 @@ public class WorldUtil{ if(!world.isRemote){ //Update the Client of a Block Change if(player instanceof EntityPlayerMP){ - ((EntityPlayerMP)player).playerNetServerHandler.sendPacket(new S23PacketBlockChange(world, pos)); + ((EntityPlayerMP)player).connection.sendPacket(new SPacketBlockChange(world, pos)); } } else{ //Check the Server if a Block that changed on the Client really changed, if not, revert the change - Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, Minecraft.getMinecraft().objectMouseOver.sideHit)); + Minecraft.getMinecraft().getConnection().sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, Minecraft.getMinecraft().objectMouseOver.sideHit)); } + return removed; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/CompatUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/CompatUtil.java similarity index 67% rename from src/main/java/de/ellpeck/actuallyadditions/mod/util/CompatUtil.java rename to src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/CompatUtil.java index 6a3a9e63e..c53476593 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/CompatUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/CompatUtil.java @@ -1,36 +1,35 @@ /* - * This file ("CompatUtil.java") is part of the Actually Additions Mod for Minecraft. + * This file ("CompatUtil.java") is part of the Actually Additions mod for Minecraft. * It is created and owned by Ellpeck and distributed * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ + * http://ellpeck.de/actaddlicense * View the source code at https://github.com/Ellpeck/ActuallyAdditions * - * © 2016 Ellpeck + * © 2015-2016 Ellpeck */ -package de.ellpeck.actuallyadditions.mod.util; +package de.ellpeck.actuallyadditions.mod.util.compat; -import de.ellpeck.actuallyadditions.mod.items.base.ItemSeed; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fml.common.event.FMLInterModComms; -public class CompatUtil{ +public final class CompatUtil{ public static void registerMFRPlant(Block block){ FMLInterModComms.sendMessage("MineFactoryReloaded", "registerHarvestable_Crop", new ItemStack(block, 1, 7)); NBTTagCompound compound = new NBTTagCompound(); - compound.setString("plant", block.getRegistryName()); + compound.setString("plant", block.getRegistryName().toString()); FMLInterModComms.sendMessage("MineFactoryReloaded", "registerFertilizable_Crop", compound); } - public static void registerMFRSeed(Item item){ + public static void registerMFRSeed(Item item, Block plant){ NBTTagCompound compound = new NBTTagCompound(); - compound.setString("seed", item.getRegistryName()); - compound.setString("crop", ((ItemSeed)item).plant.getRegistryName()); + compound.setString("seed", item.getRegistryName().toString()); + compound.setString("crop", plant.getRegistryName().toString()); FMLInterModComms.sendMessage("MineFactoryReloaded", "registerPlantable_Crop", compound); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaHandler.java new file mode 100644 index 000000000..cce74a315 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaHandler.java @@ -0,0 +1,71 @@ +/* + * This file ("TeslaHandler.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.util.compat; + +import cofh.api.energy.IEnergyHandler; +import cofh.api.energy.IEnergyProvider; +import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import net.darkhax.tesla.api.ITeslaConsumer; +import net.darkhax.tesla.api.ITeslaHolder; +import net.darkhax.tesla.api.ITeslaProducer; +import net.minecraft.util.EnumFacing; + +public class TeslaHandler implements ITeslaProducer, ITeslaHolder, ITeslaConsumer{ + + private final EnumFacing side; + private final TileEntityBase tile; + + public TeslaHandler(TileEntityBase tile, EnumFacing side){ + this.tile = tile; + this.side = side; + } + + @Override + public long givePower(long power, boolean simulated){ + if(this.tile instanceof IEnergyReceiver){ + return ((IEnergyReceiver)this.tile).receiveEnergy(this.side, (int)power, simulated); + } + else{ + return 0; + } + } + + @Override + public long getStoredPower(){ + if(this.tile instanceof IEnergyHandler){ + return ((IEnergyHandler)this.tile).getEnergyStored(this.side); + } + else{ + return 0; + } + } + + @Override + public long getCapacity(){ + if(this.tile instanceof IEnergyHandler){ + return ((IEnergyHandler)this.tile).getMaxEnergyStored(this.side); + } + else{ + return 0; + } + } + + @Override + public long takePower(long power, boolean simulated){ + if(this.tile instanceof IEnergyProvider){ + return ((IEnergyProvider)this.tile).extractEnergy(this.side, (int)power, simulated); + } + else{ + return 0; + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaUtil.java new file mode 100644 index 000000000..1ec8dce72 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaUtil.java @@ -0,0 +1,84 @@ +/* + * This file ("TeslaUtil.java") is part of the Actually Additions mod for Minecraft. + * It is created and owned by Ellpeck and distributed + * under the Actually Additions License to be found at + * http://ellpeck.de/actaddlicense + * View the source code at https://github.com/Ellpeck/ActuallyAdditions + * + * © 2015-2016 Ellpeck + */ + +package de.ellpeck.actuallyadditions.mod.util.compat; + +import cofh.api.energy.IEnergyHandler; +import cofh.api.energy.IEnergyProvider; +import cofh.api.energy.IEnergyReceiver; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import net.darkhax.tesla.api.ITeslaConsumer; +import net.darkhax.tesla.api.ITeslaHolder; +import net.darkhax.tesla.api.ITeslaProducer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.capabilities.CapabilityInject; + +import java.util.HashMap; +import java.util.Map; + +public final class TeslaUtil{ + + private static final Map TESLA_MAP = new HashMap(); + @CapabilityInject(ITeslaConsumer.class) + public static Capability teslaConsumer; + @CapabilityInject(ITeslaProducer.class) + public static Capability teslaProducer; + @CapabilityInject(ITeslaHolder.class) + public static Capability teslaHolder; + + public static T getTeslaCapability(TileEntityBase tile, Capability capability, EnumFacing facing){ + boolean receive = tile instanceof IEnergyReceiver && capability == teslaConsumer; + boolean provide = tile instanceof IEnergyProvider && capability == teslaProducer; + boolean hold = tile instanceof IEnergyHandler && capability == teslaHolder; + if(receive || provide || hold){ + return (T)getHandler(tile, facing); + } + else{ + return null; + } + } + + public static void doTeslaInteraction(TileEntity tile, TileEntity otherTile, EnumFacing side){ + ITeslaConsumer handlerTo = null; + ITeslaProducer handlerFrom = null; + + for(int i = 0; i < 2; i++){ + if(handlerFrom == null && handlerTo == null){ + handlerFrom = (i == 0 ? tile : otherTile).getCapability(teslaProducer, i == 0 ? side : side.getOpposite()); + handlerTo = (i == 0 ? otherTile : tile).getCapability(teslaConsumer, i == 0 ? side.getOpposite() : side); + } + } + + if(handlerFrom != null && handlerTo != null){ + long drain = handlerFrom.takePower(Long.MAX_VALUE, true); + if(drain > 0){ + long filled = handlerTo.givePower(drain, false); + handlerFrom.takePower(filled, false); + } + } + } + + private static TeslaHandler getHandler(TileEntityBase tile, EnumFacing facing){ + TeslaHandler[] handlers = TESLA_MAP.get(tile); + if(handlers == null || handlers.length != 6){ + handlers = new TeslaHandler[6]; + TESLA_MAP.put(tile, handlers); + } + + int side = facing.ordinal(); + if(handlers[side] == null){ + handlers[side] = new TeslaHandler(tile, facing); + } + return handlers[side]; + } + +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/playerdata/PersistentClientData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/playerdata/PersistentClientData.java deleted file mode 100644 index 2b4ed115d..000000000 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/playerdata/PersistentClientData.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * This file ("PersistentClientData.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense/ - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2016 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.util.playerdata; - -import de.ellpeck.actuallyadditions.api.internal.EntrySet; -import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; -import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; -import de.ellpeck.actuallyadditions.mod.booklet.button.BookmarkButton; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; -import net.minecraft.client.Minecraft; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; - -@SideOnly(Side.CLIENT) -public class PersistentClientData{ - - private static File theFile; - - public static void saveBookPage(GuiBooklet gui){ - NBTTagCompound baseCompound = getBaseCompound(); - NBTTagCompound worldCompound = getCompoundForWorld(baseCompound); - //Save Entry etc. - if(worldCompound != null){ - worldCompound.setTag("SavedEntry", gui.currentEntrySet.writeToNBT()); - worldCompound.setString("SearchWord", gui.searchField.getText()); - } - - //Save Bookmarks - NBTTagList list = new NBTTagList(); - for(int i = 0; i < gui.bookmarkButtons.length; i++){ - BookmarkButton button = (BookmarkButton)gui.bookmarkButtons[i]; - - list.appendTag(button.assignedEntry.writeToNBT()); - } - worldCompound.setTag("Bookmarks", list); - - writeCompound(baseCompound, worldCompound); - } - - private static NBTTagCompound getBaseCompound(){ - try{ - return CompressedStreamTools.readCompressed(new FileInputStream(getTheFile())); - } - catch(Exception e){ - return new NBTTagCompound(); - } - } - - private static NBTTagCompound getCompoundForWorld(NBTTagCompound mainCompound){ - return mainCompound.getCompoundTag(getName()); - } - - private static void writeCompound(NBTTagCompound baseCompound, NBTTagCompound worldCompound){ - baseCompound.setTag(getName(), worldCompound); - try{ - CompressedStreamTools.writeCompressed(baseCompound, new FileOutputStream(getTheFile())); - } - catch(Exception e){ - ModUtil.LOGGER.fatal("Couldn't write Persistent Variable!", e); - } - } - - public static File getTheFile(){ - try{ - if(!theFile.exists()){ - theFile.createNewFile(); - } - } - catch(Exception e){ - ModUtil.LOGGER.fatal("Couldn't create Persistent Variables file!", e); - } - return theFile; - } - - private static String getName(){ - if(Minecraft.getMinecraft().theWorld != null){ - return Minecraft.getMinecraft().isIntegratedServerRunning() ? Minecraft.getMinecraft().getIntegratedServer().getFolderName() : Minecraft.getMinecraft().getCurrentServerData().serverIP; - } - else{ - return "Invalid"; - } - } - - public static void setTheFile(File file){ - theFile = file; - } - - public static void openLastBookPage(GuiBooklet gui){ - NBTTagCompound worldCompound = getCompoundForWorld(getBaseCompound()); - if(worldCompound != null){ - //Open Entry etc. - EntrySet set = EntrySet.readFromNBT(worldCompound.getCompoundTag("SavedEntry")); - if(set != null){ - - BookletUtils.openIndexEntry(gui, set.entry, set.pageInIndex, true); - if(set.chapter != null){ - BookletUtils.openChapter(gui, set.chapter, set.page); - } - - String searchText = worldCompound.getString("SearchWord"); - if(!searchText.isEmpty()){ - gui.searchField.setText(searchText); - BookletUtils.updateSearchBar(gui); - } - } - else{ - //If everything fails, initialize the front page - BookletUtils.openIndexEntry(gui, null, 1, true); - } - - //Load Bookmarks - NBTTagList list = worldCompound.getTagList("Bookmarks", 10); - if(list != null){ - for(int i = 0; i < list.tagCount(); i++){ - BookmarkButton button = (BookmarkButton)gui.bookmarkButtons[i]; - NBTTagCompound compound = list.getCompoundTagAt(i); - button.assignedEntry = EntrySet.readFromNBT(compound); - } - } - } - } - - public static void setBoolean(String name, boolean bool){ - NBTTagCompound baseCompound = getBaseCompound(); - NBTTagCompound worldCompound = getCompoundForWorld(baseCompound); - if(worldCompound != null){ - worldCompound.setBoolean(name, bool); - writeCompound(baseCompound, worldCompound); - } - } - - public static boolean getBoolean(String name){ - NBTTagCompound worldCompound = getCompoundForWorld(getBaseCompound()); - return worldCompound != null && worldCompound.getBoolean(name); - } -} diff --git a/src/main/java/invtweaks/api/IItemTree.java b/src/main/java/invtweaks/api/IItemTree.java deleted file mode 100644 index 5b6c0a805..000000000 --- a/src/main/java/invtweaks/api/IItemTree.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2013 Andrew Crocker - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package invtweaks.api; - -import java.util.Collection; -import java.util.List; -import java.util.Random; - -public interface IItemTree { - public void registerOre(String category, String name, String oreName, int order); - - boolean matches(List items, String keyword); - - boolean isKeywordValid(String keyword); - - Collection getAllCategories(); - - IItemTreeCategory getRootCategory(); - - IItemTreeCategory getCategory(String keyword); - - boolean isItemUnknown(String id, int damage); - - List getItems(String id, int damage); - - List getItems(String name); - - IItemTreeItem getRandomItem(Random r); - - boolean containsItem(String name); - - boolean containsCategory(String name); - - void setRootCategory(IItemTreeCategory category); - - IItemTreeCategory addCategory(String parentCategory, String newCategory) throws NullPointerException; - - void addCategory(String parentCategory, IItemTreeCategory newCategory) throws NullPointerException; - - IItemTreeItem addItem(String parentCategory, String name, String id, int damage, int order) - throws NullPointerException; - - void addItem(String parentCategory, IItemTreeItem newItem) throws NullPointerException; - - int getKeywordDepth(String keyword); - - int getKeywordOrder(String keyword); -} diff --git a/src/main/java/invtweaks/api/IItemTreeCategory.java b/src/main/java/invtweaks/api/IItemTreeCategory.java deleted file mode 100644 index f1b5e9554..000000000 --- a/src/main/java/invtweaks/api/IItemTreeCategory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2013 Andrew Crocker - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package invtweaks.api; - -import java.util.Collection; -import java.util.List; - -public interface IItemTreeCategory { - boolean contains(IItemTreeItem item); - - void addCategory(IItemTreeCategory category); - - void addItem(IItemTreeItem item); - - Collection getSubCategories(); - - Collection> getItems(); - - String getName(); - - int getCategoryOrder(); - - int findCategoryOrder(String keyword); - - int findKeywordDepth(String keyword); -} diff --git a/src/main/java/invtweaks/api/IItemTreeItem.java b/src/main/java/invtweaks/api/IItemTreeItem.java deleted file mode 100644 index 2b6ae2db5..000000000 --- a/src/main/java/invtweaks/api/IItemTreeItem.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2013 Andrew Crocker - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package invtweaks.api; - -public interface IItemTreeItem extends Comparable { - String getName(); - - String getId(); - - int getDamage(); - - int getOrder(); -} diff --git a/src/main/java/invtweaks/api/IItemTreeListener.java b/src/main/java/invtweaks/api/IItemTreeListener.java deleted file mode 100644 index 73a5815d5..000000000 --- a/src/main/java/invtweaks/api/IItemTreeListener.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2013 Andrew Crocker - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package invtweaks.api; - -import java.util.EventListener; - -public interface IItemTreeListener extends EventListener { - void onTreeLoaded(IItemTree tree); -} diff --git a/src/main/java/invtweaks/api/InvTweaksAPI.java b/src/main/java/invtweaks/api/InvTweaksAPI.java deleted file mode 100644 index 33f259e4d..000000000 --- a/src/main/java/invtweaks/api/InvTweaksAPI.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2013 Andrew Crocker - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package invtweaks.api; - -import invtweaks.api.container.ContainerSection; -import net.minecraft.item.ItemStack; - -/** - * Interface to access functions exposed by Inventory Tweaks - *

- * The main @Mod instance of the mod implements this interface, so a refernce to it can - * be obtained via @Instance("inventorytweaks") or methods in cpw.mods.fml.common.Loader - *

- * All of these functions currently have no effect if called on a dedicated server. - */ -public interface InvTweaksAPI { - /** - * Add a listener for ItemTree load events - * - * @param listener - */ - void addOnLoadListener(IItemTreeListener listener); - - /** - * Remove a listener for ItemTree load events - * - * @param listener - * @return true if the listener was previously added - */ - boolean removeOnLoadListener(IItemTreeListener listener); - - /** - * Toggle sorting shortcut state. - * - * @param enabled - */ - void setSortKeyEnabled(boolean enabled); - - /** - * Toggle sorting shortcut supression. - * Unlike setSortKeyEnabled, this flag is automatically cleared when GUIs are closed. - * - * @param enabled - */ - void setTextboxMode(boolean enabled); - - /** - * Compare two items using the default (non-rule based) algorithm, - * sutable for an implementation of Comparator<ItemStack>. - * - * @param i - * @param j - * @return A value with a sign representing the relative order of the item stacks - */ - int compareItems(ItemStack i, ItemStack j); - - /** - * Initiate a sort as if the player had clicked on a sorting button or pressed the sort key. - * - * @param section - * @param method - */ - void sort(ContainerSection section, SortingMethod method); -} diff --git a/src/main/java/invtweaks/api/SortingMethod.java b/src/main/java/invtweaks/api/SortingMethod.java deleted file mode 100644 index 895b1713d..000000000 --- a/src/main/java/invtweaks/api/SortingMethod.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2013 Andrew Crocker - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package invtweaks.api; - -public enum SortingMethod { - /** Standard 'r' sorting for generic inventories */ - DEFAULT, - /** Sort method creating vertical columns of items. - * Used for chests only, requires container to have a valid row size for correct results. - */ - VERTICAL, - /** Sort method creating horizontal rows of items. - * Used for chests only, requires container to have a valid row size for correct results. - */ - HORIZONTAL, - /** Sort method for player inventory. - * Applies to extra player-specified sorting rules for the main inventory. - * Will always operate on main inventory. - */ - INVENTORY, - /** Attempts to even the number of items in each stack of the same type of item, without moving full stacks. - * Used in crafting grid sorting. - */ - EVEN_STACKS, -} diff --git a/src/main/java/invtweaks/api/container/ChestContainer.java b/src/main/java/invtweaks/api/container/ChestContainer.java index e505829c1..9fa7dab7c 100644 --- a/src/main/java/invtweaks/api/container/ChestContainer.java +++ b/src/main/java/invtweaks/api/container/ChestContainer.java @@ -6,7 +6,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * A marker for containers that have a chest-like persistant storage component. Enables the Inventroy Tweaks sorting + * A marker for containers that have a chest-like persistent storage component. Enables the Inventory Tweaks sorting * buttons for this container. */ @Retention(RetentionPolicy.RUNTIME) @@ -26,13 +26,13 @@ public @interface ChestContainer { // Signature int func() @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) - public @interface RowSizeCallback { + @interface RowSizeCallback { } // Annotation for method to get size of a chest row if it is not a fixed size for this container class // Signature int func() @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) - public @interface IsLargeCallback { + @interface IsLargeCallback { } } diff --git a/src/main/java/invtweaks/api/container/ContainerSection.java b/src/main/java/invtweaks/api/container/ContainerSection.java deleted file mode 100644 index 83c2e08a4..000000000 --- a/src/main/java/invtweaks/api/container/ContainerSection.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2013 Andrew Crocker - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package invtweaks.api.container; - -/** - * Names for specific parts of containers. For unknown container types (such as mod containers), only INVENTORY and - * CHEST sections are available. - */ -public enum ContainerSection { - /** - * The player's inventory - */ - INVENTORY, - /** - * The player's inventory (only the hotbar) - */ - INVENTORY_HOTBAR, - /** - * The player's inventory (all except the hotbar) - */ - INVENTORY_NOT_HOTBAR, - /** - * The chest or dispenser contents. Also used for unknown container contents. - */ - CHEST, - /** - * The crafting input - */ - CRAFTING_IN, - /** - * The crafting input, for containters that store it internally - */ - CRAFTING_IN_PERSISTENT, - /** - * The crafting output - */ - CRAFTING_OUT, - /** - * The armor slots - */ - ARMOR, - /** - * The furnace input - */ - FURNACE_IN, - /** - * The furnace output - */ - FURNACE_OUT, - /** - * The furnace fuel - */ - FURNACE_FUEL, - /** - * The enchantment table slot - */ - ENCHANTMENT, - /** - * The three bottles slots in brewing tables - * NOTE: Do not use without also using BREWING_INGREDIENT. - */ - BREWING_BOTTLES, - /** - * The top slot in brewing tables - * NOTE: Do not use without also using BREWING_BOTTLES. - */ - BREWING_INGREDIENT -} diff --git a/src/main/java/invtweaks/api/container/ContainerSectionCallback.java b/src/main/java/invtweaks/api/container/ContainerSectionCallback.java deleted file mode 100644 index 379206b37..000000000 --- a/src/main/java/invtweaks/api/container/ContainerSectionCallback.java +++ /dev/null @@ -1,16 +0,0 @@ -package invtweaks.api.container; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * A marker for a method to call which returns the set of ContainerSections for this container. - *

- * Signature of the method should be Map> func() - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.METHOD) -public @interface ContainerSectionCallback { -} diff --git a/src/main/java/invtweaks/api/container/IgnoreContainer.java b/src/main/java/invtweaks/api/container/IgnoreContainer.java deleted file mode 100644 index 86e8aea12..000000000 --- a/src/main/java/invtweaks/api/container/IgnoreContainer.java +++ /dev/null @@ -1,15 +0,0 @@ -package invtweaks.api.container; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Use this annotation to override inherited annotation properties and mark a Container as unsortable. - * This effect is inherited as well. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface IgnoreContainer { -} diff --git a/src/main/java/invtweaks/api/container/InventoryContainer.java b/src/main/java/invtweaks/api/container/InventoryContainer.java deleted file mode 100644 index d5a45b912..000000000 --- a/src/main/java/invtweaks/api/container/InventoryContainer.java +++ /dev/null @@ -1,20 +0,0 @@ -package invtweaks.api.container; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * A marker for containers that need special treatment, such as crafting inputs or alternate player inventory positions, - * but do not have a chest-like component. - *

- * Does not enable the Inventory Tweaks sorting buttons for this container. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface InventoryContainer { - // Set to true if the Inventory Tweaks options button should be shown for this container. - // (For instance, if you are replacing a vanilla container such as the player's inventory) - boolean showOptions() default true; -} diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockAtomicReconstructor.json b/src/main/resources/assets/actuallyadditions/blockstates/blockAtomicReconstructor.json index 661455b79..323f41ede 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockAtomicReconstructor.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockAtomicReconstructor.json @@ -1,10 +1,28 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockAtomicReconstructor", + "down": "#particle", + "up": "actuallyadditions:blocks/blockAtomicReconstructorTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockAtomicReconstructorFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockAtomicReconstructor", "x": 90 }, - "meta=1": { "model": "actuallyadditions:blockAtomicReconstructor", "x": -90 }, - "meta=2": { "model": "actuallyadditions:blockAtomicReconstructor", "y": 0 }, - "meta=3": { "model": "actuallyadditions:blockAtomicReconstructor", "y": 180 }, - "meta=4": { "model": "actuallyadditions:blockAtomicReconstructor", "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockAtomicReconstructor", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x" : 90 }, + "1": { "x" : 270 }, + "2": { "y" : 0 }, + "3": { "y" : 180 }, + "4": { "y" : 270 }, + "5": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockBlackLotus.json b/src/main/resources/assets/actuallyadditions/blockstates/blockBlackLotus.json index 5f66277c0..746308517 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockBlackLotus.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockBlackLotus.json @@ -1,5 +1,14 @@ { - "variants": { - "normal": { "model": "actuallyadditions:blockBlackLotus" } - } -} + "forge_marker": 1, + "defaults": { + "model": "minecraft:cross", + "textures": { + "cross": "actuallyadditions:blocks/blockBlackLotus" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockBookletStand.json b/src/main/resources/assets/actuallyadditions/blockstates/blockBookletStand.json new file mode 100644 index 000000000..23f14b719 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockBookletStand.json @@ -0,0 +1,17 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockBookletStand", + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "y" : 270 }, + "1": { "y" : 90 }, + "2": { "y" : 180 }, + "3": { "y" : 0 } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockBreaker.json b/src/main/resources/assets/actuallyadditions/blockstates/blockBreaker.json index 396b125a6..141e4d1a9 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockBreaker.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockBreaker.json @@ -1,10 +1,28 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockBreaker", + "down": "#particle", + "up": "actuallyadditions:blocks/blockBreakerTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockBreakerFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockBreaker", "x": 90 }, - "meta=1": { "model": "actuallyadditions:blockBreaker", "x": -90 }, - "meta=2": { "model": "actuallyadditions:blockBreaker", "y": 0 }, - "meta=3": { "model": "actuallyadditions:blockBreaker", "y": 180 }, - "meta=4": { "model": "actuallyadditions:blockBreaker", "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockBreaker", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x" : 90 }, + "1": { "x" : 270 }, + "2": { "y" : 0 }, + "3": { "y" : 180 }, + "4": { "y" : 270 }, + "5": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockCanola.json b/src/main/resources/assets/actuallyadditions/blockstates/blockCanola.json index 2e1a8012b..292029962 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockCanola.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockCanola.json @@ -1,12 +1,23 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:crop", + "textures": { + "crop": "actuallyadditions:blocks/blockCanolaStage1" + } + }, "variants": { - "age=0": { "model": "actuallyadditions:blockCanolaStage1" }, - "age=1": { "model": "actuallyadditions:blockCanolaStage1" }, - "age=2": { "model": "actuallyadditions:blockCanolaStage2" }, - "age=3": { "model": "actuallyadditions:blockCanolaStage2" }, - "age=4": { "model": "actuallyadditions:blockCanolaStage2" }, - "age=5": { "model": "actuallyadditions:blockCanolaStage3" }, - "age=6": { "model": "actuallyadditions:blockCanolaStage3" }, - "age=7": { "model": "actuallyadditions:blockCanolaStage4" } + "normal": [{}], + "inventory": [{}], + "age": { + "0": { "textures": { "crop": "actuallyadditions:blocks/blockCanolaStage1" } }, + "1": { "textures": { "crop": "actuallyadditions:blocks/blockCanolaStage2" } }, + "2": { "textures": { "crop": "actuallyadditions:blocks/blockCanolaStage2" } }, + "3": { "textures": { "crop": "actuallyadditions:blocks/blockCanolaStage2" } }, + "4": { "textures": { "crop": "actuallyadditions:blocks/blockCanolaStage3" } }, + "5": { "textures": { "crop": "actuallyadditions:blocks/blockCanolaStage3" } }, + "6": { "textures": { "crop": "actuallyadditions:blocks/blockCanolaStage3" } }, + "7": { "textures": { "crop": "actuallyadditions:blocks/blockCanolaStage4" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockCanolaPress.json b/src/main/resources/assets/actuallyadditions/blockstates/blockCanolaPress.json index 81b6bb56e..e6e9fd014 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockCanolaPress.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockCanolaPress.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockCanolaPress", + "bottom": "#top", + "top": "actuallyadditions:blocks/blockCanolaPressTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockCanolaPress" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzSlab.json b/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzSlab.json index 47f319371..61816ef58 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzSlab.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzSlab.json @@ -1,6 +1,20 @@ { - "variants": { - "meta=0": { "model": "actuallyadditions:blockChiseledQuartzSlabBottom" }, - "meta=1": { "model": "actuallyadditions:blockChiseledQuartzSlabTop" } + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", + "top": "#bottom", + "side": "#bottom" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": {}, + "1": { "model": "minecraft:upper_slab" } } -} + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzStair.json b/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzStair.json index 059ecea9b..e64773e72 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzStair.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzStair.json @@ -1,44 +1,54 @@ { - "variants": { - "facing=east,half=bottom,shape=straight": { "model": "actuallyadditions:blockChiseledQuartzStairs" }, - "facing=west,half=bottom,shape=straight": { "model": "actuallyadditions:blockChiseledQuartzStairs", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=straight": { "model": "actuallyadditions:blockChiseledQuartzStairs", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=straight": { "model": "actuallyadditions:blockChiseledQuartzStairs", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter" }, - "facing=west,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter" }, - "facing=north,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "y": 180, "uvlock": true }, - "facing=east,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockChiseledQuartzStairsInner" }, - "facing=west,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockChiseledQuartzStairsInner" }, - "facing=north,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "y": 180, "uvlock": true }, - "facing=east,half=top,shape=straight": { "model": "actuallyadditions:blockChiseledQuartzStairs", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=straight": { "model": "actuallyadditions:blockChiseledQuartzStairs", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=straight": { "model": "actuallyadditions:blockChiseledQuartzStairs", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=straight": { "model": "actuallyadditions:blockChiseledQuartzStairs", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_right": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=outer_right": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=outer_right": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=outer_right": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_left": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=outer_left": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=outer_left": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=outer_left": { "model": "actuallyadditions:blockChiseledQuartzStairsOuter", "x": 180, "uvlock": true }, - "facing=east,half=top,shape=inner_right": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=inner_right": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=inner_right": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=inner_right": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=inner_left": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=inner_left": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=inner_left": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=inner_left": { "model": "actuallyadditions:blockChiseledQuartzStairsInner", "x": 180, "uvlock": true } + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", + "top": "#bottom", + "side": "#bottom" } -} + }, + "variants": { + "normal": { "model": "minecraft:stairs" }, + "inventory": { "model": "minecraft:stairs" }, + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzWall.json b/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzWall.json index a52a6b713..e0fb94fbe 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzWall.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockChiseledQuartzWall.json @@ -1,36 +1,19 @@ { - "variants": { - "east=false,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallPost" }, - "east=false,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorth" }, - "east=true,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorthEast" }, - "east=true,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouth" }, - "east=true,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouth", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEast" }, - "east=true,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEastWest" }, - "east=false,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallPost" }, - "east=false,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorth" }, - "east=true,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorthEast" }, - "east=true,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthAbove" }, - "east=true,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthAbove", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEast" }, - "east=true,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockChiseledQuartzWallNorthSouthEastWest" } + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "actuallyadditions:blockChiseledQuartzWallPost" } + }, + { "when": { "north": "true" }, + "apply": { "model": "actuallyadditions:blockChiseledQuartzWallSide", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "actuallyadditions:blockChiseledQuartzWallSide", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "actuallyadditions:blockChiseledQuartzWallSide", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "actuallyadditions:blockChiseledQuartzWallSide", "y": 270, "uvlock": true } } + ] } diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockCoalGenerator.json b/src/main/resources/assets/actuallyadditions/blockstates/blockCoalGenerator.json index 629168a6e..d2c0683a5 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockCoalGenerator.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockCoalGenerator.json @@ -1,6 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockCoalGenerator", + "bottom": "actuallyadditions:blocks/blockCoalGeneratorBottom", + "top": "actuallyadditions:blocks/blockCoalGeneratorTop" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockCoalGenerator" }, - "meta=1": { "model": "actuallyadditions:blockCoalGenerator" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockCoffee.json b/src/main/resources/assets/actuallyadditions/blockstates/blockCoffee.json index 337a81e62..e5e4e9fe7 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockCoffee.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockCoffee.json @@ -1,12 +1,23 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:crop", + "textures": { + "crop": "actuallyadditions:blocks/blockCoffeeStage1" + } + }, "variants": { - "age=0": { "model": "actuallyadditions:blockCoffeeStage1" }, - "age=1": { "model": "actuallyadditions:blockCoffeeStage2" }, - "age=2": { "model": "actuallyadditions:blockCoffeeStage2" }, - "age=3": { "model": "actuallyadditions:blockCoffeeStage3" }, - "age=4": { "model": "actuallyadditions:blockCoffeeStage4" }, - "age=5": { "model": "actuallyadditions:blockCoffeeStage4" }, - "age=6": { "model": "actuallyadditions:blockCoffeeStage5" }, - "age=7": { "model": "actuallyadditions:blockCoffeeStage6" } + "normal": [{}], + "inventory": [{}], + "age": { + "0": { "textures": { "crop": "actuallyadditions:blocks/blockCoffeeStage1" } }, + "1": { "textures": { "crop": "actuallyadditions:blocks/blockCoffeeStage2" } }, + "2": { "textures": { "crop": "actuallyadditions:blocks/blockCoffeeStage2" } }, + "3": { "textures": { "crop": "actuallyadditions:blocks/blockCoffeeStage3" } }, + "4": { "textures": { "crop": "actuallyadditions:blocks/blockCoffeeStage4" } }, + "5": { "textures": { "crop": "actuallyadditions:blocks/blockCoffeeStage4" } }, + "6": { "textures": { "crop": "actuallyadditions:blocks/blockCoffeeStage5" } }, + "7": { "textures": { "crop": "actuallyadditions:blocks/blockCoffeeStage6" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockCoffeeMachine.json b/src/main/resources/assets/actuallyadditions/blockstates/blockCoffeeMachine.json index a511e2211..e5a656040 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockCoffeeMachine.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockCoffeeMachine.json @@ -1,8 +1,17 @@ { + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockCoffeeMachine", + "transform": "forge:default-block" + }, "variants": { - "meta=1": { "model": "actuallyadditions:blockCoffeeMachine", "y": 0 }, - "meta=0": { "model": "actuallyadditions:blockCoffeeMachine", "y": 180 }, - "meta=3": { "model": "actuallyadditions:blockCoffeeMachine", "y": 270 }, - "meta=2": { "model": "actuallyadditions:blockCoffeeMachine", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "y" : 180 }, + "1": { "y" : 0 }, + "2": { "y" : 90 }, + "3": { "y" : 270 } + } } } \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockColoredLamp.json b/src/main/resources/assets/actuallyadditions/blockstates/blockColoredLamp.json index 243dff666..141db12a5 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockColoredLamp.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockColoredLamp.json @@ -1,20 +1,29 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockColoredLampWhite" }, - "meta=1": { "model": "actuallyadditions:blockColoredLampOrange" }, - "meta=2": { "model": "actuallyadditions:blockColoredLampMagenta" }, - "meta=3": { "model": "actuallyadditions:blockColoredLampLightBlue" }, - "meta=4": { "model": "actuallyadditions:blockColoredLampYellow" }, - "meta=5": { "model": "actuallyadditions:blockColoredLampLime" }, - "meta=6": { "model": "actuallyadditions:blockColoredLampPink" }, - "meta=7": { "model": "actuallyadditions:blockColoredLampGray" }, - "meta=8": { "model": "actuallyadditions:blockColoredLampLightGray" }, - "meta=9": { "model": "actuallyadditions:blockColoredLampCyan" }, - "meta=10": { "model": "actuallyadditions:blockColoredLampPurple" }, - "meta=11": { "model": "actuallyadditions:blockColoredLampBlue" }, - "meta=12": { "model": "actuallyadditions:blockColoredLampBrown" }, - "meta=13": { "model": "actuallyadditions:blockColoredLampGreen" }, - "meta=14": { "model": "actuallyadditions:blockColoredLampRed" }, - "meta=15": { "model": "actuallyadditions:blockColoredLampBlack" } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampWhite" } }, + "1": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOrange" } }, + "2": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampMagenta" } }, + "3": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampLightBlue" } }, + "4": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampYellow" } }, + "5": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampLime" } }, + "6": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampPink" } }, + "7": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampGray" } }, + "8": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampLightGray" } }, + "9": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampCyan" } }, + "10": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampPurple" } }, + "11": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampBlue" } }, + "12": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampBrown" } }, + "13": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampGreen" } }, + "14": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampRed" } }, + "15": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampBlack" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockColoredLampOn.json b/src/main/resources/assets/actuallyadditions/blockstates/blockColoredLampOn.json index d798a5dd6..04f4cd249 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockColoredLampOn.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockColoredLampOn.json @@ -1,20 +1,29 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockColoredLampWhiteOn" }, - "meta=1": { "model": "actuallyadditions:blockColoredLampOrangeOn" }, - "meta=2": { "model": "actuallyadditions:blockColoredLampMagentaOn" }, - "meta=3": { "model": "actuallyadditions:blockColoredLampLightBlueOn" }, - "meta=4": { "model": "actuallyadditions:blockColoredLampYellowOn" }, - "meta=5": { "model": "actuallyadditions:blockColoredLampLimeOn" }, - "meta=6": { "model": "actuallyadditions:blockColoredLampPinkOn" }, - "meta=7": { "model": "actuallyadditions:blockColoredLampGrayOn" }, - "meta=8": { "model": "actuallyadditions:blockColoredLampLightGrayOn" }, - "meta=9": { "model": "actuallyadditions:blockColoredLampCyanOn" }, - "meta=10": { "model": "actuallyadditions:blockColoredLampPurpleOn" }, - "meta=11": { "model": "actuallyadditions:blockColoredLampBlueOn" }, - "meta=12": { "model": "actuallyadditions:blockColoredLampBrownOn" }, - "meta=13": { "model": "actuallyadditions:blockColoredLampGreenOn" }, - "meta=14": { "model": "actuallyadditions:blockColoredLampRedOn" }, - "meta=15": { "model": "actuallyadditions:blockColoredLampBlackOn" } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnWhite" } }, + "1": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnOrange" } }, + "2": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnMagenta" } }, + "3": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnLightBlue" } }, + "4": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnYellow" } }, + "5": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnLime" } }, + "6": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnPink" } }, + "7": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnGray" } }, + "8": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnLightGray" } }, + "9": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnCyan" } }, + "10": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnPurple" } }, + "11": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnBlue" } }, + "12": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnBrown" } }, + "13": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnGreen" } }, + "14": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnRed" } }, + "15": { "textures" : { "all" : "actuallyadditions:blocks/blockColoredLampOnBlack" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockCompost.json b/src/main/resources/assets/actuallyadditions/blockstates/blockCompost.json index 9c31ecfa9..fa7aee26b 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockCompost.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockCompost.json @@ -1,5 +1,11 @@ { + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockCompost", + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockCompost"} + "normal": [{}], + "inventory": [{}] } } \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockCrystal.json b/src/main/resources/assets/actuallyadditions/blockstates/blockCrystal.json index c08e793eb..762a9aab9 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockCrystal.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockCrystal.json @@ -1,10 +1,19 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockCrystalRed" }, - "meta=1": { "model": "actuallyadditions:blockCrystalBlue" }, - "meta=2": { "model": "actuallyadditions:blockCrystalLightBlue" }, - "meta=3": { "model": "actuallyadditions:blockCrystalBlack" }, - "meta=4": { "model": "actuallyadditions:blockCrystalGreen" }, - "meta=5": { "model": "actuallyadditions:blockCrystalWhite" } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "textures" : { "all" : "actuallyadditions:blocks/blockCrystalRed" } }, + "1": { "textures" : { "all" : "actuallyadditions:blocks/blockCrystalBlue" } }, + "2": { "textures" : { "all" : "actuallyadditions:blocks/blockCrystalLightBlue" } }, + "3": { "textures" : { "all" : "actuallyadditions:blocks/blockCrystalBlack" } }, + "4": { "textures" : { "all" : "actuallyadditions:blocks/blockCrystalGreen" } }, + "5": { "textures" : { "all" : "actuallyadditions:blocks/blockCrystalWhite" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockDirectionalBreaker.json b/src/main/resources/assets/actuallyadditions/blockstates/blockDirectionalBreaker.json index 56bb9e166..17b37d272 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockDirectionalBreaker.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockDirectionalBreaker.json @@ -1,10 +1,28 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockDirectionalBreaker", + "down": "#particle", + "up": "actuallyadditions:blocks/blockDirectionalBreakerTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockDirectionalBreakerFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockDirectionalBreaker", "x": 90 }, - "meta=1": { "model": "actuallyadditions:blockDirectionalBreaker", "x": -90 }, - "meta=2": { "model": "actuallyadditions:blockDirectionalBreaker", "y": 0 }, - "meta=3": { "model": "actuallyadditions:blockDirectionalBreaker", "y": 180 }, - "meta=4": { "model": "actuallyadditions:blockDirectionalBreaker", "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockDirectionalBreaker", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x" : 90 }, + "1": { "x" : 270 }, + "2": { "y" : 0 }, + "3": { "y" : 180 }, + "4": { "y" : 270 }, + "5": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockDisplayStand.json b/src/main/resources/assets/actuallyadditions/blockstates/blockDisplayStand.json new file mode 100644 index 000000000..3540b7e6b --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockDisplayStand.json @@ -0,0 +1,16 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "actuallyadditions:blocks/blockDisplayStand", + "top": "#bottom", + "side": "actuallyadditions:blocks/blockDisplayStandSide" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockDropper.json b/src/main/resources/assets/actuallyadditions/blockstates/blockDropper.json index fe8697b5b..172868672 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockDropper.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockDropper.json @@ -1,10 +1,28 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockDropper", + "down": "#particle", + "up": "actuallyadditions:blocks/blockDropperTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockDropperFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockDropper", "x": 90 }, - "meta=1": { "model": "actuallyadditions:blockDropper", "x": -90 }, - "meta=2": { "model": "actuallyadditions:blockDropper", "y": 0 }, - "meta=3": { "model": "actuallyadditions:blockDropper", "y": 180 }, - "meta=4": { "model": "actuallyadditions:blockDropper", "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockDropper", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x" : 90 }, + "1": { "x" : 270 }, + "2": { "y" : 0 }, + "3": { "y" : 180 }, + "4": { "y" : 270 }, + "5": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockEnergizer.json b/src/main/resources/assets/actuallyadditions/blockstates/blockEnergizer.json index 37a15905b..bda07cd88 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockEnergizer.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockEnergizer.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockEnergizerSide", + "bottom": "actuallyadditions:blocks/blockEnergizer", + "top": "actuallyadditions:blocks/blockEnergizerTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockEnergizer" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockEnervator.json b/src/main/resources/assets/actuallyadditions/blockstates/blockEnervator.json index e8bae04d1..db9336579 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockEnervator.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockEnervator.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockEnervatorSide", + "bottom": "actuallyadditions:blocks/blockEnervator", + "top": "actuallyadditions:blocks/blockEnervatorTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockEnervator" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFeeder.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFeeder.json index aa07fa7dc..b5991fc59 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFeeder.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFeeder.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockFeeder", + "bottom": "#top", + "top": "actuallyadditions:blocks/blockFeederTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockFeeder" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFermentingBarrel.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFermentingBarrel.json index 3f6c9ff84..31c1e4fe0 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFermentingBarrel.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFermentingBarrel.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockFermentingBarrel", + "bottom": "#top", + "top": "actuallyadditions:blocks/blockFermentingBarrelTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockFermentingBarrel" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFireworkBox.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFireworkBox.json index 3e27a417c..040c8d451 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFireworkBox.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFireworkBox.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockFireworkBox", + "bottom": "#side", + "top": "actuallyadditions:blocks/blockFireworkBoxTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockFireworkBox" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFishingNet.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFishingNet.json index bb9ce51ee..69132a90d 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFishingNet.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFishingNet.json @@ -1,5 +1,11 @@ { + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockFishingNet", + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockFishingNet"} + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFlax.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFlax.json index 649965b40..7ed1088df 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFlax.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFlax.json @@ -1,12 +1,23 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:crop", + "textures": { + "crop": "actuallyadditions:blocks/blockFlaxStage1" + } + }, "variants": { - "age=0": { "model": "actuallyadditions:blockFlaxStage1" }, - "age=1": { "model": "actuallyadditions:blockFlaxStage2" }, - "age=2": { "model": "actuallyadditions:blockFlaxStage2" }, - "age=3": { "model": "actuallyadditions:blockFlaxStage3" }, - "age=4": { "model": "actuallyadditions:blockFlaxStage4" }, - "age=5": { "model": "actuallyadditions:blockFlaxStage4" }, - "age=6": { "model": "actuallyadditions:blockFlaxStage5" }, - "age=7": { "model": "actuallyadditions:blockFlaxStage6" } + "normal": [{}], + "inventory": [{}], + "age": { + "0": { "textures": { "crop": "actuallyadditions:blocks/blockFlaxStage1" } }, + "1": { "textures": { "crop": "actuallyadditions:blocks/blockFlaxStage2" } }, + "2": { "textures": { "crop": "actuallyadditions:blocks/blockFlaxStage2" } }, + "3": { "textures": { "crop": "actuallyadditions:blocks/blockFlaxStage3" } }, + "4": { "textures": { "crop": "actuallyadditions:blocks/blockFlaxStage4" } }, + "5": { "textures": { "crop": "actuallyadditions:blocks/blockFlaxStage4" } }, + "6": { "textures": { "crop": "actuallyadditions:blocks/blockFlaxStage5" } }, + "7": { "textures": { "crop": "actuallyadditions:blocks/blockFlaxStage6" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFluidCollector.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFluidCollector.json index b6b6a8108..56495538f 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFluidCollector.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFluidCollector.json @@ -1,10 +1,28 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockFluidCollector", + "down": "#particle", + "up": "actuallyadditions:blocks/blockFluidCollectorTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockFluidCollectorFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockFluidCollector", "x": 90 }, - "meta=1": { "model": "actuallyadditions:blockFluidCollector", "x": -90 }, - "meta=2": { "model": "actuallyadditions:blockFluidCollector", "y": 0 }, - "meta=3": { "model": "actuallyadditions:blockFluidCollector", "y": 180 }, - "meta=4": { "model": "actuallyadditions:blockFluidCollector", "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockFluidCollector", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x" : 90 }, + "1": { "x" : 270 }, + "2": { "y" : 0 }, + "3": { "y" : 180 }, + "4": { "y" : 270 }, + "5": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFluidPlacer.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFluidPlacer.json index de0a72aba..7727f4693 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFluidPlacer.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFluidPlacer.json @@ -1,10 +1,28 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockFluidPlacer", + "down": "#particle", + "up": "actuallyadditions:blocks/blockFluidPlacerTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockFluidPlacerFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockFluidPlacer", "x": 90 }, - "meta=1": { "model": "actuallyadditions:blockFluidPlacer", "x": -90 }, - "meta=2": { "model": "actuallyadditions:blockFluidPlacer", "y": 0 }, - "meta=3": { "model": "actuallyadditions:blockFluidPlacer", "y": 180 }, - "meta=4": { "model": "actuallyadditions:blockFluidPlacer", "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockFluidPlacer", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x" : 90 }, + "1": { "x" : 270 }, + "2": { "y" : 0 }, + "3": { "y" : 180 }, + "4": { "y" : 270 }, + "5": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFurnaceDouble.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFurnaceDouble.json index bd12b0819..4d04cfcb0 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFurnaceDouble.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFurnaceDouble.json @@ -1,12 +1,30 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockFurnaceDouble", + "down": "#particle", + "up": "actuallyadditions:blocks/blockFurnaceDoubleTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockFurnaceDoubleFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockFurnaceDouble", "y": 0 }, - "meta=1": { "model": "actuallyadditions:blockFurnaceDouble", "y": 180 }, - "meta=2": { "model": "actuallyadditions:blockFurnaceDouble", "y": -90 }, - "meta=3": { "model": "actuallyadditions:blockFurnaceDouble", "y": 90 }, - "meta=4": { "model": "actuallyadditions:blockFurnaceDoubleOn", "y": 0 }, - "meta=5": { "model": "actuallyadditions:blockFurnaceDoubleOn", "y": 180 }, - "meta=6": { "model": "actuallyadditions:blockFurnaceDoubleOn", "y": -90 }, - "meta=7": { "model": "actuallyadditions:blockFurnaceDoubleOn", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "y" : 0 }, + "1": { "y" : 180 }, + "2": { "y" : 270 }, + "3": { "y" : 90 }, + "4": { "y" : 0, "textures": { "north": "actuallyadditions:blocks/blockFurnaceDoubleOn" } }, + "5": { "y" : 180, "textures": { "north": "actuallyadditions:blocks/blockFurnaceDoubleOn" } }, + "6": { "y" : 270, "textures": { "north": "actuallyadditions:blocks/blockFurnaceDoubleOn" } }, + "7": { "y" : 90, "textures": { "north": "actuallyadditions:blocks/blockFurnaceDoubleOn" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockFurnaceSolar.json b/src/main/resources/assets/actuallyadditions/blockstates/blockFurnaceSolar.json index 5ce3fe382..ec0aa1e5c 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockFurnaceSolar.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockFurnaceSolar.json @@ -1,5 +1,11 @@ { - "variants": { - "normal": { "model": "actuallyadditions:blockFurnaceSolar" } - } -} + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockFurnaceSolar", + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChest.json b/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChest.json index 00ab60b35..c3a8f16e4 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChest.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChest.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockGiantChest", + "bottom": "actuallyadditions:blocks/blockGiantChestBottom", + "top": "actuallyadditions:blocks/blockGiantChestTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockGiantChest" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChestLarge.json b/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChestLarge.json new file mode 100644 index 000000000..063263e5a --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChestLarge.json @@ -0,0 +1,16 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockGiantChestLarge", + "bottom": "actuallyadditions:blocks/blockGiantChestBottom", + "top": "actuallyadditions:blocks/blockGiantChestTop" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChestMedium.json b/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChestMedium.json new file mode 100644 index 000000000..4006a6906 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockGiantChestMedium.json @@ -0,0 +1,16 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockGiantChestMedium", + "bottom": "actuallyadditions:blocks/blockGiantChestBottom", + "top": "actuallyadditions:blocks/blockGiantChestTop" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockGreenhouseGlass.json b/src/main/resources/assets/actuallyadditions/blockstates/blockGreenhouseGlass.json index efe19b072..94c51c62f 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockGreenhouseGlass.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockGreenhouseGlass.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockGreenhouseGlass" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockGreenhouseGlass" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockGrinder.json b/src/main/resources/assets/actuallyadditions/blockstates/blockGrinder.json index 1d8694186..cefd418bb 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockGrinder.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockGrinder.json @@ -1,6 +1,20 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockGrinder", + "bottom": "actuallyadditions:blocks/blockGrinderBottom", + "top": "actuallyadditions:blocks/blockGrinderTop" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockGrinder" }, - "meta=1": { "model": "actuallyadditions:blockGrinderOn" } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": {}, + "1": { "textures": { "top": "actuallyadditions:blocks/blockGrinderOn" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockGrinderDouble.json b/src/main/resources/assets/actuallyadditions/blockstates/blockGrinderDouble.json index 1611b66d6..577b80f5a 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockGrinderDouble.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockGrinderDouble.json @@ -1,6 +1,20 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockGrinderDouble", + "bottom": "actuallyadditions:blocks/blockGrinderBottom", + "top": "actuallyadditions:blocks/blockGrinderTop" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockGrinderDouble" }, - "meta=1": { "model": "actuallyadditions:blockGrinderDoubleOn" } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": {}, + "1": { "textures": { "top": "actuallyadditions:blocks/blockGrinderOn" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockHeatCollector.json b/src/main/resources/assets/actuallyadditions/blockstates/blockHeatCollector.json index ba42dd650..fb8dc627c 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockHeatCollector.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockHeatCollector.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockHeatCollectorSide", + "bottom": "actuallyadditions:blocks/blockHeatCollectorBottom", + "top": "actuallyadditions:blocks/blockHeatCollectorTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockHeatCollector" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockInputter.json b/src/main/resources/assets/actuallyadditions/blockstates/blockInputter.json index f61d3273e..00312e0c1 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockInputter.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockInputter.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockInputter" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockInputter" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockInputterAdvanced.json b/src/main/resources/assets/actuallyadditions/blockstates/blockInputterAdvanced.json index e886cf707..9ac462bee 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockInputterAdvanced.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockInputterAdvanced.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockInputterAdvanced" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockInputterAdvanced" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockItemRepairer.json b/src/main/resources/assets/actuallyadditions/blockstates/blockItemRepairer.json index e5eb85b3d..5c24da2f2 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockItemRepairer.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockItemRepairer.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockItemRepairer", + "bottom": "actuallyadditions:blocks/blockItemRepairerBottom", + "top": "actuallyadditions:blocks/blockItemRepairerTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockItemRepairer" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockItemViewer.json b/src/main/resources/assets/actuallyadditions/blockstates/blockItemViewer.json new file mode 100644 index 000000000..30a6f64c4 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockItemViewer.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockItemViewer" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockLampPowerer.json b/src/main/resources/assets/actuallyadditions/blockstates/blockLampPowerer.json index 6d850ae98..792cdcd96 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockLampPowerer.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockLampPowerer.json @@ -1,10 +1,28 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockLampPowerer", + "down": "#particle", + "up": "#particle", + "south": "#particle", + "north": "actuallyadditions:blocks/blockLampPowererFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockLampPowerer", "x": 90 }, - "meta=1": { "model": "actuallyadditions:blockLampPowerer", "x": -90 }, - "meta=2": { "model": "actuallyadditions:blockLampPowerer", "y": 0 }, - "meta=3": { "model": "actuallyadditions:blockLampPowerer", "y": 180 }, - "meta=4": { "model": "actuallyadditions:blockLampPowerer", "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockLampPowerer", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x" : 90 }, + "1": { "x" : 270 }, + "2": { "y" : 0 }, + "3": { "y" : 180 }, + "4": { "y" : 270 }, + "5": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelay.json b/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelay.json index d5417dfcb..3ad16948c 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelay.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelay.json @@ -1,10 +1,19 @@ { + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockLaserRelay", + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockLaserRelay", "x": 180 }, - "meta=1": { "model": "actuallyadditions:blockLaserRelay"}, - "meta=2": { "model": "actuallyadditions:blockLaserRelay", "x": 90 }, - "meta=3": { "model": "actuallyadditions:blockLaserRelay", "x": 270 }, - "meta=4": { "model": "actuallyadditions:blockLaserRelay", "x": 90, "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockLaserRelay", "x": 90, "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x": 180 }, + "1": {}, + "2": { "x": 90 }, + "3": { "x": 270 }, + "4": { "x": 90, "y": 270 }, + "5": { "x": 270, "y": 270 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItem.json b/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItem.json new file mode 100644 index 000000000..122532146 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItem.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockLaserRelayItem", + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x": 180 }, + "1": {}, + "2": { "x": 90 }, + "3": { "x": 270 }, + "4": { "x": 90, "y": 270 }, + "5": { "x": 270, "y": 270 } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItemWhitelist.json b/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItemWhitelist.json new file mode 100644 index 000000000..9993a6f0f --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItemWhitelist.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockLaserRelayItemWhitelist", + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x": 180 }, + "1": {}, + "2": { "x": 90 }, + "3": { "x": 270 }, + "4": { "x": 90, "y": 270 }, + "5": { "x": 270, "y": 270 } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockLavaFactoryController.json b/src/main/resources/assets/actuallyadditions/blockstates/blockLavaFactoryController.json index 4b1b03844..321021e7e 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockLavaFactoryController.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockLavaFactoryController.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockLavaFactoryController", + "bottom": "#side", + "top": "actuallyadditions:blocks/blockLavaFactoryControllerTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockLavaFactoryController" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockLeafGenerator.json b/src/main/resources/assets/actuallyadditions/blockstates/blockLeafGenerator.json index 437f4a868..f2f3b0e96 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockLeafGenerator.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockLeafGenerator.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockLeafGenerator" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockLeafGenerator" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockMiner.json b/src/main/resources/assets/actuallyadditions/blockstates/blockMiner.json index 58ca07bcb..63930db2a 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockMiner.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockMiner.json @@ -1,5 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockMiner", + "bottom": "actuallyadditions:blocks/blockMinerFront", + "top": "actuallyadditions:blocks/blockMinerTop" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockMiner" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockMisc.json b/src/main/resources/assets/actuallyadditions/blockstates/blockMisc.json deleted file mode 100644 index 20d2f94a2..000000000 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockMisc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "variants": { - "meta=0": { "model": "actuallyadditions:blockMiscBlackQuartzPillar" }, - "meta=1": { "model": "actuallyadditions:blockMiscBlackQuartzChiseled" }, - "meta=2": { "model": "actuallyadditions:blockMiscBlackQuartz" }, - "meta=3": { "model": "actuallyadditions:blockMiscOreBlackQuartz" }, - "meta=4": { "model": "actuallyadditions:blockMiscWoodCasing" }, - "meta=5": { "model": "actuallyadditions:blockMiscCharcoal" }, - "meta=6": { "model": "actuallyadditions:blockMiscEnderpearl" }, - "meta=7": { "model": "actuallyadditions:blockMiscLavaFactoryCase" }, - "meta=8": { "model": "actuallyadditions:blockMiscEnderCasing" }, - "meta=9": { "model": "actuallyadditions:blockMiscIronCasing" } - } -} diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockOilGenerator.json b/src/main/resources/assets/actuallyadditions/blockstates/blockOilGenerator.json index 80d532bf9..03c8d6e46 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockOilGenerator.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockOilGenerator.json @@ -1,6 +1,16 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_bottom_top", + "textures": { + "side": "actuallyadditions:blocks/blockOilGenerator", + "bottom": "actuallyadditions:blocks/blockOilGeneratorBottom", + "top": "actuallyadditions:blocks/blockOilGeneratorTop" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockOilGenerator" }, - "meta=1": { "model": "actuallyadditions:blockOilGenerator" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomBooster.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomBooster.json index a7ba983ed..a176bd833 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomBooster.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomBooster.json @@ -1,5 +1,11 @@ { + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockPhantomBooster", + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockPhantomBooster"} + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomBreaker.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomBreaker.json index 06951250e..575be757f 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomBreaker.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomBreaker.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockPhantomBreaker" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockPhantomBreaker" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomEnergyface.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomEnergyface.json index 8de3a8d69..96d57a530 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomEnergyface.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomEnergyface.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockPhantomEnergyface" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockPhantomEnergyface" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomLiquiface.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomLiquiface.json index 897bc9bab..bba3caad1 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomLiquiface.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomLiquiface.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockPhantomLiquiface" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockPhantomLiquiface" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomPlacer.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomPlacer.json index f3820bf15..da99bdd00 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomPlacer.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomPlacer.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockPhantomPlacer" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockPhantomPlacer" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomRedstoneface.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomRedstoneface.json new file mode 100644 index 000000000..9030482ce --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomRedstoneface.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockPhantomRedstoneface" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomface.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomface.json index f4a049588..82d693611 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomface.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPhantomface.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockPhantomface" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockPhantomface" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzSlab.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzSlab.json index e6fadc3d4..6850084a0 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzSlab.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzSlab.json @@ -1,6 +1,20 @@ { - "variants": { - "meta=0": { "model": "actuallyadditions:blockPillarQuartzSlabBottom" }, - "meta=1": { "model": "actuallyadditions:blockPillarQuartzSlabTop" } + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", + "top": "#bottom", + "side": "#bottom" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": {}, + "1": { "model": "minecraft:upper_slab" } } -} + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzStair.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzStair.json index 90fe870ec..a96f642ba 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzStair.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzStair.json @@ -1,44 +1,54 @@ { - "variants": { - "facing=east,half=bottom,shape=straight": { "model": "actuallyadditions:blockPillarQuartzStairs" }, - "facing=west,half=bottom,shape=straight": { "model": "actuallyadditions:blockPillarQuartzStairs", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=straight": { "model": "actuallyadditions:blockPillarQuartzStairs", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=straight": { "model": "actuallyadditions:blockPillarQuartzStairs", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockPillarQuartzStairsOuter" }, - "facing=west,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockPillarQuartzStairsOuter" }, - "facing=north,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "y": 180, "uvlock": true }, - "facing=east,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockPillarQuartzStairsInner" }, - "facing=west,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockPillarQuartzStairsInner" }, - "facing=north,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "y": 180, "uvlock": true }, - "facing=east,half=top,shape=straight": { "model": "actuallyadditions:blockPillarQuartzStairs", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=straight": { "model": "actuallyadditions:blockPillarQuartzStairs", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=straight": { "model": "actuallyadditions:blockPillarQuartzStairs", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=straight": { "model": "actuallyadditions:blockPillarQuartzStairs", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_right": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=outer_right": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=outer_right": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=outer_right": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_left": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=outer_left": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=outer_left": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=outer_left": { "model": "actuallyadditions:blockPillarQuartzStairsOuter", "x": 180, "uvlock": true }, - "facing=east,half=top,shape=inner_right": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=inner_right": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=inner_right": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=inner_right": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=inner_left": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=inner_left": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=inner_left": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=inner_left": { "model": "actuallyadditions:blockPillarQuartzStairsInner", "x": 180, "uvlock": true } + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", + "top": "#bottom", + "side": "#bottom" } -} + }, + "variants": { + "normal": { "model": "minecraft:stairs" }, + "inventory": { "model": "minecraft:stairs" }, + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzWall.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzWall.json index 53375efd9..5b033d2a7 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzWall.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPillarQuartzWall.json @@ -1,36 +1,19 @@ { - "variants": { - "east=false,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockPillarQuartzWallPost" }, - "east=false,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorth" }, - "east=true,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorthEast" }, - "east=true,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouth" }, - "east=true,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouth", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEast" }, - "east=true,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEastWest" }, - "east=false,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockPillarQuartzWallPost" }, - "east=false,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorth" }, - "east=true,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorthEast" }, - "east=true,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthAbove" }, - "east=true,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthAbove", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEast" }, - "east=true,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockPillarQuartzWallNorthSouthEastWest" } + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "actuallyadditions:blockPillarQuartzWallPost" } + }, + { "when": { "north": "true" }, + "apply": { "model": "actuallyadditions:blockPillarQuartzWallSide", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "actuallyadditions:blockPillarQuartzWallSide", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "actuallyadditions:blockPillarQuartzWallSide", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "actuallyadditions:blockPillarQuartzWallSide", "y": 270, "uvlock": true } } + ] } diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPlacer.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPlacer.json index 7e296e649..39c3138d1 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockPlacer.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPlacer.json @@ -1,10 +1,28 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockPlacer", + "down": "#particle", + "up": "actuallyadditions:blocks/blockPlacerTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockPlacerFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockPlacer", "x": 90 }, - "meta=1": { "model": "actuallyadditions:blockPlacer", "x": -90 }, - "meta=2": { "model": "actuallyadditions:blockPlacer", "y": 0 }, - "meta=3": { "model": "actuallyadditions:blockPlacer", "y": 180 }, - "meta=4": { "model": "actuallyadditions:blockPlacer", "y": 270 }, - "meta=5": { "model": "actuallyadditions:blockPlacer", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x" : 90 }, + "1": { "x" : 270 }, + "2": { "y" : 0 }, + "3": { "y" : 180 }, + "4": { "y" : 270 }, + "5": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockPlayerInterface.json b/src/main/resources/assets/actuallyadditions/blockstates/blockPlayerInterface.json new file mode 100644 index 000000000..820340e7c --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockPlayerInterface.json @@ -0,0 +1,14 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockPlayerInterface" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzSlab.json b/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzSlab.json index ec18e935b..e0c091c27 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzSlab.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzSlab.json @@ -1,6 +1,20 @@ { - "variants": { - "meta=0": { "model": "actuallyadditions:blockQuartzSlabBottom" }, - "meta=1": { "model": "actuallyadditions:blockQuartzSlabTop" } + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "actuallyadditions:blocks/blockMiscBlackQuartz", + "top": "#bottom", + "side": "#bottom" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": {}, + "1": { "model": "minecraft:upper_slab" } } -} + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzStair.json b/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzStair.json index bd2db7cda..f64d8e0b1 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzStair.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzStair.json @@ -1,44 +1,54 @@ { - "variants": { - "facing=east,half=bottom,shape=straight": { "model": "actuallyadditions:blockQuartzStairs" }, - "facing=west,half=bottom,shape=straight": { "model": "actuallyadditions:blockQuartzStairs", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=straight": { "model": "actuallyadditions:blockQuartzStairs", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=straight": { "model": "actuallyadditions:blockQuartzStairs", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockQuartzStairsOuter" }, - "facing=west,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockQuartzStairsOuter", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockQuartzStairsOuter", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockQuartzStairsOuter", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockQuartzStairsOuter", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockQuartzStairsOuter", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockQuartzStairsOuter" }, - "facing=north,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockQuartzStairsOuter", "y": 180, "uvlock": true }, - "facing=east,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockQuartzStairsInner" }, - "facing=west,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockQuartzStairsInner", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockQuartzStairsInner", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockQuartzStairsInner", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockQuartzStairsInner", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockQuartzStairsInner", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockQuartzStairsInner" }, - "facing=north,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockQuartzStairsInner", "y": 180, "uvlock": true }, - "facing=east,half=top,shape=straight": { "model": "actuallyadditions:blockQuartzStairs", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=straight": { "model": "actuallyadditions:blockQuartzStairs", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=straight": { "model": "actuallyadditions:blockQuartzStairs", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=straight": { "model": "actuallyadditions:blockQuartzStairs", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_right": { "model": "actuallyadditions:blockQuartzStairsOuter", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=outer_right": { "model": "actuallyadditions:blockQuartzStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=outer_right": { "model": "actuallyadditions:blockQuartzStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=outer_right": { "model": "actuallyadditions:blockQuartzStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_left": { "model": "actuallyadditions:blockQuartzStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=outer_left": { "model": "actuallyadditions:blockQuartzStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=outer_left": { "model": "actuallyadditions:blockQuartzStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=outer_left": { "model": "actuallyadditions:blockQuartzStairsOuter", "x": 180, "uvlock": true }, - "facing=east,half=top,shape=inner_right": { "model": "actuallyadditions:blockQuartzStairsInner", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=inner_right": { "model": "actuallyadditions:blockQuartzStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=inner_right": { "model": "actuallyadditions:blockQuartzStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=inner_right": { "model": "actuallyadditions:blockQuartzStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=inner_left": { "model": "actuallyadditions:blockQuartzStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=inner_left": { "model": "actuallyadditions:blockQuartzStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=inner_left": { "model": "actuallyadditions:blockQuartzStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=inner_left": { "model": "actuallyadditions:blockQuartzStairsInner", "x": 180, "uvlock": true } + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "actuallyadditions:blocks/blockMiscBlackQuartz", + "top": "#bottom", + "side": "#bottom" } -} + }, + "variants": { + "normal": { "model": "minecraft:stairs" }, + "inventory": { "model": "minecraft:stairs" }, + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzWall.json b/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzWall.json index 36eed4bdd..726aa6850 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzWall.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockQuartzWall.json @@ -1,36 +1,19 @@ { - "variants": { - "east=false,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockQuartzWallPost" }, - "east=false,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockQuartzWallNorth" }, - "east=true,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockQuartzWallNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockQuartzWallNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockQuartzWallNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockQuartzWallNorthEast" }, - "east=true,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockQuartzWallNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockQuartzWallNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockQuartzWallNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockQuartzWallNorthSouth" }, - "east=true,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouth", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockQuartzWallNorthSouthEast" }, - "east=true,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthEastWest" }, - "east=false,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockQuartzWallPost" }, - "east=false,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockQuartzWallNorth" }, - "east=true,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockQuartzWallNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockQuartzWallNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockQuartzWallNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockQuartzWallNorthEast" }, - "east=true,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockQuartzWallNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockQuartzWallNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockQuartzWallNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockQuartzWallNorthSouthAbove" }, - "east=true,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthAbove", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockQuartzWallNorthSouthEast" }, - "east=true,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockQuartzWallNorthSouthEastWest" } + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "actuallyadditions:blockQuartzWallPost" } + }, + { "when": { "north": "true" }, + "apply": { "model": "actuallyadditions:blockQuartzWallSide", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "actuallyadditions:blockQuartzWallSide", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "actuallyadditions:blockQuartzWallSide", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "actuallyadditions:blockQuartzWallSide", "y": 270, "uvlock": true } } + ] } diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockRangedCollector.json b/src/main/resources/assets/actuallyadditions/blockstates/blockRangedCollector.json index 52e736d3f..ee6cf99ab 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockRangedCollector.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockRangedCollector.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockRangedCollector" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockRangedCollector" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockRice.json b/src/main/resources/assets/actuallyadditions/blockstates/blockRice.json index a4195413a..98c31ee72 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockRice.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockRice.json @@ -1,12 +1,23 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:crop", + "textures": { + "crop": "actuallyadditions:blocks/blockRiceStage1" + } + }, "variants": { - "age=0": { "model": "actuallyadditions:blockRiceStage1" }, - "age=1": { "model": "actuallyadditions:blockRiceStage2" }, - "age=2": { "model": "actuallyadditions:blockRiceStage2" }, - "age=3": { "model": "actuallyadditions:blockRiceStage3" }, - "age=4": { "model": "actuallyadditions:blockRiceStage4" }, - "age=5": { "model": "actuallyadditions:blockRiceStage4" }, - "age=6": { "model": "actuallyadditions:blockRiceStage5" }, - "age=7": { "model": "actuallyadditions:blockRiceStage6" } + "normal": [{}], + "inventory": [{}], + "age": { + "0": { "textures": { "crop": "actuallyadditions:blocks/blockRiceStage1" } }, + "1": { "textures": { "crop": "actuallyadditions:blocks/blockRiceStage2" } }, + "2": { "textures": { "crop": "actuallyadditions:blocks/blockRiceStage2" } }, + "3": { "textures": { "crop": "actuallyadditions:blocks/blockRiceStage3" } }, + "4": { "textures": { "crop": "actuallyadditions:blocks/blockRiceStage4" } }, + "5": { "textures": { "crop": "actuallyadditions:blocks/blockRiceStage4" } }, + "6": { "textures": { "crop": "actuallyadditions:blocks/blockRiceStage5" } }, + "7": { "textures": { "crop": "actuallyadditions:blocks/blockRiceStage6" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockSmileyCloud.json b/src/main/resources/assets/actuallyadditions/blockstates/blockSmileyCloud.json index c4508ef62..1cdb3ecae 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockSmileyCloud.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockSmileyCloud.json @@ -1,8 +1,21 @@ { + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockSmileyCloud", + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockSmileyCloud", "y": 0 }, - "meta=1": { "model": "actuallyadditions:blockSmileyCloud", "y": 180 }, - "meta=2": { "model": "actuallyadditions:blockSmileyCloud", "y": -90 }, - "meta=3": { "model": "actuallyadditions:blockSmileyCloud", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "y" : 0}, + "1": { "y" : 180 }, + "2": { "y" : 270 }, + "3": { "y" : 90 }, + "4": { "y" : 0, "model": "actuallyadditions:blockSmileyCloudFluffy" }, + "5": { "y" : 180, "model": "actuallyadditions:blockSmileyCloudFluffy" }, + "6": { "y" : 270, "model": "actuallyadditions:blockSmileyCloudFluffy" }, + "7": { "y" : 90, "model": "actuallyadditions:blockSmileyCloudFluffy" } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenFence.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenFence.json index be640a579..f7415555c 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenFence.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenFence.json @@ -1,36 +1,19 @@ { - "variants": { - "east=false,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFencePost" }, - "east=false,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorth" }, - "east=true,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthEast" }, - "east=true,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouth" }, - "east=true,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouth", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEast" }, - "east=true,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEastWest" }, - "east=false,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFencePost" }, - "east=false,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorth" }, - "east=true,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthEast" }, - "east=true,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthAbove" }, - "east=true,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthAbove", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEast" }, - "east=true,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksGreenFenceNorthSouthEastWest" } + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksGreenFencePost" } + }, + { "when": { "north": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksGreenFenceSide", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksGreenFenceSide", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksGreenFenceSide", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksGreenFenceSide", "y": 270, "uvlock": true } } + ] } diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenSlab.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenSlab.json index 7a6348718..416fd8e2c 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenSlab.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenSlab.json @@ -1,6 +1,20 @@ { - "variants": { - "meta=0": { "model": "actuallyadditions:blockTestifiBucksGreenSlabBottom" }, - "meta=1": { "model": "actuallyadditions:blockTestifiBucksGreenSlabTop" } + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "actuallyadditions:blocks/blockTestifiBucksGreenWall", + "top": "#bottom", + "side": "#bottom" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": {}, + "1": { "model": "minecraft:upper_slab" } } -} + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenStairs.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenStairs.json index 97b65d1aa..6b94a6e85 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenStairs.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenStairs.json @@ -1,44 +1,54 @@ { - "variants": { - "facing=east,half=bottom,shape=straight": { "model": "actuallyadditions:blockTestifiBucksGreenStairs" }, - "facing=west,half=bottom,shape=straight": { "model": "actuallyadditions:blockTestifiBucksGreenStairs", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=straight": { "model": "actuallyadditions:blockTestifiBucksGreenStairs", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=straight": { "model": "actuallyadditions:blockTestifiBucksGreenStairs", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter" }, - "facing=west,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter" }, - "facing=north,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "y": 180, "uvlock": true }, - "facing=east,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner" }, - "facing=west,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner" }, - "facing=north,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "y": 180, "uvlock": true }, - "facing=east,half=top,shape=straight": { "model": "actuallyadditions:blockTestifiBucksGreenStairs", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=straight": { "model": "actuallyadditions:blockTestifiBucksGreenStairs", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=straight": { "model": "actuallyadditions:blockTestifiBucksGreenStairs", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=straight": { "model": "actuallyadditions:blockTestifiBucksGreenStairs", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsOuter", "x": 180, "uvlock": true }, - "facing=east,half=top,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksGreenStairsInner", "x": 180, "uvlock": true } + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "actuallyadditions:blocks/blockTestifiBucksGreenWall", + "top": "#bottom", + "side": "#bottom" } -} + }, + "variants": { + "normal": { "model": "minecraft:stairs" }, + "inventory": { "model": "minecraft:stairs" }, + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenWall.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenWall.json index a586e7ad0..aac2e55e0 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenWall.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksGreenWall.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockTestifiBucksGreenWall" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockTestifiBucksGreenWall" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteFence.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteFence.json index 4cf3b6c82..53a97c100 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteFence.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteFence.json @@ -1,36 +1,19 @@ { - "variants": { - "east=false,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFencePost" }, - "east=false,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorth" }, - "east=true,north=false,south=false,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthEast" }, - "east=true,north=false,south=true,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouth" }, - "east=true,north=false,south=false,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouth", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEast" }, - "east=true,north=false,south=true,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=false,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEastWest" }, - "east=false,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFencePost" }, - "east=false,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorth" }, - "east=true,north=false,south=false,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorth", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorth", "y": 180, "uvlock": true }, - "east=false,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorth", "y": 270, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthEast" }, - "east=true,north=false,south=true,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthEast", "y": 90, "uvlock": true }, - "east=false,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthEast", "y": 180, "uvlock": true }, - "east=false,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthEast", "y": 270, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthAbove" }, - "east=true,north=false,south=false,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthAbove", "y": 90, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=false": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEast" }, - "east=true,north=false,south=true,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEast", "y": 90, "uvlock": true }, - "east=false,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEast", "y": 180, "uvlock": true }, - "east=true,north=true,south=false,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEast", "y": 270, "uvlock": true }, - "east=true,north=true,south=true,up=true,west=true": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceNorthSouthEastWest" } + "multipart": [ + { "when": { "up": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksWhiteFencePost" } + }, + { "when": { "north": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceSide", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceSide", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceSide", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "actuallyadditions:blockTestifiBucksWhiteFenceSide", "y": 270, "uvlock": true } } + ] } diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteSlab.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteSlab.json index b499d5a6a..243043710 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteSlab.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteSlab.json @@ -1,6 +1,20 @@ { - "variants": { - "meta=0": { "model": "actuallyadditions:blockTestifiBucksWhiteSlabBottom" }, - "meta=1": { "model": "actuallyadditions:blockTestifiBucksWhiteSlabTop" } + "forge_marker": 1, + "defaults": { + "model": "minecraft:half_slab", + "textures": { + "bottom": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", + "top": "#bottom", + "side": "#bottom" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": {}, + "1": { "model": "minecraft:upper_slab" } } -} + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteStairs.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteStairs.json index d15addf59..f6fbe75ba 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteStairs.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteStairs.json @@ -1,44 +1,54 @@ { - "variants": { - "facing=east,half=bottom,shape=straight": { "model": "actuallyadditions:blockTestifiBucksWhiteStairs" }, - "facing=west,half=bottom,shape=straight": { "model": "actuallyadditions:blockTestifiBucksWhiteStairs", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=straight": { "model": "actuallyadditions:blockTestifiBucksWhiteStairs", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=straight": { "model": "actuallyadditions:blockTestifiBucksWhiteStairs", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter" }, - "facing=west,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter" }, - "facing=north,half=bottom,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "y": 180, "uvlock": true }, - "facing=east,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner" }, - "facing=west,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "y": 180, "uvlock": true }, - "facing=south,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "y": 90, "uvlock": true }, - "facing=north,half=bottom,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "y": 270, "uvlock": true }, - "facing=east,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "y": 90, "uvlock": true }, - "facing=south,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner" }, - "facing=north,half=bottom,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "y": 180, "uvlock": true }, - "facing=east,half=top,shape=straight": { "model": "actuallyadditions:blockTestifiBucksWhiteStairs", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=straight": { "model": "actuallyadditions:blockTestifiBucksWhiteStairs", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=straight": { "model": "actuallyadditions:blockTestifiBucksWhiteStairs", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=straight": { "model": "actuallyadditions:blockTestifiBucksWhiteStairs", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=outer_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=outer_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsOuter", "x": 180, "uvlock": true }, - "facing=east,half=top,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "x": 180, "uvlock": true }, - "facing=west,half=top,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=south,half=top,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=north,half=top,shape=inner_right": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=east,half=top,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "x": 180, "y": 90, "uvlock": true }, - "facing=west,half=top,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "x": 180, "y": 270, "uvlock": true }, - "facing=south,half=top,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "x": 180, "y": 180, "uvlock": true }, - "facing=north,half=top,shape=inner_left": { "model": "actuallyadditions:blockTestifiBucksWhiteStairsInner", "x": 180, "uvlock": true } + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", + "top": "#bottom", + "side": "#bottom" } -} + }, + "variants": { + "normal": { "model": "minecraft:stairs" }, + "inventory": { "model": "minecraft:stairs" }, + "facing=east,half=bottom,shape=straight": { "model": "minecraft:stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "minecraft:stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "minecraft:inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "minecraft:stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "minecraft:outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "minecraft:inner_stairs", "x": 180, "y": 270, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteWall.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteWall.json index 940c4a6f0..f1f89c3bc 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteWall.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTestifiBucksWhiteWall.json @@ -1,5 +1,14 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "textures": { + "all": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" + }, + "transform": "forge:default-block" + }, "variants": { - "normal": { "model": "actuallyadditions:blockTestifiBucksWhiteWall" } + "normal": [{}], + "inventory": [{}] } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockTreasureChest.json b/src/main/resources/assets/actuallyadditions/blockstates/blockTreasureChest.json index bc6bcfa6e..68fdfa6fe 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockTreasureChest.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockTreasureChest.json @@ -1,8 +1,26 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockTreasureChest", + "down": "actuallyadditions:blocks/blockTreasureChestBottom", + "up": "actuallyadditions:blocks/blockTreasureChestTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockTreasureChestFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockTreasureChest", "y": 0 }, - "meta=1": { "model": "actuallyadditions:blockTreasureChest", "y": 180 }, - "meta=2": { "model": "actuallyadditions:blockTreasureChest", "y": -90 }, - "meta=3": { "model": "actuallyadditions:blockTreasureChest", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "y" : 0 }, + "1": { "y" : 180 }, + "2": { "y" : 270 }, + "3": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockWild.json b/src/main/resources/assets/actuallyadditions/blockstates/blockWild.json index 5f05e40d5..4755635d0 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockWild.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockWild.json @@ -1,8 +1,17 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cross", + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockCanolaStage4" }, - "meta=1": { "model": "actuallyadditions:blockFlaxStage6" }, - "meta=2": { "model": "actuallyadditions:blockRiceStage6" }, - "meta=3": { "model": "actuallyadditions:blockCoffeeStage6" } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "textures" : { "cross" : "actuallyadditions:blocks/blockCanolaStage4" } }, + "1": { "textures" : { "cross" : "actuallyadditions:blocks/blockFlaxStage6" } }, + "2": { "textures" : { "cross" : "actuallyadditions:blocks/blockRiceStage6" } }, + "3": { "textures" : { "cross" : "actuallyadditions:blocks/blockCoffeeStage6" } } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockXPSolidifier.json b/src/main/resources/assets/actuallyadditions/blockstates/blockXPSolidifier.json index 2f4234c7a..b1b9326cd 100644 --- a/src/main/resources/assets/actuallyadditions/blockstates/blockXPSolidifier.json +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockXPSolidifier.json @@ -1,8 +1,26 @@ { + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "actuallyadditions:blocks/blockXPSolidifier", + "down": "#particle", + "up": "actuallyadditions:blocks/blockXPSolidifierTop", + "south": "#particle", + "north": "actuallyadditions:blocks/blockXPSolidifierFront", + "east": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, "variants": { - "meta=0": { "model": "actuallyadditions:blockXPSolidifier", "y": 0 }, - "meta=1": { "model": "actuallyadditions:blockXPSolidifier", "y": 180 }, - "meta=2": { "model": "actuallyadditions:blockXPSolidifier", "y": -90 }, - "meta=3": { "model": "actuallyadditions:blockXPSolidifier", "y": 90 } + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "y" : 0 }, + "1": { "y" : 180 }, + "2": { "y" : 270 }, + "3": { "y" : 90 } + } } -} +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockmisc.json b/src/main/resources/assets/actuallyadditions/blockstates/blockmisc.json new file mode 100644 index 000000000..95c1376c4 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockmisc.json @@ -0,0 +1,23 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube_all", + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscBlackQuartzPillar" } }, + "1": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" } }, + "2": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscBlackQuartz" } }, + "3": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscOreBlackQuartz" } }, + "4": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscWoodCasing" } }, + "5": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscCharcoal" } }, + "6": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscEnderpearl" } }, + "7": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscLavaFactoryCase" } }, + "8": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscEnderCasing" } }, + "9": { "textures" : { "all" : "actuallyadditions:blocks/blockMiscIronCasing" } } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang index 3fe156d93..c8f469f96 100644 --- a/src/main/resources/assets/actuallyadditions/lang/de_DE.lang +++ b/src/main/resources/assets/actuallyadditions/lang/de_DE.lang @@ -569,21 +569,21 @@ booklet.actuallyadditions.clickToSeeRecipe=Klicke, um weitere Informationen zu e booklet.actuallyadditions.amountOfWords=%s Wörter insgesamt booklet.actuallyadditions.amountOfChars=%s Zeichen insgesamt -#Booklet Chapters -booklet.actuallyadditions.chapter.intro.name=An Introduction to ActAdd -booklet.actuallyadditions.chapter.intro.text.1=For too long have the people of Minecraftia toiled under a relentless whip. A whip more hurtful and more injurious than that of any slave-master: inconvenience. Aye, the thousand million inconveniences that make up the grind, that force players to waste hours- nay, days!- chopping wood and farming wheat and other such mundane tasks, just to momentarily escape the remorseless tedium and experience the true joys of Minecraftia, building, caving and adventuring into the beautiful uncharted abundance -booklet.actuallyadditions.chapter.intro.text.2=of the world. Yet no sooner has one immersed oneself in this creative enterprise than the inconveniences return, like millions of furious bees pestering, stinging, swarming all over you until the game ceases to be enjoyable, and you are driven away from it forever. To that end, a certain Ellpeck has created this Actual Addition to the world of Minecraft, that will allow the player to better engage with the core experiences of the game- building and adventuring- by automating and streamlining the monotony that -booklet.actuallyadditions.chapter.intro.text.3=is grinding in Minecraft. Therefore, Ellpeck humbly presents to you this Actually Additions Manual, that shall teach you the ways of this modification and, ultimately, allow you to transcend inconvenience and attain enlightenment. ~by Tulkas +#Booklet Chapters / Handbuch-Kapitel +booklet.actuallyadditions.chapter.intro.name=Einführung zu ActAdd +booklet.actuallyadditions.chapter.intro.text.1=Für eine zu lange Zeit haben die Bewohner von Minecraftien unter der Gewalt einer unerbittlichen Peitsche geschuftet. Eine Peitsche so verletzend und schädlich: einfach lästig. Ja, die millionenfachen Lästigkeiten aus denen diese Plage besteht, die die Spieler dazu zwingt Stunden - nein, sogar Tage! - Bäume zu fällen, Weizen zu farmen und anderen solch stumpfsinnigen Tätigkeiten nachzugehen, nur um augenblicklich der erbarmungslosen Langeweile zu entfliehen und die wirklichen +booklet.actuallyadditions.chapter.intro.text.2=Freuden in Minecraftien zu erleben, zu bauen und die tiefen und fernen Welten zu entdecken bis hin zum unerforschten Reichtum, der in dieser Welt steckt. Noch nicht früher ist jemand in diese kreative Unternehmung eingetaucht als die Unannehmlichkeiten zurückkehren, wie millionen rasende, lästige Bienen, stechend, um dich herum schwirred bis das Spiel aufhört Spaß zu machen, und du bist bis in alle Ewigkeit vertrieben. Zu diesem Zweck hat ein gewisser Ellpeck +booklet.actuallyadditions.chapter.intro.text.3=dieses Actually Additions geschaffen, welches dem Spieler erlaubt, sich mehr mit den Kernerlebnissen Minecrafts zu beschäftigen - bauen und abenteuern - indem die Monotonie automatisiert und rationalisiert wird, die Minecraft plagt. Deshalb präsentiert dir Ellpeck demütig dieses Handbuch, welches dir die Funktionen dieser Modifikation zeigen und, ultimativ, dir erlauben wird, die Unbequemlichkeiten zu überwinden und Erleuchtung zu erlangen. ~by Tulkas -booklet.actuallyadditions.chapter.craftingIngs.name=Crafting Ingredients -booklet.actuallyadditions.chapter.craftingIngs.text.1=Actually Additions has lots of items that use certain basic crafting items to be crafted. This chapter has all of these basic items grouped up so that you can see all of them at once. +booklet.actuallyadditions.chapter.craftingIngs.name=Werkel-Zutaten +booklet.actuallyadditions.chapter.craftingIngs.text.1=Actually Additions hat viele Gegenstände, die elementare Werkel-Gegenstände benötigen um hergestellt zu werden. In diesem Kapitel sind diese alle gruppiert, so kannst du sie alle auf einem Mal sehen. -booklet.actuallyadditions.chapter.quartz.name=Black Quartz -booklet.actuallyadditions.chapter.quartz.text.1=Black Quartz is an Ore that generates in the world between layer and . When broken, it can be smelted in a furnace or crushed in a crusher to get broken down into Black Quartz. -booklet.actuallyadditions.chapter.quartz.text.2=Black Quartz items are used in lots of Crafting Recipes in Actually Additions. They are very important for most of the Items and, thus, should be mined when found in the world. They can be crafted into a couple of different Decorative Blocks shown on the following pages. Every variant can also be crafted into Stairs, Slabs and Walls using the well-known recipes. Nether Quartz, but deadlier +booklet.actuallyadditions.chapter.quartz.name=Schwarzer Quarz +booklet.actuallyadditions.chapter.quartz.text.1=Schwarzer Quarz ist ein Erz welches in der Welt zwischen Ebene und generiert. Wenn es abgebaut wurde, kann es in einem Ofen geschmolzen or in einem Brecher gebrochen werden. +booklet.actuallyadditions.chapter.quartz.text.2=Der Gegenstand Schwarzer Quarz wird in der Herstellung vieler Dinge in Actually Additions gebraucht. Sie sind sehr wichtig, un solten deswegen abgebaut werden, wenn sie gefunden werden. Aus ihnen lassen sich einige dekorative Blöcke produzieren, welche auf den folgenden Seiten gezeigt werden. Jede Variante kann auch zu Treppen, Stufen oder Wänden weiterverarbeitet werden, indem man die gängigen Rezepte nutzt. Nether-Quarz, nur tötlicher -booklet.actuallyadditions.chapter.cloud.name=Smiley Cloud -booklet.actuallyadditions.chapter.cloud.text.1=The Smiley Cloud is a magical floating cloud which is getting put to life through the piece of Solidified Experience inside it. It hovers up and down in its place all jolly and fun, and when right-clicking, you can give it a name. When giving it certain special names like "Ellpeck" or "AcidBlues", it will have some special items it carries! +booklet.actuallyadditions.chapter.cloud.name=Smiley-Wolke +booklet.actuallyadditions.chapter.cloud.text.1=Die Smiley-Wolke ist eine magisch schwebende Wolke, in die Leben durch ein kleines Stück Verdichtete Erfahrung eingehaucht wird. Sie schwebt an ihrem Platz hoch und runter, ganz heiter und fröhlich, mit einem Rechtsklickkannst du ihr einen Namen geben. Wenn du ihr besondere Namen bibst, wie beispielsweise "Ellpeck" oder "AcidBlues", trägt sie ein paar besondere Gegenstände! booklet.actuallyadditions.chapter.coalStuff.name=Coal Stuff booklet.actuallyadditions.chapter.coalStuff.text.1=Sometimes your Coal just burns for too long or too short, you know what I mean? For that, you can now craft Tiny Coal, Tiny Charcoal and Blocks of Charcoal for using them in a furnace. While the Block of Charcoal burns for as long as a Block of Coal, the Tiny Coal and Tiny Charcoal will burn for one eighth of a piece of coal, meaning it will smelt one item in a normal furnace. diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index d999bd5b1..476ac608d 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -7,6 +7,75 @@ actuallyadditions.lolWutHowUDoDis.name=This is bugged. Throw it away. Please. fluid.actuallyadditions.oil=Oil fluid.actuallyadditions.canolaoil=Canola Oil +#Banners +item.banner.actuallyadditionsBook.black=Black Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.red=Red Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.green=Green Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.brown=Brown Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.blue=Blue Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.purple=Purple Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.cyan=Cyan Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.silver=Silver Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.gray=Gray Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.pink=Pink Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.lime=Lime Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.yellow=Yellow Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.lightBlue=LightBlue Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.magenta=Magenta Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.orange=Orange Actually Additions Manual Pattern +item.banner.actuallyadditionsBook.white=White Actually Additions Manual Pattern + +item.banner.actuallyadditionsPhanCon.black=Black Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.red=Red Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.green=Green Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.brown=Brown Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.blue=Blue Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.purple=Purple Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.cyan=Cyan Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.silver=Silver Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.gray=Gray Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.pink=Pink Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.lime=Lime Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.yellow=Yellow Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.lightBlue=LightBlue Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.magenta=Magenta Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.orange=Orange Phantom Connector Pattern +item.banner.actuallyadditionsPhanCon.white=White Phantom Connector Pattern + +item.banner.actuallyadditionsLeafBlo.black=Black Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.red=Red Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.green=Green Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.brown=Brown Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.blue=Blue Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.purple=Purple Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.cyan=Cyan Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.silver=Silver Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.gray=Gray Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.pink=Pink Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.lime=Lime Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.yellow=Yellow Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.lightBlue=LightBlue Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.magenta=Magenta Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.orange=Orange Leaf Blower Pattern +item.banner.actuallyadditionsLeafBlo.white=White Leaf Blower Pattern + +item.banner.actuallyadditionsDrill.black=Black Drill Pattern +item.banner.actuallyadditionsDrill.red=Red Drill Pattern +item.banner.actuallyadditionsDrill.green=Green Drill Pattern +item.banner.actuallyadditionsDrill.brown=Brown Drill Pattern +item.banner.actuallyadditionsDrill.blue=Blue Drill Pattern +item.banner.actuallyadditionsDrill.purple=Purple Drill Pattern +item.banner.actuallyadditionsDrill.cyan=Cyan Drill Pattern +item.banner.actuallyadditionsDrill.silver=Silver Drill Pattern +item.banner.actuallyadditionsDrill.gray=Gray Drill Pattern +item.banner.actuallyadditionsDrill.pink=Pink Drill Pattern +item.banner.actuallyadditionsDrill.lime=Lime Drill Pattern +item.banner.actuallyadditionsDrill.yellow=Yellow Drill Pattern +item.banner.actuallyadditionsDrill.lightBlue=LightBlue Drill Pattern +item.banner.actuallyadditionsDrill.magenta=Magenta Drill Pattern +item.banner.actuallyadditionsDrill.orange=Orange Drill Pattern +item.banner.actuallyadditionsDrill.white=White Drill Pattern + #NEI Integration container.nei.actuallyadditions.crushing.name=Crusher container.nei.actuallyadditions.crushingDouble.name=Double Crusher @@ -39,7 +108,9 @@ tile.actuallyadditions.blockMiscBlackQuartz.name=Block of Black Quartz tile.actuallyadditions.blockMiscBlackQuartzChiseled.name=Chiseled Block of Black Quartz tile.actuallyadditions.blockMiscBlackQuartzPillar.name=Pillar of Black Quartz tile.actuallyadditions.blockFeeder.name=Automatic Feeder -tile.actuallyadditions.blockGiantChest.name=Storage Crate +tile.actuallyadditions.blockGiantChest.name=Small Storage Crate +tile.actuallyadditions.blockGiantChestMedium.name=Medium Storage Crate +tile.actuallyadditions.blockGiantChestLarge.name=Large Storage Crate tile.actuallyadditions.blockGrinder.name=Crusher tile.actuallyadditions.blockGrinderDouble.name=Double Crusher tile.actuallyadditions.blockFurnaceDouble.name=Double Furnace @@ -72,7 +143,9 @@ tile.actuallyadditions.blockColoredLampPink.name=Pink Lamp tile.actuallyadditions.blockColoredLampCyan.name=Cyan Lamp tile.actuallyadditions.blockColoredLampPurple.name=Purple Lamp tile.actuallyadditions.blockPhantomface.name=Phantomface +tile.actuallyadditions.blockPlayerInterface.name=Player Interface tile.actuallyadditions.blockPhantomEnergyface.name=Phantom Energyface +tile.actuallyadditions.blockPhantomRedstoneface.name=Phantom Redstoneface tile.actuallyadditions.blockPhantomLiquiface.name=Phantom Liquiface tile.actuallyadditions.blockPhantomPlacer.name=Phantom Placer tile.actuallyadditions.blockPhantomBreaker.name=Phantom Breaker @@ -133,6 +206,12 @@ tile.actuallyadditions.blockChiseledQuartzSlab.name=Chiseled Black Quartz Slab tile.actuallyadditions.blockPillarQuartzWall.name=Black Quartz Pillar Wall tile.actuallyadditions.blockPillarQuartzStair.name=Black Quartz Pillar Stairs tile.actuallyadditions.blockPillarQuartzSlab.name=Black Quartz Pillar Slab +tile.actuallyadditions.blockLaserRelayItem.name=Item Laser Relay +tile.actuallyadditions.blockLaserRelayItemWhitelist.name=Advanced Item Laser Relay +tile.actuallyadditions.blockItemViewer.name=Item Interface +tile.actuallyadditions.blockImpureIron.name=Impure Iron +tile.actuallyadditions.blockBookletStand.name=Wall-Mount Manual +tile.actuallyadditions.blockDisplayStand.name=Display Stand #ESD tile.actuallyadditions.blockInputter.name=ESD @@ -331,6 +410,7 @@ item.actuallyadditions.itemChestQuartz.name=Black Quartz Chestplate item.actuallyadditions.itemPantsQuartz.name=Black Quartz Pants item.actuallyadditions.itemBootsQuartz.name=Black Quartz Boots item.actuallyadditions.itemBooklet.name=Actually Additions Manual +item.actuallyadditions.itemRarmorModuleReconstructor.name=Reconstruction Module item.actuallyadditions.itemLaserWrench.name=Laser Wrench item.actuallyadditions.itemChestToCrateUpgrade.name=Chest To Storage Crate Upgrade item.actuallyadditions.itemMiscDrillCore.name=Drill Core @@ -407,6 +487,14 @@ item.actuallyadditions.itemPaxelCrystalBlack.name=Void Crystal AIOT item.actuallyadditions.itemPaxelCrystalWhite.name=Enori Crystal AIOT item.actuallyadditions.itemPaxelCrystalGreen.name=Emeradic Crystal AIOT item.actuallyadditions.itemFoodBacon.name=Bacon +item.actuallyadditions.itemMiscEnderStar.name=Ender Star +item.actuallyadditions.itemSpawnerChanger.name=Spawner Changer +item.actuallyadditions.itemMiscSpawnerShard.name=Spawner Shards +item.actuallyadditions.itemMinecartFireworkBox.name=Firework Box Cart +item.actuallyadditions.itemWaterBowl.name=Bowl of Water +item.actuallyadditions.itemFilter.name=Item Filter +item.actuallyadditions.itemMiscBiomass.name=Biomass +item.actuallyadditions.itemMiscBiocoal.name=Bio Coal #Tooltips tooltip.actuallyadditions.onSuffix.desc=On @@ -435,7 +523,7 @@ tooltip.actuallyadditions.extraInfo.desc=Advanced Info tooltip.actuallyadditions.blockPhantomRange.desc=Range tooltip.actuallyadditions.laser.stored.desc= tooltip.actuallyadditions.laser.connected.desc= -tooltip.actuallyadditions.laser.cantConnect.desc=Can't connect: The relays are either part of the same network, the stored relay doesn't exist anymore or it is too far away! +tooltip.actuallyadditions.laser.cantConnect.desc=Can't connect: The relays are either part of the same network, the stored relay isn't the same type or doesn't exist anymore or it is too far away! tooltip.actuallyadditions.itemBooklet.desc=Or "Booklet", if you will #Gui Information @@ -458,13 +546,20 @@ info.actuallyadditions.gui.blacklist=Blacklist info.actuallyadditions.gui.coffee=Coffee info.actuallyadditions.gui.ok=Ok info.actuallyadditions.gui.the=the +info.actuallyadditions.gui.smart=Smart Whitelist +info.actuallyadditions.gui.smartInfo=When pressing this, all items from inventories adjacent to this relay will be added to this part of the white- or blacklist. Adding Item Filters to the list before will cause them to also be filled. info.actuallyadditions.inputter.info.1=This is the first Slot in the connected Inventory to

at. info.actuallyadditions.inputter.info.2=This is the slot after the last Slot in the connected Inventory to

at. What that means: If you, for example, write 2 in the field to the left and 5 in this one, it will

at Slot 2, 3, and 4. -info.actuallyadditions.inputter.whitelistInfo=This applies for this part of the white-/blacklist. The other side applies as well, so you can have some Items whitelisted and some blacklisted. Note that, if you have an empty blacklist or an item whitelisted on at least one side, it will always go through. +info.actuallyadditions.inputter.whitelistInfo=When pressing this, this side's whitelist mode will be changed. To let all items through, an empty blacklist can be used, to let no items through, an empty whitelist can be used. To configure certain items, place them or configured Item Filters in the slots. info.actuallyadditions.noLens=No Lens -info.actuallyadditions.booklet.manualName.1=Actually Additions +info.actuallyadditions.booklet.manualName.1.1=Actually Additions +info.actuallyadditions.booklet.manualName.1.2=Actual Additions +info.actuallyadditions.booklet.manualName.1.3=Actually Addiction +info.actuallyadditions.booklet.manualName.1.4=Actual Edition +info.actuallyadditions.booklet.manualName.1.5=Actual Addition info.actuallyadditions.booklet.manualName.2=Manual info.actuallyadditions.booklet.edition=Edition +info.actuallyadditions.deathRecorded=Your death has been recorded. Use a Death Tracker to find the death location! #Container Names container.actuallyadditions.inputter.name=ESD @@ -473,7 +568,9 @@ container.actuallyadditions.grinder.name=Crusher container.actuallyadditions.grinderDouble.name=Double Crusher container.actuallyadditions.furnaceDouble.name=Double Furnace container.actuallyadditions.feeder.name=Feeder -container.actuallyadditions.giantChest.name=Storage Crate +container.actuallyadditions.giantChest.name=Small Storage Crate +container.actuallyadditions.giantChestMedium.name=Medium Storage Crate +container.actuallyadditions.giantChestLarge.name=Large Storage Crate container.actuallyadditions.repairer.name=Repairer container.actuallyadditions.placer.name=Placer container.actuallyadditions.breaker.name=Breaker @@ -499,6 +596,8 @@ container.actuallyadditions.cloud.name=Smiley Cloud container.actuallyadditions.directionalBreaker.name=Long-Range Breaker container.actuallyadditions.rangedCollector.name=Ranged Collector container.actuallyadditions.miner.name=Vertical Digger +container.actuallyadditions.laserRelayItemWhitelist.name=Laser Relay +container.actuallyadditions.filter.name=Item Filter #Update Information info.actuallyadditions.update.generic=[{"text":"There is an Update for "},{"text":"Actually Additions ","color":"dark_green"},{"text":"available!","color":"none"}] @@ -508,7 +607,7 @@ info.actuallyadditions.update.buttonOptions=Click: Changelog, Shift-Click: Downl info.actuallyadditions.update.failed=[{"text":"The Update Check for "},{"text":"Actually Additions ","color":"dark_green"},{"text":"failed! Check Logs for more Info!","color":"none"}] #Achievements -achievement.actuallyadditions.openBooklet=Screams of Knowledge +achievement.actuallyadditions.openBooklet=Knowledge Bringer! achievement.actuallyadditions.openBooklet.desc=Open an Actually Additions Manual achievement.actuallyadditions.nameSmileyCloud=Your best friend @@ -547,6 +646,12 @@ achievement.actuallyadditions.pickUpCoffee.desc=Harvest some coffee achievement.actuallyadditions.craftCoffeeMachine=Addiction in cups achievement.actuallyadditions.craftCoffeeMachine.desc=Craft a Coffee Machine +achievement.actuallyadditions.obscured=§ksome chieve name +achievement.actuallyadditions.obscured.desc=§klolwut y u actually look over meow + +achievement.actuallyadditions.craftFireworkBox=Bang Boom Bang +achievement.actuallyadditions.craftFireworkBox.desc=Craft a Firework Box + #Booklet Recipe Names booklet.actuallyadditions.shapelessRecipe=Shapeless Recipe booklet.actuallyadditions.shapedRecipe=Shaped Recipe @@ -556,6 +661,7 @@ booklet.actuallyadditions.shapedOreRecipe=Shaped OreDictionary Recipe #Booklet Entries booklet.actuallyadditions.indexEntry.gettingStarted.name=Getting Started booklet.actuallyadditions.indexEntry.misc.name=Miscellaneous +booklet.actuallyadditions.indexEntry.crossover.name=Mod Crossover booklet.actuallyadditions.indexEntry.functionalNoRF.name=Blocks that don't use RF booklet.actuallyadditions.indexEntry.allAndSearch.name=All Items and Search booklet.actuallyadditions.indexEntry.functionalRF.name=Blocks that use RF @@ -565,7 +671,7 @@ booklet.actuallyadditions.indexEntry.itemsRF.name=Items that use RF #Booklet Info booklet.actuallyadditions.recipeDisabled=The crafting recipe for this item is disabled in the Config File! If you're on a server, ask the server author to enable it in the config. If you're on a client, press the 'Open Config'-Button on the top right and enable the recipe! -booklet.actuallyadditions.unavailable=Parts of this feature are currently disabled or incomplete due to the not fully complete 1.8.9 Port. You may experience something that's missing or doesn't fully work. Please use this item with caution! +booklet.actuallyadditions.unavailable=Parts of this feature are currently disabled or incomplete due to the not fully complete 1.8.9 and 1.9 Port. You may experience something that's missing or doesn't fully work. Please use this item with caution! booklet.actuallyadditions.clickToSeeRecipe=Click to see more Information booklet.actuallyadditions.amountOfWords=%s words in total booklet.actuallyadditions.amountOfChars=%s characters in total @@ -630,13 +736,13 @@ booklet.actuallyadditions.chapter.feeder.name=Feeder booklet.actuallyadditions.chapter.feeder.text.1=The Feeder is a good alternative to a manual animal farm. Place it in the middle of an animal pen and supply it with some wheat, seeds or carrots, depending on the animal you want to feed, and just wait. It will automatically feed the animals and if there is enough animals near it, it will shut off on its own to prevent lag or animal overflow. Greenpeace approves booklet.actuallyadditions.chapter.compost.name=Compost and Fertilizer -booklet.actuallyadditions.chapter.compost.text.1=The Compost is used to make Fertilizier from Mashed Food. Fertilizer acts just like Bone Meal, but can be crafted in a much simpler manner just by crafting Mashed Food and then putting of those inside of a Compost and waiting for a bit. When the mashed food is composted, just take it out by right-clicking again. +booklet.actuallyadditions.chapter.compost.text.1=The Compost is used to make Fertilizier from Mashed Food. Fertilizer acts just like Bone Meal, but can be crafted in a much simpler manner just by crafting Mashed Food and then putting 10 of those inside of a Compost and waiting for a bit. When the mashed food is composted, just take it out by right-clicking again. This, however, also works for some other items, which will be explained when needed. booklet.actuallyadditions.chapter.compost.text.3=Mashed Food can be crafted from any type of food or plantable item. booklet.actuallyadditions.chapter.crate.name=Storage Crates -booklet.actuallyadditions.chapter.crate.text.1=Storage Crates are big. Really big. They hold tons of items, more than 4 chests worth of them. -booklet.actuallyadditions.chapter.crate.text.2=Placing a Storage Crate Keeper inside the Storage Crate before breaking it will cause it to keep all of its items, however the Keeper will be destroyed upon placing the Crate back down. -booklet.actuallyadditions.chapter.crate.text.3=The Chest To Storage Crate Upgrade allows you to convert any chest into a Storage Crate, retaining its items! Just shift-right-click onto the chest to apply it. +booklet.actuallyadditions.chapter.crate.text.1=Storage Crates are big. Really big. They hold tons of items, more than 4 chests worth of them. Not only that, but they can be upgraded in size! View the following pages to get information on that and some other items regarding crates! +booklet.actuallyadditions.chapter.crate.text.4=Placing a Storage Crate Keeper inside the Storage Crate before breaking it will cause it to keep all of its items, however the Keeper will be destroyed upon placing the Crate back down. +booklet.actuallyadditions.chapter.crate.text.5=The Chest To Storage Crate Upgrade allows you to convert any chest into a Storage Crate, retaining its items! Just shift-right-click onto the chest to apply it. booklet.actuallyadditions.chapter.coffeeMachine.name=Coffee Machine booklet.actuallyadditions.chapter.coffeeMachine.text.1=The Coffee Machine is a block used to make Coffee, a potion-like item that gives the user several buffs. To use the coffee machine, you need a Empty Cup, Coffee Beans, which can be found in the wild, harvested and planted on farmland again, RF/t and mB of Water per cup brewed. On the coffee machine recipe pages at the back, to see what the item does, just hover over the Cup of Coffee. @@ -646,7 +752,7 @@ booklet.actuallyadditions.chapter.coffeeMachine.text.6=Milk is an impor booklet.actuallyadditions.chapter.coffeeMachine.text.7=The fact that you're reading this means that you either have HarvestCraft installed, or that you're looking at the lang file. This does the same thing as Milk, but for veggie guys. booklet.actuallyadditions.chapter.crusher.name=Crusher and Double Crusher -booklet.actuallyadditions.chapter.crusher.text.1=The Crusher turns every ore, ingot and gem into its corresponding dust using RF/t. When you put in Ores however, they will yield 2 pieces of dust. The Double Crusher basically does the same, however it can crush two ores at a time and uses RF/t. On the following pages, you can see some additional useful recipes for inside the crusher. He's my crush +booklet.actuallyadditions.chapter.crusher.text.1=The Crusher turns every ore, ingot and gem into its corresponding dust using RF/t. When you put in Ores however, they will yield 2 pieces of dust. The Double Crusher basically does the same, however it can crush two ores at a time. On the following pages, you can see some additional useful recipes for inside the crusher. He's my crush booklet.actuallyadditions.chapter.furnaceDouble.name=Double Furnace booklet.actuallyadditions.chapter.furnaceDouble.text.1=The Double Furnace works like a furnace, however, it uses RF/t and can smelt two items at a time. @@ -672,6 +778,7 @@ booklet.actuallyadditions.chapter.heatCollector.text.1=The Heat Collector< booklet.actuallyadditions.chapter.canola.name=Everything Canola booklet.actuallyadditions.chapter.canola.text.1=There is lots of stuff that can be produced from Canola (which can be found in the wild and then planted and harvested!): You can make Canola Oil, Oil and produce RF from it. The way to do that is to take some Canola, put it into a Canola Press which uses RF/t. That creates mB of Canola Oil. Put that into a Fermenting Barrel, let it sit there for a while before it converts into Oil. That oil can then be used in a Oil Generator to create RF/t. +booklet.actuallyadditions.chapter.canola.text.2=Additionally, if you have a lot of Canola Seeds left over from all of the farming you have been doing, you can put 20 at at time into a Compost, which will turn them into Biomass. The Biomass can then be put into a furnace, causing it to be smelted into Bio Coal which can be used for smelting almost as much items as a regular piece of coal. booklet.actuallyadditions.chapter.wings.name=Wings Of The Bats booklet.actuallyadditions.chapter.wings.text.1=Sometimes, bats will drop Wings. These wings can't really be used to fly, but that's just because they're not powerful enough. To make them more powerful, you can craft Wings Of The Bats. When you have these in your inventory, they will allow you to fly like in creative mode. @@ -732,6 +839,7 @@ booklet.actuallyadditions.chapter.hairBalls.text.2=Balls of Fur are an booklet.actuallyadditions.chapter.laserRelays.name=Laser Relays booklet.actuallyadditions.chapter.laserRelays.text.1=The Laser Relay is a block that can wirelessly transfer RF just by being connected with a Laser Wrench, generating a network. When placing a Power Generator or Receiver next to the relay, it can receive Power from any other relay in the network. Two relays can be at most blocks apart. During an energy transfer, they have an Energy Loss of %. +booklet.actuallyadditions.chapter.laserRelays.text.4=The Laser Wrench's mode can be switched by sneak-right-clicking it anywhere. Possible modes are to always show lasers, never show lasers or only show lasers when holding the wrench. booklet.actuallyadditions.chapter.blackLotus.name=Black Lotus booklet.actuallyadditions.chapter.blackLotus.text.1=Think of this: You need to craft black wool, black clay or anything else that needs black dye but you are just guilty about killing so many innocent squids? Well, the Black Lotus is exactly the thing you need! Just look around in the wild a bit, and you will find one, then being able to craft some Black Dye that can be used instead of Ink Sacs so that you don't need to kill poor squids and L any longer. @@ -766,5 +874,48 @@ booklet.actuallyadditions.chapter.fireworkBox.name=Firework Box booklet.actuallyadditions.chapter.fireworkBox.text.1=The Firework Box is a perfect thing for New Year's! When placed down and supplied with some RF, it will shoot out some randomly generated Fireworks around it. For each shot, it uses RF. You know, Vanilla Fireworks are just too bloody annoying to craft, but too awesome not to use. So here's the solution. booklet.actuallyadditions.chapter.fireworkBox.text.2=When right-clicking it with a Redstone Torch in hand, it will change between a mode where it gets deactivated by Redstone and a mode where it responds to pulses. -booklet.actuallyadditions.chapter.rf.name=RF (Redstone Flux) -booklet.actuallyadditions.chapter.rf.text.1=For anyone who hasn't used much of a mod that uses RF yet, here's a quick explanation. Redstone Flux, or RF for short, is a power system used by many mods. The basic concept is is that lots of machines generate or use it every game tick. That's what RF/t means. To connect a power generating (thus, outputting) machine to one that needs (thus, receives) power, just place it next to it. What's a fourth wall? \ No newline at end of file +booklet.actuallyadditions.chapter.rf.name=RF? Tesla? +booklet.actuallyadditions.chapter.rf.text.1=For anyone who hasn't used much of a mod that uses RF yet, here's a quick explanation. Redstone Flux is a power system used by many mods. The basic concept is is that machines generate or use it every game tick. That's what RF/t means. To connect machines, just place them next to each other. Also, if you fancy that sort of thing, all machines also work with Tesla in the same way they do with RF. + +booklet.actuallyadditions.chapter.enderStar.name=Ender Star +booklet.actuallyadditions.chapter.enderStar.text.1=The Ender Star can be obtained by both killing a wither and going to the end to collect Dragon's Breath. The latter is obtained by using a bottle on the purple particles that the dragon spits out. The Ender Star is used for multiple crafting recipes. + +booklet.actuallyadditions.chapter.phantomRedstoneface.name=Phantom Redstoneface +booklet.actuallyadditions.chapter.phantomRedstoneface.text.1=If you don't know what Phantomfaces are, check the Phantomfaces Entry first. The Phantom Redstoneface can be used to transmit redstone signals. This one, however, works differently to the other Phantomfaces as it only works in one direction. What this means is that the connected block has to provide redstone power for redstone next to the Redstoneface to become powered. It does not work the other way around. + +booklet.actuallyadditions.chapter.spawnerShard.name=Spawner Shards +booklet.actuallyadditions.chapter.spawnerShard.text.1=The Spawner Shards are a crafting ingredient found by breaking spawners. Once a spawner in the world is broken, it will always drop one Shard. + +booklet.actuallyadditions.chapter.spawnerChanger.name=Spawner Changer +booklet.actuallyadditions.chapter.spawnerChanger.text.1=The Spawner Changer is an item that can be used to manipulate the mobs that spawners spawn. This can be accomplished by first of all picking up the desired mob to spawn with the Changer, killing it in the process. Next, the Changer can be right-clicked on the spawner, causing the spawner to be changed. This process probably won't work with every type of mob though. + +booklet.actuallyadditions.chapter.itemStorage.name=Laser Relay Item Storage +booklet.actuallyadditions.chapter.itemStorage.text.1=Additionally to the Laser Relays that transfer RF, there are also Item Laser Relays that are able to transfer items. This works in a verry different way though. To connect Item Laser Relays together works the same as connecting normal ones, however, you need an Item Interface to be able to interact with them. You can place any inventories (such as chests and furnaces) next to the Item Laser Relays, but to be pulled out from or inputted into, there needs to be an Item Interface connected +booklet.actuallyadditions.chapter.itemStorage.text.2=to one of the Item Laser Relays. To input or output items in the system, just pipe them into the interface. If you want a way to make a storage system with this, there are also Advanced Item Laser Relays, in which, by sneak-right-clicking them, you can specify which items are allowed and disallowed to enter or exit inventories connected to this particular relay. When placing an advanced relay next to an Item Interface, this effect also applies. + +booklet.actuallyadditions.chapter.banners.name=Additional Banners +booklet.actuallyadditions.chapter.banners.text.1=For special items in Actually Additions, there is also special Banner patterns. All of these just require the item next to the banner in the crafting grid with, optionally, a color. You can also combine them with a Shield like normal. The items that have a banner pattern are: The Actually Additions Manual The Phantom Connector The Leaf Blower (not the advanced version) The Drill (only the white one works due to the way banners work) + +booklet.actuallyadditions.chapter.lushCaves.name=Lush Caves +booklet.actuallyadditions.chapter.lushCaves.text.1=If you have ever done any Cave exploration, you will have probably noticed some caves that have trees and grass inside of them. These can be found at any height underground all over the world, and they can be very valuable when needing wood for torches and tools at some point. If you didn't ever see one before, look on the next page for a picture! + +booklet.actuallyadditions.chapter.bookStand.name=Wall-Mount Manual +booklet.actuallyadditions.chapter.bookStand.text.1=The Manual Stand is a block that is supposed to mainly be used on Servers. You can, provided you are the person who placed it down, set a page in the GUI that will open when someone else accesses it by pressing the "Set Page"-button while being on the desired page. The Wall-Mount Manual does not save pages another player navigated to, meaing re-accessing the Manual will cause it to always end up on the page speficied by the placer. +booklet.actuallyadditions.chapter.bookStand.text.2=People were using this not to have to have a manual item on their hotbar. This is not supposed to be used for that, because the Actually Additions Manual has bookmarks and also keeps the page you were on before. This, however, does neither. This was also originally made for Better Than Minecon. But whatever. + +booklet.actuallyadditions.chapter.waterBowl.name=Bowl of Water +booklet.actuallyadditions.chapter.waterBowl.text.1=The Bowl of Water can be obtained by right-cliking a bowl on water anywhere in the world. When the Bowl of Water is then right-clicked onto a block, the water will be placed, much like a Bucket. This can be used, for example, for early game farms. + +booklet.actuallyadditions.chapter.playerInterface.name=Player Interface +booklet.actuallyadditions.chapter.playerInterface.text.1=The Player Interface works in a similar way to the Phantomface, except it is connected to a player instead of a block, and the connection is established by placing it down. When inputting items, they will move to the player's inventory. Also, when inputting RF, it will charge the items in the player's inventory. It has a default range of blocks, however, it can be expanded by placing up to 3 Phantom Boosters on top of it. + +booklet.actuallyadditions.chapter.displayStand.name=Display Stand +booklet.actuallyadditions.chapter.displayStand.text.1=The Display Stand is a block that can, for one, display any item or block by right-clicking with it onto the display stand. It will then be floating around on top. To take it out of there again, just right-click with an empty hand. The other feature, however, is that some items can be put onto it, having special effects. This, however, will require the stand to get RF. Read more on the next page. +booklet.actuallyadditions.chapter.displayStand.text.2=The Leaf Blower and Advanced Leaf Blower can be placed onto the display stand, resulting in the grass and leaves around it to be blown away. Potion Rings can be placed onto the display stand. The normal version will give the specified potion effect to only one living entity in a small area, while the advanced version will give a potion effect to all living entities in a big area while using up a significant amount of RF. + +booklet.actuallyadditions.chapter.itemFilter.name=Item Filter +booklet.actuallyadditions.chapter.itemFilter.text.1=The Item Filter can be used in Advanced Item Laser Relays, ESDs and Ranged Collectors to enlargen the size of their whitelist. This can be done by right-clicking with the filter in hand and placing items to be filtered inside of it. The filter can then be placed into any whitelist slot in the desired machine. For more information on this, hover over the whitelist buttons in the GUIs of whitelistable machines! + +booklet.actuallyadditions.chapter.videoGuide.name=A Video Guide +booklet.actuallyadditions.chapter.videoGuide.text.1=If you are a bit confused as to what is going on or just want to get a glimpse of what Actually Additions has to offer, there is this brilliant video by a guy called Booty Toast (yes, that is a weird name), that shows off what is possible in a really enjoyable way. Just click the button to have the video opened on YouTube! Give it a watch! +booklet.actuallyadditions.chapter.videoGuide.page.1.button=Watch Video \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockAtomicReconstructor.json b/src/main/resources/assets/actuallyadditions/models/block/blockAtomicReconstructor.json deleted file mode 100644 index fc39cc403..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockAtomicReconstructor.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockAtomicReconstructor", - "down": "actuallyadditions:blocks/blockAtomicReconstructorTop", - "up": "actuallyadditions:blocks/blockAtomicReconstructorTop", - "north": "actuallyadditions:blocks/blockAtomicReconstructorFront", - "east": "actuallyadditions:blocks/blockAtomicReconstructor", - "south": "actuallyadditions:blocks/blockAtomicReconstructor", - "west": "actuallyadditions:blocks/blockAtomicReconstructor" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockBlackLotus.json b/src/main/resources/assets/actuallyadditions/models/block/blockBlackLotus.json deleted file mode 100644 index 2cd8f388a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockBlackLotus.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockBlackLotus" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockBookletStand.json b/src/main/resources/assets/actuallyadditions/models/block/blockBookletStand.json new file mode 100644 index 000000000..276aec831 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockBookletStand.json @@ -0,0 +1,49 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "actuallyadditions:blocks/models/modelBookletStand", + "tex": "actuallyadditions:blocks/models/modelBookletStand" + }, + "elements": [ + { + "from": [0.01,3,0], + "to": [0.01,14,16], + "faces": { + "west": { + "uv": [9,0,13,2.5], + "texture": "#tex" + }, + "east": { + "uv": [9,0,13,2.5], + "texture": "#tex" + } + } + }, + { + "from": [0.01,4,1], + "to": [1.01,13,15], + "faces": { + "up": { + "uv": [0.25,4.75,3.75,5], + "texture": "#tex" + }, + "down": { + "uv": [0.25,4.75,3.75,5], + "texture": "#tex" + }, + "east": { + "uv": [0.25,5,4,7], + "texture": "#tex" + }, + "north": { + "uv": [0,5,0.25,7], + "texture": "#tex" + }, + "south": { + "uv": [0,5,0.25,7], + "texture": "#tex" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockBreaker.json b/src/main/resources/assets/actuallyadditions/models/block/blockBreaker.json deleted file mode 100644 index 893606b7a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockBreaker.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockBreaker", - "down": "actuallyadditions:blocks/blockBreakerTop", - "up": "actuallyadditions:blocks/blockBreakerTop", - "north": "actuallyadditions:blocks/blockBreakerFront", - "east": "actuallyadditions:blocks/blockBreaker", - "south": "actuallyadditions:blocks/blockBreaker", - "west": "actuallyadditions:blocks/blockBreaker" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaPress.json b/src/main/resources/assets/actuallyadditions/models/block/blockCanolaPress.json deleted file mode 100644 index a2a0b20fc..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaPress.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockCanolaPress", - "down": "actuallyadditions:blocks/blockCanolaPressTop", - "up": "actuallyadditions:blocks/blockCanolaPressTop", - "north": "actuallyadditions:blocks/blockCanolaPress", - "east": "actuallyadditions:blocks/blockCanolaPress", - "south": "actuallyadditions:blocks/blockCanolaPress", - "west": "actuallyadditions:blocks/blockCanolaPress" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage1.json b/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage1.json deleted file mode 100644 index 701445f89..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCanolaStage1" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage2.json b/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage2.json deleted file mode 100644 index d369d5d30..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCanolaStage2" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage3.json b/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage3.json deleted file mode 100644 index e2a41155c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage3.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCanolaStage3" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage4.json b/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage4.json deleted file mode 100644 index e53ff1a48..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCanolaStage4.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCanolaStage4" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzSlabBottom.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzSlabBottom.json deleted file mode 100644 index b4a7eaf35..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzSlabBottom.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/half_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzSlabTop.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzSlabTop.json deleted file mode 100644 index ddf83e692..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzSlabTop.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/upper_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairs.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairs.json deleted file mode 100644 index 0fbfe8c44..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairsInner.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairsInner.json deleted file mode 100644 index 612463832..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairsInner.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/inner_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairsOuter.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairsOuter.json deleted file mode 100644 index 828f36336..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzStairsOuter.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/outer_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallInventory.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallInventory.json index 6bd5ceffd..1cb504a30 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallInventory.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallInventory.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_inventory", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorth.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorth.json deleted file mode 100644 index 84e67485f..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_n", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthEast.json deleted file mode 100644 index 6fa69c0be..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ne", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthEastSouthWest.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthEastSouthWest.json deleted file mode 100644 index d9c658e20..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthEastSouthWest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nsew", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouth.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouth.json deleted file mode 100644 index ba012904e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthAbove.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthAbove.json deleted file mode 100644 index efbea0d33..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthAbove.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns_above", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthEast.json deleted file mode 100644 index 332d8f22a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nse", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthEastWest.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthEastWest.json deleted file mode 100644 index d9c658e20..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallNorthSouthEastWest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nsew", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallPost.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallPost.json index 47dbbfc69..0fcadaea6 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallPost.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallPost.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_post", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallSide.json b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallSide.json new file mode 100644 index 000000000..48e5c7195 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockChiseledQuartzWallSide.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCoalGenerator.json b/src/main/resources/assets/actuallyadditions/models/block/blockCoalGenerator.json deleted file mode 100644 index c25db6ec0..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCoalGenerator.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockCoalGenerator", - "down": "actuallyadditions:blocks/blockCoalGeneratorBottom", - "up": "actuallyadditions:blocks/blockCoalGeneratorTop", - "north": "actuallyadditions:blocks/blockCoalGenerator", - "east": "actuallyadditions:blocks/blockCoalGenerator", - "south": "actuallyadditions:blocks/blockCoalGenerator", - "west": "actuallyadditions:blocks/blockCoalGenerator" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage1.json b/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage1.json deleted file mode 100644 index 418a1ae50..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCoffeeStage1" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage2.json b/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage2.json deleted file mode 100644 index 0c406180e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCoffeeStage2" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage3.json b/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage3.json deleted file mode 100644 index 217d6a18c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage3.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCoffeeStage3" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage4.json b/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage4.json deleted file mode 100644 index 4ce34a28c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage4.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCoffeeStage4" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage5.json b/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage5.json deleted file mode 100644 index aa93e5649..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage5.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCoffeeStage5" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage6.json b/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage6.json deleted file mode 100644 index c3754df6c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCoffeeStage6.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockCoffeeStage6" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlack.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlack.json deleted file mode 100644 index b58a07632..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlack.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampBlack" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlackOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlackOn.json deleted file mode 100644 index 3f389fa3e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlackOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnBlack" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlue.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlue.json deleted file mode 100644 index f7340b8aa..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlue.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampBlue" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlueOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlueOn.json deleted file mode 100644 index d6be052d4..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBlueOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnBlue" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBrown.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBrown.json deleted file mode 100644 index be1970d85..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBrown.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampBrown" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBrownOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBrownOn.json deleted file mode 100644 index 9a9eaaa59..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampBrownOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnBrown" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampCyan.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampCyan.json deleted file mode 100644 index 06e8bd035..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampCyan.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampCyan" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampCyanOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampCyanOn.json deleted file mode 100644 index 73872bd4a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampCyanOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnCyan" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGray.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGray.json deleted file mode 100644 index 8d50ff038..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGray.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampGray" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGrayOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGrayOn.json deleted file mode 100644 index 366e9f866..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGrayOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnGray" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGreen.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGreen.json deleted file mode 100644 index b4458a516..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGreen.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampGreen" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGreenOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGreenOn.json deleted file mode 100644 index 97ef2a9be..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampGreenOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnGreen" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightBlue.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightBlue.json deleted file mode 100644 index 879a1db86..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightBlue.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampLightBlue" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightBlueOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightBlueOn.json deleted file mode 100644 index 5efb5a904..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightBlueOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnLightBlue" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightGray.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightGray.json deleted file mode 100644 index 5a5f401c6..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightGray.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampLightGray" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightGrayOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightGrayOn.json deleted file mode 100644 index d9a17201d..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLightGrayOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnLightGray" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLime.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLime.json deleted file mode 100644 index df04b90e5..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLime.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampLime" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLimeOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLimeOn.json deleted file mode 100644 index 963a9b4f2..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampLimeOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnLime" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampMagenta.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampMagenta.json deleted file mode 100644 index 200bdbf98..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampMagenta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampMagenta" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampMagentaOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampMagentaOn.json deleted file mode 100644 index 9971c4b0c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampMagentaOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnMagenta" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampOrange.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampOrange.json deleted file mode 100644 index 13041fc16..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampOrange.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOrange" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampOrangeOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampOrangeOn.json deleted file mode 100644 index 90ba5c811..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampOrangeOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnOrange" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPink.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPink.json deleted file mode 100644 index b4c9148cd..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPink.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampPink" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPinkOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPinkOn.json deleted file mode 100644 index c4e998ce2..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPinkOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnPink" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPurple.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPurple.json deleted file mode 100644 index 610b96d42..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPurple.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampPurple" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPurpleOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPurpleOn.json deleted file mode 100644 index 018618f74..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampPurpleOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnPurple" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampRed.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampRed.json deleted file mode 100644 index b17078a13..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampRed.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampRed" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampRedOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampRedOn.json deleted file mode 100644 index 13bca6d0d..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampRedOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnRed" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampWhite.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampWhite.json deleted file mode 100644 index 35ee994b2..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampWhite.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampWhite" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampWhiteOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampWhiteOn.json deleted file mode 100644 index 565ed6b5e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampWhiteOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnWhite" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampYellow.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampYellow.json deleted file mode 100644 index dcc68f867..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampYellow.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampYellow" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampYellowOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampYellowOn.json deleted file mode 100644 index 5f8c85c54..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockColoredLampYellowOn.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockColoredLampOnYellow" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCompost.json b/src/main/resources/assets/actuallyadditions/models/block/blockCompost.json index cfbf9d3b0..66fa0bc77 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCompost.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockCompost.json @@ -1,6 +1,6 @@ { "__createdBy": "canitzp", - "ambientocclusion": true, + "ambientocclusion": false, "textures": { "particle": "blocks/planks_oak", "compost": "actuallyadditions:blocks/models/modelCompost" @@ -16,7 +16,7 @@ }, "down": { "uv": [0.0,0.0,2.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "west": { "uv": [0,0.2,1.2,3.625], @@ -46,7 +46,7 @@ }, "down": { "uv": [0.0,0.0,2.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "west": { "uv": [0,0.4,1.2,3.625], @@ -76,7 +76,7 @@ }, "down": { "uv": [0.0,0.0,2.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "west": { "uv": [0,0.2,1.2,3.625], @@ -106,7 +106,7 @@ }, "down": { "uv": [0.0,0.0,2.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "west": { "uv": [0,0.2,1.2,3.625], @@ -136,7 +136,7 @@ }, "down": { "uv": [0.0,0.0,1.0,10.0], - "texture": "missingtexture" + "texture": "#compost" }, "west": { "uv": [0,0.6,8.4,1.6], @@ -148,11 +148,11 @@ }, "north": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "south": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" } } }, @@ -166,15 +166,15 @@ }, "down": { "uv": [0.0,0.0,10.0,1.0], - "texture": "missingtexture" + "texture": "#compost" }, "west": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "east": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "north": { "uv": [0,1.375,7.5,2.125], @@ -196,7 +196,7 @@ }, "down": { "uv": [0.0,0.0,1.0,10.0], - "texture": "missingtexture" + "texture": "#compost" }, "west": { "uv": [0,1.375,7.5,2.125], @@ -208,11 +208,11 @@ }, "north": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "south": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" } } }, @@ -226,15 +226,15 @@ }, "down": { "uv": [0.0,0.0,10.0,1.0], - "texture": "missingtexture" + "texture": "#compost" }, "west": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "east": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "north": { "uv": [0,1.375,7.5,2.125], @@ -260,11 +260,11 @@ }, "west": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "east": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "north": { "uv": [0,1.375,7.5,2.125], @@ -328,11 +328,11 @@ }, "north": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "south": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" } } }, @@ -350,11 +350,11 @@ }, "west": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "east": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "north": { "uv": [0,1.375,7.5,2.125], @@ -388,11 +388,11 @@ }, "north": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "south": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" } } }, @@ -418,11 +418,11 @@ }, "north": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "south": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" } } }, @@ -440,11 +440,11 @@ }, "west": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "east": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "north": { "uv": [0,1.375,7.5,2], @@ -470,11 +470,11 @@ }, "west": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "east": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "north": { "uv": [0,1.375,7.5,2], @@ -508,11 +508,11 @@ }, "north": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" }, "south": { "uv": [0.0,0.0,1.0,2.0], - "texture": "missingtexture" + "texture": "#compost" } } } diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/block/blockCrystalBlack.json deleted file mode 100644 index 454d2d55b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalBlack.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockCrystalBlack" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/block/blockCrystalBlue.json deleted file mode 100644 index 51a0f7f6d..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalBlue.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockCrystalBlue" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/block/blockCrystalGreen.json deleted file mode 100644 index 4c5a94584..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalGreen.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockCrystalGreen" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/block/blockCrystalLightBlue.json deleted file mode 100644 index 3fb518176..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalLightBlue.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockCrystalLightBlue" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/block/blockCrystalRed.json deleted file mode 100644 index e4279898b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalRed.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockCrystalRed" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/block/blockCrystalWhite.json deleted file mode 100644 index 041e81265..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockCrystalWhite.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockCrystalWhite" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockDirectionalBreaker.json b/src/main/resources/assets/actuallyadditions/models/block/blockDirectionalBreaker.json deleted file mode 100644 index 6bba02c3a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockDirectionalBreaker.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockDirectionalBreaker", - "down": "actuallyadditions:blocks/blockDirectionalBreakerTop", - "up": "actuallyadditions:blocks/blockDirectionalBreakerTop", - "north": "actuallyadditions:blocks/blockDirectionalBreakerFront", - "east": "actuallyadditions:blocks/blockDirectionalBreaker", - "south": "actuallyadditions:blocks/blockDirectionalBreaker", - "west": "actuallyadditions:blocks/blockDirectionalBreaker" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockDropper.json b/src/main/resources/assets/actuallyadditions/models/block/blockDropper.json deleted file mode 100644 index 7d34fb454..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockDropper.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockDropper", - "down": "actuallyadditions:blocks/blockDropperTop", - "up": "actuallyadditions:blocks/blockDropperTop", - "north": "actuallyadditions:blocks/blockDropperFront", - "east": "actuallyadditions:blocks/blockDropper", - "south": "actuallyadditions:blocks/blockDropper", - "west": "actuallyadditions:blocks/blockDropper" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockEnergizer.json b/src/main/resources/assets/actuallyadditions/models/block/blockEnergizer.json deleted file mode 100644 index 82542d8ee..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockEnergizer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockEnergizer", - "down": "actuallyadditions:blocks/blockEnergizer", - "up": "actuallyadditions:blocks/blockEnergizerTop", - "north": "actuallyadditions:blocks/blockEnergizerSide", - "east": "actuallyadditions:blocks/blockEnergizerSide", - "south": "actuallyadditions:blocks/blockEnergizerSide", - "west": "actuallyadditions:blocks/blockEnergizerSide" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockEnervator.json b/src/main/resources/assets/actuallyadditions/models/block/blockEnervator.json deleted file mode 100644 index 51c2005b9..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockEnervator.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockEnervator", - "down": "actuallyadditions:blocks/blockEnervator", - "up": "actuallyadditions:blocks/blockEnervatorTop", - "north": "actuallyadditions:blocks/blockEnervatorSide", - "east": "actuallyadditions:blocks/blockEnervatorSide", - "south": "actuallyadditions:blocks/blockEnervatorSide", - "west": "actuallyadditions:blocks/blockEnervatorSide" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFeeder.json b/src/main/resources/assets/actuallyadditions/models/block/blockFeeder.json deleted file mode 100644 index 086701edd..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFeeder.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockFeeder", - "down": "actuallyadditions:blocks/blockFeederTop", - "up": "actuallyadditions:blocks/blockFeederTop", - "north": "actuallyadditions:blocks/blockFeeder", - "east": "actuallyadditions:blocks/blockFeeder", - "south": "actuallyadditions:blocks/blockFeeder", - "west": "actuallyadditions:blocks/blockFeeder" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFermentingBarrel.json b/src/main/resources/assets/actuallyadditions/models/block/blockFermentingBarrel.json deleted file mode 100644 index 30cc9d9ac..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFermentingBarrel.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockFermentingBarrel", - "down": "actuallyadditions:blocks/blockFermentingBarrelTop", - "up": "actuallyadditions:blocks/blockFermentingBarrelTop", - "north": "actuallyadditions:blocks/blockFermentingBarrel", - "east": "actuallyadditions:blocks/blockFermentingBarrel", - "south": "actuallyadditions:blocks/blockFermentingBarrel", - "west": "actuallyadditions:blocks/blockFermentingBarrel" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFireworkBox.json b/src/main/resources/assets/actuallyadditions/models/block/blockFireworkBox.json deleted file mode 100644 index 92d6f0d11..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFireworkBox.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockFireworkBox", - "down": "actuallyadditions:blocks/blockFireworkBox", - "up": "actuallyadditions:blocks/blockFireworkBoxTop", - "north": "actuallyadditions:blocks/blockFireworkBox", - "east": "actuallyadditions:blocks/blockFireworkBox", - "south": "actuallyadditions:blocks/blockFireworkBox", - "west": "actuallyadditions:blocks/blockFireworkBox" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage1.json b/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage1.json deleted file mode 100644 index 47d690d32..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockFlaxStage1" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage2.json b/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage2.json deleted file mode 100644 index 6380ad351..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockFlaxStage2" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage3.json b/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage3.json deleted file mode 100644 index fb00402fd..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage3.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockFlaxStage3" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage4.json b/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage4.json deleted file mode 100644 index c51f298c1..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage4.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockFlaxStage4" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage5.json b/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage5.json deleted file mode 100644 index b3f41a5ce..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage5.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockFlaxStage5" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage6.json b/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage6.json deleted file mode 100644 index 92b7294f1..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFlaxStage6.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockFlaxStage6" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFluidCollector.json b/src/main/resources/assets/actuallyadditions/models/block/blockFluidCollector.json deleted file mode 100644 index d5eefafac..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFluidCollector.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockFluidCollector", - "down": "actuallyadditions:blocks/blockFluidCollectorTop", - "up": "actuallyadditions:blocks/blockFluidCollectorTop", - "north": "actuallyadditions:blocks/blockFluidCollectorFront", - "east": "actuallyadditions:blocks/blockFluidCollector", - "south": "actuallyadditions:blocks/blockFluidCollector", - "west": "actuallyadditions:blocks/blockFluidCollector" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFluidPlacer.json b/src/main/resources/assets/actuallyadditions/models/block/blockFluidPlacer.json deleted file mode 100644 index 19a1cd4de..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFluidPlacer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockFluidPlacer", - "down": "actuallyadditions:blocks/blockFluidPlacerTop", - "up": "actuallyadditions:blocks/blockFluidPlacerTop", - "north": "actuallyadditions:blocks/blockFluidPlacerFront", - "east": "actuallyadditions:blocks/blockFluidPlacer", - "south": "actuallyadditions:blocks/blockFluidPlacer", - "west": "actuallyadditions:blocks/blockFluidPlacer" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFurnaceDouble.json b/src/main/resources/assets/actuallyadditions/models/block/blockFurnaceDouble.json deleted file mode 100644 index 596d67036..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFurnaceDouble.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockFurnaceDouble", - "down": "actuallyadditions:blocks/blockFurnaceDouble", - "up": "actuallyadditions:blocks/blockFurnaceDoubleTop", - "north": "actuallyadditions:blocks/blockFurnaceDoubleFront", - "east": "actuallyadditions:blocks/blockFurnaceDouble", - "south": "actuallyadditions:blocks/blockFurnaceDouble", - "west": "actuallyadditions:blocks/blockFurnaceDouble" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockFurnaceDoubleOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockFurnaceDoubleOn.json deleted file mode 100644 index 9ecfaccf4..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockFurnaceDoubleOn.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockFurnaceDouble", - "down": "actuallyadditions:blocks/blockFurnaceDouble", - "up": "actuallyadditions:blocks/blockFurnaceDoubleTop", - "north": "actuallyadditions:blocks/blockFurnaceDoubleOn", - "east": "actuallyadditions:blocks/blockFurnaceDouble", - "south": "actuallyadditions:blocks/blockFurnaceDouble", - "west": "actuallyadditions:blocks/blockFurnaceDouble" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockGiantChest.json b/src/main/resources/assets/actuallyadditions/models/block/blockGiantChest.json deleted file mode 100644 index 9a2f67dd7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockGiantChest.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockGiantChest", - "down": "actuallyadditions:blocks/blockGiantChestBottom", - "up": "actuallyadditions:blocks/blockGiantChestTop", - "north": "actuallyadditions:blocks/blockGiantChest", - "east": "actuallyadditions:blocks/blockGiantChest", - "south": "actuallyadditions:blocks/blockGiantChest", - "west": "actuallyadditions:blocks/blockGiantChest" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockGreenhouseGlass.json b/src/main/resources/assets/actuallyadditions/models/block/blockGreenhouseGlass.json deleted file mode 100644 index d5e181ffe..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockGreenhouseGlass.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockGreenhouseGlass" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockGrinder.json b/src/main/resources/assets/actuallyadditions/models/block/blockGrinder.json deleted file mode 100644 index c6cf965b5..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockGrinder.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockGrinder", - "down": "actuallyadditions:blocks/blockGrinderBottom", - "up": "actuallyadditions:blocks/blockGrinderTop", - "north": "actuallyadditions:blocks/blockGrinder", - "east": "actuallyadditions:blocks/blockGrinder", - "south": "actuallyadditions:blocks/blockGrinder", - "west": "actuallyadditions:blocks/blockGrinder" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockGrinderDouble.json b/src/main/resources/assets/actuallyadditions/models/block/blockGrinderDouble.json deleted file mode 100644 index 7c956d566..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockGrinderDouble.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockGrinderDouble", - "down": "actuallyadditions:blocks/blockGrinderBottom", - "up": "actuallyadditions:blocks/blockGrinderTop", - "north": "actuallyadditions:blocks/blockGrinderDouble", - "east": "actuallyadditions:blocks/blockGrinderDouble", - "south": "actuallyadditions:blocks/blockGrinderDouble", - "west": "actuallyadditions:blocks/blockGrinderDouble" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockGrinderDoubleOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockGrinderDoubleOn.json deleted file mode 100644 index 29a9657d3..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockGrinderDoubleOn.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockGrinderDouble", - "down": "actuallyadditions:blocks/blockGrinderBottom", - "up": "actuallyadditions:blocks/blockGrinderOn", - "north": "actuallyadditions:blocks/blockGrinderDouble", - "east": "actuallyadditions:blocks/blockGrinderDouble", - "south": "actuallyadditions:blocks/blockGrinderDouble", - "west": "actuallyadditions:blocks/blockGrinderDouble" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockGrinderOn.json b/src/main/resources/assets/actuallyadditions/models/block/blockGrinderOn.json deleted file mode 100644 index 32ace4441..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockGrinderOn.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockGrinder", - "down": "actuallyadditions:blocks/blockGrinderBottom", - "up": "actuallyadditions:blocks/blockGrinderOn", - "north": "actuallyadditions:blocks/blockGrinder", - "east": "actuallyadditions:blocks/blockGrinder", - "south": "actuallyadditions:blocks/blockGrinder", - "west": "actuallyadditions:blocks/blockGrinder" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockHeatCollector.json b/src/main/resources/assets/actuallyadditions/models/block/blockHeatCollector.json deleted file mode 100644 index 694df70ec..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockHeatCollector.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockHeatCollectorSide", - "down": "actuallyadditions:blocks/blockHeatCollectorBottom", - "up": "actuallyadditions:blocks/blockHeatCollectorTop", - "north": "actuallyadditions:blocks/blockHeatCollectorSide", - "east": "actuallyadditions:blocks/blockHeatCollectorSide", - "south": "actuallyadditions:blocks/blockHeatCollectorSide", - "west": "actuallyadditions:blocks/blockHeatCollectorSide" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockInputter.json b/src/main/resources/assets/actuallyadditions/models/block/blockInputter.json deleted file mode 100644 index 7bc5b2f9a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockInputter.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockInputter" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockInputterAdvanced.json b/src/main/resources/assets/actuallyadditions/models/block/blockInputterAdvanced.json deleted file mode 100644 index 20dc95824..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockInputterAdvanced.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockInputterAdvanced" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockItemRepairer.json b/src/main/resources/assets/actuallyadditions/models/block/blockItemRepairer.json deleted file mode 100644 index bb1be012a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockItemRepairer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockItemRepairer", - "down": "actuallyadditions:blocks/blockItemRepairerBottom", - "up": "actuallyadditions:blocks/blockItemRepairerTop", - "north": "actuallyadditions:blocks/blockItemRepairer", - "east": "actuallyadditions:blocks/blockItemRepairer", - "south": "actuallyadditions:blocks/blockItemRepairer", - "west": "actuallyadditions:blocks/blockItemRepairer" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockLampPowerer.json b/src/main/resources/assets/actuallyadditions/models/block/blockLampPowerer.json deleted file mode 100644 index 430ed6006..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockLampPowerer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockLampPowerer", - "down": "actuallyadditions:blocks/blockLampPowerer", - "up": "actuallyadditions:blocks/blockLampPowerer", - "north": "actuallyadditions:blocks/blockLampPowererFront", - "east": "actuallyadditions:blocks/blockLampPowerer", - "south": "actuallyadditions:blocks/blockLampPowerer", - "west": "actuallyadditions:blocks/blockLampPowerer" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItem.json b/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItem.json new file mode 100644 index 000000000..0a39a5a03 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItem.json @@ -0,0 +1,880 @@ +{ + "__createdBy": "canitzp", + "ambientocclusion": false, + "textures": { + "particle": "actuallyadditions:blocks/models/modelLaserRelayItem", + "laserRelay": "actuallyadditions:blocks/models/modelLaserRelayItem" + }, + "elements": [ + { + "from": [4,0,4], + "to": [12,1,12], + "faces": { + "up": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,1,3], + "to": [12,4,4], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,1,12], + "to": [12,4,13], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,11,12], + "to": [12,14,13], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,11,3], + "to": [12,14,4], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,4,2], + "to": [12,5,3], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,10,2], + "to": [12,11,3], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,10,13], + "to": [12,11,14], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,4,13], + "to": [12,5,14], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [5.5,1,5.5], + "to": [10.5,3,10.5], + "faces": { + "up": { + "uv": [13.5,13.5,16,16], + "texture": "#laserRelay" + }, + "down": { + "uv": [0.0,0.0,5.0,5.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + } + } + }, + { + "from": [7,3,7], + "to": [9,14,9], + "faces": { + "up": { + "uv": [0.0,0.0,2.0,2.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,2.0,2.0], + "texture": "missingtexture" + }, + "west": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "east": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "north": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "south": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,14,4], + "to": [12,15,12], + "faces": { + "up": { + "uv": [1,12,5,15], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [6.5,6.5,6.5], + "to": [9.5,9.5,9.5], + "faces": { + "up": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "down": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "west": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "east": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "north": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "south": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,5,2], + "to": [5,10,3], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [11,5,2], + "to": [12,10,3], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [11,5,13], + "to": [12,10,14], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,5,13], + "to": [5,10,14], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [3,1,4], + "to": [4,4,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [12,1,4], + "to": [13,4,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [12,11,4], + "to": [13,14,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [3,11,4], + "to": [4,14,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,4,4], + "to": [3,5,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,10,4], + "to": [3,11,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,10,4], + "to": [14,11,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,4,4], + "to": [14,5,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,5,4], + "to": [3,10,5], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,5,11], + "to": [3,10,12], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,5,11], + "to": [14,10,12], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,5,4], + "to": [14,10,5], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItemWhitelist.json b/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItemWhitelist.json new file mode 100644 index 000000000..a2934f48b --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItemWhitelist.json @@ -0,0 +1,880 @@ +{ + "__createdBy": "canitzp", + "ambientocclusion": false, + "textures": { + "particle": "actuallyadditions:blocks/models/modelLaserRelayItemWhitelist", + "laserRelay": "actuallyadditions:blocks/models/modelLaserRelayItemWhitelist" + }, + "elements": [ + { + "from": [4,0,4], + "to": [12,1,12], + "faces": { + "up": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,1,3], + "to": [12,4,4], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,1,12], + "to": [12,4,13], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,11,12], + "to": [12,14,13], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,11,3], + "to": [12,14,4], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,4,2], + "to": [12,5,3], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,10,2], + "to": [12,11,3], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,10,13], + "to": [12,11,14], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,4,13], + "to": [12,5,14], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [5.5,1,5.5], + "to": [10.5,3,10.5], + "faces": { + "up": { + "uv": [13.5,13.5,16,16], + "texture": "#laserRelay" + }, + "down": { + "uv": [0.0,0.0,5.0,5.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + } + } + }, + { + "from": [7,3,7], + "to": [9,14,9], + "faces": { + "up": { + "uv": [0.0,0.0,2.0,2.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,2.0,2.0], + "texture": "missingtexture" + }, + "west": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "east": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "north": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "south": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,14,4], + "to": [12,15,12], + "faces": { + "up": { + "uv": [1,12,5,15], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [6.5,6.5,6.5], + "to": [9.5,9.5,9.5], + "faces": { + "up": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "down": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "west": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "east": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "north": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "south": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,5,2], + "to": [5,10,3], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [11,5,2], + "to": [12,10,3], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [11,5,13], + "to": [12,10,14], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,5,13], + "to": [5,10,14], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [3,1,4], + "to": [4,4,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [12,1,4], + "to": [13,4,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [12,11,4], + "to": [13,14,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [3,11,4], + "to": [4,14,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,4,4], + "to": [3,5,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,10,4], + "to": [3,11,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,10,4], + "to": [14,11,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,4,4], + "to": [14,5,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,5,4], + "to": [3,10,5], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,5,11], + "to": [3,10,12], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,5,11], + "to": [14,10,12], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,5,4], + "to": [14,10,5], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockLavaFactoryController.json b/src/main/resources/assets/actuallyadditions/models/block/blockLavaFactoryController.json deleted file mode 100644 index 9097991cb..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockLavaFactoryController.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockLavaFactoryController", - "down": "actuallyadditions:blocks/blockLavaFactoryController", - "up": "actuallyadditions:blocks/blockLavaFactoryControllerTop", - "north": "actuallyadditions:blocks/blockLavaFactoryController", - "east": "actuallyadditions:blocks/blockLavaFactoryController", - "south": "actuallyadditions:blocks/blockLavaFactoryController", - "west": "actuallyadditions:blocks/blockLavaFactoryController" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockLeafGenerator.json b/src/main/resources/assets/actuallyadditions/models/block/blockLeafGenerator.json deleted file mode 100644 index 56ed86737..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockLeafGenerator.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockLeafGenerator", - "down": "actuallyadditions:blocks/blockLeafGeneratorBottom", - "up": "actuallyadditions:blocks/blockLeafGeneratorTop", - "north": "actuallyadditions:blocks/blockLeafGenerator", - "east": "actuallyadditions:blocks/blockLeafGenerator", - "south": "actuallyadditions:blocks/blockLeafGenerator", - "west": "actuallyadditions:blocks/blockLeafGenerator" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiner.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiner.json deleted file mode 100644 index 2872bf56a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiner.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockMiner", - "down": "actuallyadditions:blocks/blockMinerFront", - "up": "actuallyadditions:blocks/blockMinerTop", - "north": "actuallyadditions:blocks/blockMiner", - "east": "actuallyadditions:blocks/blockMiner", - "south": "actuallyadditions:blocks/blockMiner", - "west": "actuallyadditions:blocks/blockMiner" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartz.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartz.json deleted file mode 100644 index 9f80a8b37..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartz.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartzChiseled.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartzChiseled.json deleted file mode 100644 index 239abd6a4..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartzChiseled.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscBlackQuartzChiseled" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartzPillar.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartzPillar.json deleted file mode 100644 index a393fdfd1..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscBlackQuartzPillar.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscCharcoal.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscCharcoal.json deleted file mode 100644 index e7b2c34bc..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscCharcoal.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscCharcoal" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscEnderCasing.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscEnderCasing.json deleted file mode 100644 index 2b00aaaaf..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscEnderCasing.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscEnderCasing" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscEnderpearl.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscEnderpearl.json deleted file mode 100644 index ecf04eb87..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscEnderpearl.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscEnderpearl" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscIronCasing.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscIronCasing.json deleted file mode 100644 index fbc4d7b2f..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscIronCasing.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscIronCasing" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscLavaFactoryCase.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscLavaFactoryCase.json deleted file mode 100644 index a1db96568..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscLavaFactoryCase.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscLavaFactoryCase" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscOreBlackQuartz.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscOreBlackQuartz.json deleted file mode 100644 index a622e44fa..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscOreBlackQuartz.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscOreBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockMiscWoodCasing.json b/src/main/resources/assets/actuallyadditions/models/block/blockMiscWoodCasing.json deleted file mode 100644 index 176cf159b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockMiscWoodCasing.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockMiscWoodCasing" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockOilGenerator.json b/src/main/resources/assets/actuallyadditions/models/block/blockOilGenerator.json deleted file mode 100644 index 46923c44c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockOilGenerator.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockOilGenerator", - "down": "actuallyadditions:blocks/blockOilGeneratorBottom", - "up": "actuallyadditions:blocks/blockOilGeneratorTop", - "north": "actuallyadditions:blocks/blockOilGenerator", - "east": "actuallyadditions:blocks/blockOilGenerator", - "south": "actuallyadditions:blocks/blockOilGenerator", - "west": "actuallyadditions:blocks/blockOilGenerator" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomBreaker.json b/src/main/resources/assets/actuallyadditions/models/block/blockPhantomBreaker.json deleted file mode 100644 index 2f6b1a6b6..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomBreaker.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockPhantomBreaker" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomEnergyface.json b/src/main/resources/assets/actuallyadditions/models/block/blockPhantomEnergyface.json deleted file mode 100644 index 28f93699d..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomEnergyface.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockPhantomEnergyface" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomLiquiface.json b/src/main/resources/assets/actuallyadditions/models/block/blockPhantomLiquiface.json deleted file mode 100644 index 94c4530e4..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomLiquiface.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockPhantomLiquiface" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomPlacer.json b/src/main/resources/assets/actuallyadditions/models/block/blockPhantomPlacer.json deleted file mode 100644 index 35eab12dd..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomPlacer.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockPhantomPlacer" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomface.json b/src/main/resources/assets/actuallyadditions/models/block/blockPhantomface.json deleted file mode 100644 index 71b522ba9..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPhantomface.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockPhantomface" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzSlabBottom.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzSlabBottom.json deleted file mode 100644 index 415d0574b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzSlabBottom.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/half_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzSlabTop.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzSlabTop.json deleted file mode 100644 index d52c000ef..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzSlabTop.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/upper_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairs.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairs.json deleted file mode 100644 index 07163fad5..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairsInner.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairsInner.json deleted file mode 100644 index 6a1759043..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairsInner.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/inner_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairsOuter.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairsOuter.json deleted file mode 100644 index 90bbad865..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzStairsOuter.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/outer_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "top": "actuallyadditions:blocks/blockMiscBlackQuartzPillar", - "side": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallInventory.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallInventory.json index 8e69ec192..9968403f8 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallInventory.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallInventory.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_inventory", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorth.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorth.json deleted file mode 100644 index 742554c85..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_n", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthEast.json deleted file mode 100644 index db512c7d9..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ne", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouth.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouth.json deleted file mode 100644 index f17ac45b7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthAbove.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthAbove.json deleted file mode 100644 index a2ea2f739..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthAbove.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns_above", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthEast.json deleted file mode 100644 index e10c5ad81..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nse", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthEastWest.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthEastWest.json deleted file mode 100644 index 56dc3196a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallNorthSouthEastWest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nsew", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallPost.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallPost.json index 05317206d..a82929d56 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallPost.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallPost.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_post", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" - } -} + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallSide.json b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallSide.json new file mode 100644 index 000000000..b9d06b9c6 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockPillarQuartzWallSide.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartzPillar" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockPlacer.json b/src/main/resources/assets/actuallyadditions/models/block/blockPlacer.json deleted file mode 100644 index 882cdec95..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockPlacer.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockPlacer", - "down": "actuallyadditions:blocks/blockPlacerTop", - "up": "actuallyadditions:blocks/blockPlacerTop", - "north": "actuallyadditions:blocks/blockPlacerFront", - "east": "actuallyadditions:blocks/blockPlacer", - "south": "actuallyadditions:blocks/blockPlacer", - "west": "actuallyadditions:blocks/blockPlacer" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzSlabBottom.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzSlabBottom.json deleted file mode 100644 index 717a87efa..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzSlabBottom.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/half_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartz", - "top": "actuallyadditions:blocks/blockMiscBlackQuartz", - "side": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzSlabTop.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzSlabTop.json deleted file mode 100644 index 430db9102..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzSlabTop.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/upper_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartz", - "top": "actuallyadditions:blocks/blockMiscBlackQuartz", - "side": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairs.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairs.json deleted file mode 100644 index c081a302e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartz", - "top": "actuallyadditions:blocks/blockMiscBlackQuartz", - "side": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairsInner.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairsInner.json deleted file mode 100644 index 3c8e7df37..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairsInner.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/inner_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartz", - "top": "actuallyadditions:blocks/blockMiscBlackQuartz", - "side": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairsOuter.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairsOuter.json deleted file mode 100644 index 72e09ad90..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzStairsOuter.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/outer_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockMiscBlackQuartz", - "top": "actuallyadditions:blocks/blockMiscBlackQuartz", - "side": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallInventory.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallInventory.json index e4aaa41bb..c51b0152a 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallInventory.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallInventory.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_inventory", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorth.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorth.json deleted file mode 100644 index b83186dd7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_n", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthEast.json deleted file mode 100644 index 3ac0fbd99..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ne", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouth.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouth.json deleted file mode 100644 index 5dbd6b513..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthAbove.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthAbove.json deleted file mode 100644 index 000276842..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthAbove.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns_above", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthEast.json deleted file mode 100644 index 1d5a986ab..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nse", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthEastWest.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthEastWest.json deleted file mode 100644 index 557e78d48..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallNorthSouthEastWest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nsew", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallPost.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallPost.json index a531634ea..9eab47d78 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallPost.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallPost.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_post", - "textures": { - "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" - } -} + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallSide.json b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallSide.json new file mode 100644 index 000000000..b30814a7e --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockQuartzWallSide.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "actuallyadditions:blocks/blockMiscBlackQuartz" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockRangedCollector.json b/src/main/resources/assets/actuallyadditions/models/block/blockRangedCollector.json deleted file mode 100644 index e3d4dfa63..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockRangedCollector.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockRangedCollector" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage1.json b/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage1.json deleted file mode 100644 index 8e49402c6..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockRiceStage1" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage2.json b/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage2.json deleted file mode 100644 index 505ad42ef..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockRiceStage2" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage3.json b/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage3.json deleted file mode 100644 index e3d655adb..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage3.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockRiceStage3" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage4.json b/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage4.json deleted file mode 100644 index b18a4e8c1..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage4.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockRiceStage4" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage5.json b/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage5.json deleted file mode 100644 index 85f9d0c35..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage5.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockRiceStage5" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage6.json b/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage6.json deleted file mode 100644 index b9bc34d0a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockRiceStage6.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cross", - "textures": { - "cross": "actuallyadditions:blocks/blockRiceStage6" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockSmileyCloudFluffy.json b/src/main/resources/assets/actuallyadditions/models/block/blockSmileyCloudFluffy.json new file mode 100644 index 000000000..b665bf730 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockSmileyCloudFluffy.json @@ -0,0 +1,411 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "actuallyadditions:blocks/models/modelPinkFluffyUnicloud", + "smileycloud": "actuallyadditions:blocks/models/modelPinkFluffyUnicloud" + }, + "elements": [ + { + "from": [2,0,3], + "to": [14,10,13], + "faces": { + "up": { + "uv": [5,0.75,8,3.25], + "texture": "#smileycloud" + }, + "down": { + "uv": [3.5,1.5,6.5,4], + "texture": "#smileycloud" + }, + "west": { + "uv": [0,2.5,2.5,5], + "texture": "#smileycloud" + }, + "east": { + "uv": [8.5,2.5,11,5], + "texture": "#smileycloud" + }, + "north": { + "uv": [2.75,0.25,5.75,2.75], + "texture": "#smileycloud" + }, + "south": { + "uv": [5.25,0.25,8.25,2.75], + "texture": "#smileycloud" + } + } + }, + { + "from": [1,1,4], + "to": [15,9,12], + "faces": { + "up": { + "uv": [6.5,2,7,4], + "texture": "#smileycloud" + }, + "down": { + "uv": [1.25,2.75,1.75,4.75], + "texture": "#smileycloud" + }, + "west": { + "uv": [13.75,2,15.75,4], + "texture": "#smileycloud" + }, + "east": { + "uv": [11.25,2,13.25,4], + "texture": "#smileycloud" + }, + "north": { + "uv": [13.75,2.75,14.25,4.75], + "texture": "#smileycloud" + }, + "south": { + "uv": [6.25,1.5,6.75,3.5], + "texture": "#smileycloud" + } + } + }, + { + "from": [0,2,5], + "to": [16,8,11], + "faces": { + "up": { + "uv": [12.75,2.25,13.25,3.75], + "texture": "#smileycloud" + }, + "down": { + "uv": [13.5,2.5,14,4], + "texture": "#smileycloud" + }, + "west": { + "uv": [13.25,4.25,14.75,5.75], + "texture": "#smileycloud" + }, + "east": { + "uv": [11.5,4,13,5.5], + "texture": "#smileycloud" + }, + "north": { + "uv": [13.75,3,14.25,4.5], + "texture": "#smileycloud" + }, + "south": { + "uv": [6.25,1.75,6.75,3.25], + "texture": "#smileycloud" + } + } + }, + { + "from": [3,9,4], + "to": [13,11,12], + "faces": { + "up": { + "uv": [0.25,2.75,2.75,4.75], + "texture": "#smileycloud" + }, + "west": { + "uv": [4,3,6,3.5], + "texture": "#smileycloud" + }, + "east": { + "uv": [0.75,10,2.75,10.5], + "texture": "#smileycloud" + }, + "north": { + "uv": [8.75,7.5,11.25,8], + "texture": "#smileycloud" + }, + "south": { + "uv": [7,5.75,9.5,6.25], + "texture": "#smileycloud" + } + } + }, + { + "from": [4,10,5], + "to": [12,12,11], + "faces": { + "up": { + "uv": [8.75,7,10.75,8.5], + "texture": "#smileycloud" + }, + "west": { + "uv": [8,5.5,9.5,6], + "texture": "#smileycloud" + }, + "east": { + "uv": [7,5.5,8.5,6], + "texture": "#smileycloud" + }, + "north": { + "uv": [12,5,14.25,5.5], + "texture": "#smileycloud" + }, + "south": { + "uv": [3,3.25,5,3.75], + "texture": "#smileycloud" + } + } + }, + { + "from": [3,1,12], + "to": [13,9,14], + "faces": { + "up": { + "uv": [11.75,3.75,14.25,4.25], + "texture": "#smileycloud" + }, + "down": { + "uv": [7.75,3.25,10.25,3.75], + "texture": "#smileycloud" + }, + "west": { + "uv": [13.25,2.5,13.75,4.5], + "texture": "#smileycloud" + }, + "east": { + "uv": [6.75,2,7.25,4], + "texture": "#smileycloud" + }, + "south": { + "uv": [3.75,1,6.25,3], + "texture": "#smileycloud" + } + } + }, + { + "from": [4,2,13], + "to": [12,8,15], + "faces": { + "up": { + "uv": [2,6.25,4,6.75], + "texture": "#smileycloud" + }, + "down": { + "uv": [9.5,7.75,11.5,8.25], + "texture": "#smileycloud" + }, + "west": { + "uv": [14.75,2.25,15.25,3.75], + "texture": "#smileycloud" + }, + "east": { + "uv": [13.25,2.5,13.75,4], + "texture": "#smileycloud" + }, + "south": { + "uv": [3,5.5,5,7], + "texture": "#smileycloud" + } + } + }, + { + "from": [5,3,14], + "to": [11,7,16], + "faces": { + "up": { + "uv": [7.25,5.5,8.75,6], + "texture": "#smileycloud" + }, + "down": { + "uv": [12.75,3,14.25,3.5], + "texture": "#smileycloud" + }, + "west": { + "uv": [8.25,7.25,8.75,8.25], + "texture": "#smileycloud" + }, + "east": { + "uv": [10.75,7,11.25,8], + "texture": "#smileycloud" + }, + "south": { + "uv": [12.5,2.75,14,3.75], + "texture": "#smileycloud" + } + } + }, + { + "from": [5,3,2.5], + "to": [11,4,4.5], + "faces": { + "up": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "down": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "west": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "east": { + "uv": [4.5,10.25,4.75,10.5], + "texture": "#smileycloud" + }, + "north": { + "uv": [4.25,10.25,4.75,10.5], + "texture": "#smileycloud" + } + } + }, + { + "from": [11,4,2.5], + "to": [12,5,4.5], + "faces": { + "up": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "down": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "west": { + "uv": [4.5,10.25,4.75,10.5], + "texture": "#smileycloud" + }, + "east": { + "uv": [4.5,10.25,4.75,10.5], + "texture": "#smileycloud" + }, + "north": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + } + } + }, + { + "from": [4,4,2.5], + "to": [5,5,4.5], + "faces": { + "up": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "down": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "west": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "east": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "north": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + } + } + }, + { + "from": [9,7,2.75], + "to": [11,9,3.75], + "faces": { + "up": { + "uv": [7.75,9.25,8.25,9.5], + "texture": "#smileycloud" + }, + "down": { + "uv": [7.75,9.5,8.25,9.75], + "texture": "#smileycloud" + }, + "west": { + "uv": [7.75,9.25,8,9.75], + "texture": "#smileycloud" + }, + "east": { + "uv": [7.75,9.25,8,9.75], + "texture": "#smileycloud" + }, + "north": { + "uv": [7.75,9.25,8.25,9.75], + "texture": "#smileycloud" + } + } + }, + { + "from": [5,7,2.75], + "to": [7,9,3.75], + "faces": { + "up": { + "uv": [7.75,9.5,8.25,9.75], + "texture": "#smileycloud" + }, + "down": { + "uv": [7.75,9.5,8.25,9.75], + "texture": "#smileycloud" + }, + "west": { + "uv": [8,9.25,8.25,9.75], + "texture": "#smileycloud" + }, + "east": { + "uv": [7.75,9.25,8,9.75], + "texture": "#smileycloud" + }, + "north": { + "uv": [7.75,9.25,8.25,9.75], + "texture": "#smileycloud" + } + } + }, + { + "from": [9.5,7.5,2.5], + "to": [10.5,8.5,3.5], + "faces": { + "up": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "down": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "west": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "east": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "north": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + } + } + }, + { + "from": [5.5,7.5,2.5], + "to": [6.5,8.5,3.5], + "faces": { + "up": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "down": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "west": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "east": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + }, + "north": { + "uv": [4.25,10.25,4.5,10.5], + "texture": "#smileycloud" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceInventory.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceInventory.json index 824957db3..5024ce629 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceInventory.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceInventory.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_inventory", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorth.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorth.json deleted file mode 100644 index 8b4fb26d0..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_n", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthEast.json deleted file mode 100644 index e4997d19c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ne", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouth.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouth.json deleted file mode 100644 index a55a8ca94..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthAbove.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthAbove.json deleted file mode 100644 index 3e7fd28e2..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthAbove.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns_above", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthEast.json deleted file mode 100644 index 5be16b169..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nse", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthEastWest.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthEastWest.json deleted file mode 100644 index ea710119d..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceNorthSouthEastWest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nsew", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFencePost.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFencePost.json index 4932d58c6..5470b62d1 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFencePost.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFencePost.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_post", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceSide.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceSide.json new file mode 100644 index 000000000..976609a77 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenFenceSide.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "actuallyadditions:blocks/blockTestifiBucksGreenWall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenSlabBottom.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenSlabBottom.json deleted file mode 100644 index d25414b47..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenSlabBottom.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/half_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "top": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "side": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenSlabTop.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenSlabTop.json deleted file mode 100644 index 4d4bf4417..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenSlabTop.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/upper_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "top": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "side": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairs.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairs.json deleted file mode 100644 index f06aa8039..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "top": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "side": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairsInner.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairsInner.json deleted file mode 100644 index 34b5b94e7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairsInner.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/inner_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "top": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "side": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairsOuter.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairsOuter.json deleted file mode 100644 index 96ce69aa6..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenStairsOuter.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/outer_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "top": "actuallyadditions:blocks/blockTestifiBucksGreenWall", - "side": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenWall.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenWall.json deleted file mode 100644 index 0d7d410ff..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksGreenWall.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockTestifiBucksGreenWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceInventory.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceInventory.json index 0a5bfad64..d6e873ba2 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceInventory.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceInventory.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_inventory", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorth.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorth.json deleted file mode 100644 index 49f70eb52..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_n", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthEast.json deleted file mode 100644 index d5762b020..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ne", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouth.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouth.json deleted file mode 100644 index 9679dae9d..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouth.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthAbove.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthAbove.json deleted file mode 100644 index bf166b510..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthAbove.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_ns_above", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthEast.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthEast.json deleted file mode 100644 index 96659843c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthEast.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nse", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthEastWest.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthEastWest.json deleted file mode 100644 index 1223badcf..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceNorthSouthEastWest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/wall_nsew", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFencePost.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFencePost.json index 18244230d..7f819af28 100644 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFencePost.json +++ b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFencePost.json @@ -1,6 +1,6 @@ { - "parent": "block/wall_post", - "textures": { - "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} + "parent": "minecraft:block/wall_post", + "textures": { + "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceSide.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceSide.json new file mode 100644 index 000000000..453cebf2e --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteFenceSide.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_side", + "textures": { + "wall": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteSlabBottom.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteSlabBottom.json deleted file mode 100644 index b25b04fd4..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteSlabBottom.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/half_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "top": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "side": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteSlabTop.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteSlabTop.json deleted file mode 100644 index 941ae9448..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteSlabTop.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/upper_slab", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "top": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "side": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairs.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairs.json deleted file mode 100644 index cda06026f..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "top": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "side": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairsInner.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairsInner.json deleted file mode 100644 index ebd3ee1df..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairsInner.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/inner_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "top": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "side": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairsOuter.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairsOuter.json deleted file mode 100644 index e3d36bcdf..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteStairsOuter.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "parent": "block/outer_stairs", - "textures": { - "bottom": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "top": "actuallyadditions:blocks/blockTestifiBucksWhiteWall", - "side": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteWall.json b/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteWall.json deleted file mode 100644 index 1875b9000..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTestifiBucksWhiteWall.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "block/cube_all", - "textures": { - "all": "actuallyadditions:blocks/blockTestifiBucksWhiteWall" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockTreasureChest.json b/src/main/resources/assets/actuallyadditions/models/block/blockTreasureChest.json deleted file mode 100644 index 98bc9b1d1..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockTreasureChest.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockTreasureChest", - "down": "actuallyadditions:blocks/blockTreasureChestBottom", - "up": "actuallyadditions:blocks/blockTreasureChestBottom", - "north": "actuallyadditions:blocks/blockTreasureChestFront", - "east": "actuallyadditions:blocks/blockTreasureChest", - "south": "actuallyadditions:blocks/blockTreasureChest", - "west": "actuallyadditions:blocks/blockTreasureChest" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockXPSolidifier.json b/src/main/resources/assets/actuallyadditions/models/block/blockXPSolidifier.json deleted file mode 100644 index e4b14ae63..000000000 --- a/src/main/resources/assets/actuallyadditions/models/block/blockXPSolidifier.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parent": "block/cube", - "textures": { - "particle": "actuallyadditions:blocks/blockXPSolidifier", - "down": "actuallyadditions:blocks/blockXPSolidifierTop", - "up": "actuallyadditions:blocks/blockXPSolidifierTop", - "north": "actuallyadditions:blocks/blockXPSolidifierFront", - "east": "actuallyadditions:blocks/blockXPSolidifier", - "south": "actuallyadditions:blocks/blockXPSolidifier", - "west": "actuallyadditions:blocks/blockXPSolidifier" - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockAtomicReconstructor.json b/src/main/resources/assets/actuallyadditions/models/item/blockAtomicReconstructor.json deleted file mode 100644 index e545878e7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockAtomicReconstructor.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockAtomicReconstructor", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockBlackLotus.json b/src/main/resources/assets/actuallyadditions/models/item/blockBlackLotus.json deleted file mode 100644 index 448efa27a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockBlackLotus.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockBlackLotus" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockBreaker.json b/src/main/resources/assets/actuallyadditions/models/item/blockBreaker.json deleted file mode 100644 index 1062c675d..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockBreaker.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockBreaker", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCanola.json b/src/main/resources/assets/actuallyadditions/models/item/blockCanola.json deleted file mode 100644 index b04563dbe..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCanola.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockCanolaStage1" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCanolaPress.json b/src/main/resources/assets/actuallyadditions/models/item/blockCanolaPress.json deleted file mode 100644 index 938a9c7fe..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCanolaPress.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCanolaPress", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzSlab.json b/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzSlab.json deleted file mode 100644 index 7170d3c54..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzSlab.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockChiseledQuartzSlabBottom", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzStair.json b/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzStair.json deleted file mode 100644 index 062500635..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzStair.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockChiseledQuartzStairs", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 180, 0 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzWall.json b/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzWall.json index 4436078c7..3b8270803 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzWall.json +++ b/src/main/resources/assets/actuallyadditions/models/item/blockChiseledQuartzWall.json @@ -1,10 +1,3 @@ { - "parent": "actuallyadditions:block/blockChiseledQuartzWallInventory", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} + "parent": "actuallyadditions:block/blockChiseledQuartzWallInventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCoalGenerator.json b/src/main/resources/assets/actuallyadditions/models/item/blockCoalGenerator.json deleted file mode 100644 index aa2c5b92b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCoalGenerator.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCoalGenerator", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCoffee.json b/src/main/resources/assets/actuallyadditions/models/item/blockCoffee.json deleted file mode 100644 index 37a181523..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCoffee.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockCoffeeStage1" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCoffeeMachine.json b/src/main/resources/assets/actuallyadditions/models/item/blockCoffeeMachine.json deleted file mode 100644 index 7afa59601..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCoffeeMachine.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCoffeeMachine", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBlack.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBlack.json deleted file mode 100644 index 5be359866..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBlack.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampBlack", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBlue.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBlue.json deleted file mode 100644 index 958223edf..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBlue.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampBlue", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBrown.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBrown.json deleted file mode 100644 index 9d37f0f76..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampBrown.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampBrown", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampCyan.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampCyan.json deleted file mode 100644 index d373eedf1..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampCyan.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampCyan", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampGray.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampGray.json deleted file mode 100644 index 5eba54608..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampGray.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampGray", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampGreen.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampGreen.json deleted file mode 100644 index 076706160..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampGreen.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampGreen", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLightBlue.json deleted file mode 100644 index f42814555..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLightBlue.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampLightBlue", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLightGray.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLightGray.json deleted file mode 100644 index 993687c00..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLightGray.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampLightGray", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLime.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLime.json deleted file mode 100644 index 8ef419c6a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampLime.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampLime", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampMagenta.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampMagenta.json deleted file mode 100644 index 3eda300af..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampMagenta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampMagenta", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBlack.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBlack.json deleted file mode 100644 index 6a7c7f02a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBlack.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampBlackOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBlue.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBlue.json deleted file mode 100644 index 5b0982dec..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBlue.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampBlueOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBrown.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBrown.json deleted file mode 100644 index f2dedc045..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnBrown.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampBrownOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnCyan.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnCyan.json deleted file mode 100644 index 69b37a498..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnCyan.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampCyanOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnGray.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnGray.json deleted file mode 100644 index 61bd6f1ec..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnGray.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampGrayOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnGreen.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnGreen.json deleted file mode 100644 index f9c60d055..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnGreen.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampGreenOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLightBlue.json deleted file mode 100644 index d59eba11b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLightBlue.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampLightBlueOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLightGray.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLightGray.json deleted file mode 100644 index bd587fe0a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLightGray.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampLightGrayOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLime.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLime.json deleted file mode 100644 index 1d834b89c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnLime.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampLimeOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnMagenta.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnMagenta.json deleted file mode 100644 index 5516a153e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnMagenta.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampMagentaOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnOrange.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnOrange.json deleted file mode 100644 index 6b2e9eff8..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnOrange.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampOrangeOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnPink.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnPink.json deleted file mode 100644 index 560285709..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnPink.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampPinkOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnPurple.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnPurple.json deleted file mode 100644 index 6d2245850..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnPurple.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampPurpleOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnRed.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnRed.json deleted file mode 100644 index ac2177757..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnRed.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampRedOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnWhite.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnWhite.json deleted file mode 100644 index 70f0afd56..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnWhite.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampWhiteOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnYellow.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnYellow.json deleted file mode 100644 index a09562909..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOnYellow.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampYellowOn", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOrange.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOrange.json deleted file mode 100644 index ae7be2a4b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampOrange.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampOrange", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampPink.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampPink.json deleted file mode 100644 index 59f04fa4b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampPink.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampPink", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampPurple.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampPurple.json deleted file mode 100644 index ac0e31648..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampPurple.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampPurple", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampRed.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampRed.json deleted file mode 100644 index 6970acda8..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampRed.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampRed", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampWhite.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampWhite.json deleted file mode 100644 index 4467915d8..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampWhite.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampWhite", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampYellow.json b/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampYellow.json deleted file mode 100644 index ed7c96c03..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockColoredLampYellow.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockColoredLampYellow", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCompost.json b/src/main/resources/assets/actuallyadditions/models/item/blockCompost.json deleted file mode 100644 index 48378bad5..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCompost.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCompost", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/blockCrystalBlack.json deleted file mode 100644 index 202cadb3c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalBlack.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCrystalBlack", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/blockCrystalBlue.json deleted file mode 100644 index 31adfb56e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalBlue.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCrystalBlue", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/blockCrystalGreen.json deleted file mode 100644 index 6237d6dad..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalGreen.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCrystalGreen", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/blockCrystalLightBlue.json deleted file mode 100644 index 278da0baa..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalLightBlue.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCrystalLightBlue", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/blockCrystalRed.json deleted file mode 100644 index a035b7348..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalRed.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCrystalRed", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/blockCrystalWhite.json deleted file mode 100644 index 2b04b06b4..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockCrystalWhite.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockCrystalWhite", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockDirectionalBreaker.json b/src/main/resources/assets/actuallyadditions/models/item/blockDirectionalBreaker.json deleted file mode 100644 index 193b3216f..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockDirectionalBreaker.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockDirectionalBreaker", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockDropper.json b/src/main/resources/assets/actuallyadditions/models/item/blockDropper.json deleted file mode 100644 index f13edae78..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockDropper.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockDropper", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockEnergizer.json b/src/main/resources/assets/actuallyadditions/models/item/blockEnergizer.json deleted file mode 100644 index 3194c6643..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockEnergizer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockEnergizer", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockEnervator.json b/src/main/resources/assets/actuallyadditions/models/item/blockEnervator.json deleted file mode 100644 index b6a0649e1..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockEnervator.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockEnervator", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFeeder.json b/src/main/resources/assets/actuallyadditions/models/item/blockFeeder.json deleted file mode 100644 index dc79d942c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFeeder.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockFeeder", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFermentingBarrel.json b/src/main/resources/assets/actuallyadditions/models/item/blockFermentingBarrel.json deleted file mode 100644 index 56972a14f..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFermentingBarrel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockFermentingBarrel", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFireworkBox.json b/src/main/resources/assets/actuallyadditions/models/item/blockFireworkBox.json deleted file mode 100644 index 0de756c02..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFireworkBox.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockFireworkBox", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFishingNet.json b/src/main/resources/assets/actuallyadditions/models/item/blockFishingNet.json deleted file mode 100644 index 8dd27a76a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFishingNet.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockFishingNet", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "firstperson": { - "rotation": [0, 0, 0 ], - "translation": [0, 4, 2 ], - "scale": [1.2, 1.2, 1.2] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFlax.json b/src/main/resources/assets/actuallyadditions/models/item/blockFlax.json deleted file mode 100644 index 42effaf85..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFlax.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockFlaxStage1" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFluidCollector.json b/src/main/resources/assets/actuallyadditions/models/item/blockFluidCollector.json deleted file mode 100644 index c5b34ac75..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFluidCollector.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockFluidCollector", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFluidPlacer.json b/src/main/resources/assets/actuallyadditions/models/item/blockFluidPlacer.json deleted file mode 100644 index 83b6b5832..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFluidPlacer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockFluidPlacer", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFurnaceDouble.json b/src/main/resources/assets/actuallyadditions/models/item/blockFurnaceDouble.json deleted file mode 100644 index 1c7332972..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFurnaceDouble.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockFurnaceDouble", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockFurnaceSolar.json b/src/main/resources/assets/actuallyadditions/models/item/blockFurnaceSolar.json deleted file mode 100644 index 4490e4593..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockFurnaceSolar.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockFurnaceSolar", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "firstperson": { - "rotation": [0, 0, 0 ], - "translation": [0, 4, 2 ], - "scale": [1.2, 1.2, 1.2] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockGiantChest.json b/src/main/resources/assets/actuallyadditions/models/item/blockGiantChest.json deleted file mode 100644 index 01c08a12c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockGiantChest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockGiantChest", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockGreenhouseGlass.json b/src/main/resources/assets/actuallyadditions/models/item/blockGreenhouseGlass.json deleted file mode 100644 index 2e826075f..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockGreenhouseGlass.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockGreenhouseGlass", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockGrinder.json b/src/main/resources/assets/actuallyadditions/models/item/blockGrinder.json deleted file mode 100644 index f3ad2c432..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockGrinder.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockGrinder", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockGrinderDouble.json b/src/main/resources/assets/actuallyadditions/models/item/blockGrinderDouble.json deleted file mode 100644 index 28f414787..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockGrinderDouble.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockGrinderDouble", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockHeatCollector.json b/src/main/resources/assets/actuallyadditions/models/item/blockHeatCollector.json deleted file mode 100644 index 1de6350d3..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockHeatCollector.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockHeatCollector", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockInputter.json b/src/main/resources/assets/actuallyadditions/models/item/blockInputter.json deleted file mode 100644 index 3b1bbc2b4..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockInputter.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockInputter", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockInputterAdvanced.json b/src/main/resources/assets/actuallyadditions/models/item/blockInputterAdvanced.json deleted file mode 100644 index 1bbd8209b..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockInputterAdvanced.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockInputterAdvanced", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockItemRepairer.json b/src/main/resources/assets/actuallyadditions/models/item/blockItemRepairer.json deleted file mode 100644 index 7b1d319f8..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockItemRepairer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockItemRepairer", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockLampPowerer.json b/src/main/resources/assets/actuallyadditions/models/item/blockLampPowerer.json deleted file mode 100644 index 8f487c814..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockLampPowerer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockLampPowerer", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockLaserRelay.json b/src/main/resources/assets/actuallyadditions/models/item/blockLaserRelay.json deleted file mode 100644 index 914b5d169..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockLaserRelay.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockLaserRelay", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockLavaFactoryController.json b/src/main/resources/assets/actuallyadditions/models/item/blockLavaFactoryController.json deleted file mode 100644 index c172cd72e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockLavaFactoryController.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockLavaFactoryController", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockLeafGenerator.json b/src/main/resources/assets/actuallyadditions/models/item/blockLeafGenerator.json deleted file mode 100644 index 6ffffa7f9..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockLeafGenerator.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockLeafGenerator", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiner.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiner.json deleted file mode 100644 index 8a27fb3d7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiner.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiner", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartz.json deleted file mode 100644 index 9ce42ed6c..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartz.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscBlackQuartz", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartzChiseled.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartzChiseled.json deleted file mode 100644 index c4e3ea9c2..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartzChiseled.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscBlackQuartzChiseled", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartzPillar.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartzPillar.json deleted file mode 100644 index 3594855f7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscBlackQuartzPillar.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscBlackQuartzPillar", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscCharcoal.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscCharcoal.json deleted file mode 100644 index db375243d..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscCharcoal.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscCharcoal", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscEnderCasing.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscEnderCasing.json deleted file mode 100644 index d3df49bfc..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscEnderCasing.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscEnderCasing", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscEnderpearl.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscEnderpearl.json deleted file mode 100644 index ad2d80cfb..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscEnderpearl.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscEnderpearl", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscIronCasing.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscIronCasing.json deleted file mode 100644 index 4fb8d60ba..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscIronCasing.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscIronCasing", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscLavaFactoryCase.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscLavaFactoryCase.json deleted file mode 100644 index ea47a42bf..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscLavaFactoryCase.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscLavaFactoryCase", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscOreBlackQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscOreBlackQuartz.json deleted file mode 100644 index e38c15ff1..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscOreBlackQuartz.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscOreBlackQuartz", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockMiscWoodCasing.json b/src/main/resources/assets/actuallyadditions/models/item/blockMiscWoodCasing.json deleted file mode 100644 index f5dc8b9fd..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockMiscWoodCasing.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockMiscWoodCasing", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockOilGenerator.json b/src/main/resources/assets/actuallyadditions/models/item/blockOilGenerator.json deleted file mode 100644 index 02299a829..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockOilGenerator.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockOilGenerator", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomBooster.json b/src/main/resources/assets/actuallyadditions/models/item/blockPhantomBooster.json deleted file mode 100644 index 705390fc8..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomBooster.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPhantomBooster", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomBreaker.json b/src/main/resources/assets/actuallyadditions/models/item/blockPhantomBreaker.json deleted file mode 100644 index 151d4b516..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomBreaker.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPhantomBreaker", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomEnergyface.json b/src/main/resources/assets/actuallyadditions/models/item/blockPhantomEnergyface.json deleted file mode 100644 index 9b1dd5ae4..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomEnergyface.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPhantomEnergyface", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomLiquiface.json b/src/main/resources/assets/actuallyadditions/models/item/blockPhantomLiquiface.json deleted file mode 100644 index 3c723cb29..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomLiquiface.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPhantomLiquiface", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomPlacer.json b/src/main/resources/assets/actuallyadditions/models/item/blockPhantomPlacer.json deleted file mode 100644 index 9264444be..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomPlacer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPhantomPlacer", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomface.json b/src/main/resources/assets/actuallyadditions/models/item/blockPhantomface.json deleted file mode 100644 index ee53fe295..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPhantomface.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPhantomface", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzSlab.json b/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzSlab.json deleted file mode 100644 index 00e998edc..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzSlab.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPillarQuartzSlabBottom", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzStair.json b/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzStair.json deleted file mode 100644 index 6dc54675a..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzStair.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPillarQuartzStairs", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 180, 0 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzWall.json b/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzWall.json index d71f42a72..f8282b53d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzWall.json +++ b/src/main/resources/assets/actuallyadditions/models/item/blockPillarQuartzWall.json @@ -1,10 +1,3 @@ { - "parent": "actuallyadditions:block/blockPillarQuartzWallInventory", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} + "parent": "actuallyadditions:block/blockPillarQuartzWallInventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockPlacer.json b/src/main/resources/assets/actuallyadditions/models/item/blockPlacer.json deleted file mode 100644 index 6154ccbec..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockPlacer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockPlacer", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockQuartzSlab.json b/src/main/resources/assets/actuallyadditions/models/item/blockQuartzSlab.json deleted file mode 100644 index fb84a03ab..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockQuartzSlab.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockQuartzSlabBottom", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockQuartzStair.json b/src/main/resources/assets/actuallyadditions/models/item/blockQuartzStair.json deleted file mode 100644 index bf66153e9..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockQuartzStair.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockQuartzStairs", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 180, 0 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockQuartzWall.json b/src/main/resources/assets/actuallyadditions/models/item/blockQuartzWall.json index 1766d401f..22b4b32ed 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/blockQuartzWall.json +++ b/src/main/resources/assets/actuallyadditions/models/item/blockQuartzWall.json @@ -1,10 +1,3 @@ { - "parent": "actuallyadditions:block/blockQuartzWallInventory", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} + "parent": "actuallyadditions:block/blockQuartzWallInventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockRangedCollector.json b/src/main/resources/assets/actuallyadditions/models/item/blockRangedCollector.json deleted file mode 100644 index d69bc18c8..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockRangedCollector.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockRangedCollector", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockRice.json b/src/main/resources/assets/actuallyadditions/models/item/blockRice.json deleted file mode 100644 index fec824365..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockRice.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockRiceStage1" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockSmileyCloud.json b/src/main/resources/assets/actuallyadditions/models/item/blockSmileyCloud.json deleted file mode 100644 index e60244b81..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockSmileyCloud.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockSmileyCloud", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenFence.json b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenFence.json index c10464080..d1d956e1f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenFence.json +++ b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenFence.json @@ -1,10 +1,3 @@ { - "parent": "actuallyadditions:block/blockTestifiBucksGreenFenceInventory", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} + "parent": "actuallyadditions:block/blockTestifiBucksGreenFenceInventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenSlab.json b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenSlab.json deleted file mode 100644 index 9dab993f8..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenSlab.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockTestifiBucksGreenSlabBottom", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenStairs.json b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenStairs.json deleted file mode 100644 index a9fb38819..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenStairs.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockTestifiBucksGreenStairs", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 180, 0 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenWall.json b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenWall.json deleted file mode 100644 index acc151c04..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksGreenWall.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockTestifiBucksGreenWall", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteFence.json b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteFence.json index 2a487daf3..0e11467ab 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteFence.json +++ b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteFence.json @@ -1,10 +1,3 @@ { - "parent": "actuallyadditions:block/blockTestifiBucksWhiteFenceInventory", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} + "parent": "actuallyadditions:block/blockTestifiBucksWhiteFenceInventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteSlab.json b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteSlab.json deleted file mode 100644 index f323b337e..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteSlab.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockTestifiBucksWhiteSlabBottom", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteStairs.json b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteStairs.json deleted file mode 100644 index 37460dfd7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteStairs.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockTestifiBucksWhiteStairs", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - }, - "gui": { - "rotation": [ 0, 180, 0 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteWall.json b/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteWall.json deleted file mode 100644 index 3dac81292..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTestifiBucksWhiteWall.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockTestifiBucksWhiteWall", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockTreasureChest.json b/src/main/resources/assets/actuallyadditions/models/item/blockTreasureChest.json deleted file mode 100644 index 86c743016..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockTreasureChest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockTreasureChest", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockWildCanola.json b/src/main/resources/assets/actuallyadditions/models/item/blockWildCanola.json deleted file mode 100644 index b04563dbe..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockWildCanola.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockCanolaStage1" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockWildCoffee.json b/src/main/resources/assets/actuallyadditions/models/item/blockWildCoffee.json deleted file mode 100644 index 37a181523..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockWildCoffee.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockCoffeeStage1" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockWildFlax.json b/src/main/resources/assets/actuallyadditions/models/item/blockWildFlax.json deleted file mode 100644 index 42effaf85..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockWildFlax.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockFlaxStage1" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockWildRice.json b/src/main/resources/assets/actuallyadditions/models/item/blockWildRice.json deleted file mode 100644 index fec824365..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockWildRice.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:blocks/blockRiceStage1" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/blockXPSolidifier.json b/src/main/resources/assets/actuallyadditions/models/item/blockXPSolidifier.json deleted file mode 100644 index 25c5378a7..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/blockXPSolidifier.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "parent": "actuallyadditions:block/blockXPSolidifier", - "display": { - "thirdperson": { - "rotation": [ 10, -45, 170 ], - "translation": [ 0, 1.5, -2.75 ], - "scale": [ 0.375, 0.375, 0.375 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/handheldItem.json b/src/main/resources/assets/actuallyadditions/models/item/handheldItem.json new file mode 100644 index 000000000..55dfddf00 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/handheldItem.json @@ -0,0 +1,3 @@ +{ + "parent": "item/handheld" +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalBlack.json index 4f98f4397..adcaaa61a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalBlue.json index 4c212b4ef..6d0363e7b 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalGreen.json index 556a66efd..237f54816 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalLightBlue.json index 89f49fe1e..99b3ffb40 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalRed.json index 1cb650176..7b0723390 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalWhite.json index bee2a16b1..ab8c1e29b 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeEmerald.json index 7e6cdc255..fd173dc59 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeObsidian.json index eec9cf3bf..a7acbc54d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemAxeQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemAxeQuartz.json index f4d64c458..f418070eb 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemAxeQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemAxeQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemAxeQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBattery.json b/src/main/resources/assets/actuallyadditions/models/item/itemBattery.json index 5b11ee9ce..c7067c797 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBattery.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBattery.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBattery" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBatteryDouble.json b/src/main/resources/assets/actuallyadditions/models/item/itemBatteryDouble.json index 13ed302b6..d13864d1f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBatteryDouble.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBatteryDouble.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBatteryDouble" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBatteryQuadruple.json b/src/main/resources/assets/actuallyadditions/models/item/itemBatteryQuadruple.json index 327a98ddb..fd290ee2b 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBatteryQuadruple.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBatteryQuadruple.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBatteryQuadruple" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBatteryQuintuple.json b/src/main/resources/assets/actuallyadditions/models/item/itemBatteryQuintuple.json index cf16d5de9..3dcd3d1fd 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBatteryQuintuple.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBatteryQuintuple.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBatteryQuintuple" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBatteryTriple.json b/src/main/resources/assets/actuallyadditions/models/item/itemBatteryTriple.json index eff130296..ecf91b783 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBatteryTriple.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBatteryTriple.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBatteryTriple" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBooklet.json b/src/main/resources/assets/actuallyadditions/models/item/itemBooklet.json index fb3016358..2a9d2d30c 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBooklet.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBooklet.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBooklet" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalBlack.json index 4cfd6f455..83258c6ac 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalBlue.json index ddfedf1f6..ac8058fc6 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalGreen.json index 1f3e64b4f..7d789aec7 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalLightBlue.json index 9c6a3a15e..91e26ea84 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalRed.json index 9c5979db9..68f530b99 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalWhite.json index 6be621781..c7db5b181 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsEmerald.json index d9af82c78..e15326ca2 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsObsidian.json index 8ec9c0b17..010ca1edd 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBootsQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemBootsQuartz.json index a41b54462..4add5bce6 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBootsQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBootsQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBootsQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBucketCanolaOil.json b/src/main/resources/assets/actuallyadditions/models/item/itemBucketCanolaOil.json index 9d4cc28c8..2f21f870d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBucketCanolaOil.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBucketCanolaOil.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBucketCanolaOil" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemBucketOil.json b/src/main/resources/assets/actuallyadditions/models/item/itemBucketOil.json index 75c941074..77f538821 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemBucketOil.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemBucketOil.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemBucketOil" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCanolaSeed.json b/src/main/resources/assets/actuallyadditions/models/item/itemCanolaSeed.json index abdbde44c..91a6ee2f7 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCanolaSeed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCanolaSeed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCanolaSeed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalBlack.json index 9d2639e78..9e722bef1 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalBlue.json index 28a716282..682814458 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalGreen.json index 71934a0ec..41e969945 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalLightBlue.json index 6df7a6501..34dbd6d89 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalRed.json index 98cf258ba..443b6d2a0 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalWhite.json index d3b38ef5a..75dfc56a4 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestEmerald.json index 37fbe2d88..7a6a30671 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestObsidian.json index 62d8ab777..7d5879a26 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestQuartz.json index 79b4a4c5f..fbdf78a10 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemChestToCrateUpgrade.json b/src/main/resources/assets/actuallyadditions/models/item/itemChestToCrateUpgrade.json index 995f4ec8b..124dc17ee 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemChestToCrateUpgrade.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemChestToCrateUpgrade.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemChestToCrateUpgrade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCoffee.json b/src/main/resources/assets/actuallyadditions/models/item/itemCoffee.json index 0779c17c6..2cbcda8ca 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCoffee.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCoffee.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCoffee" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCoffeeBeans.json b/src/main/resources/assets/actuallyadditions/models/item/itemCoffeeBeans.json index 2677e5f3e..21874940e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCoffeeBeans.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCoffeeBeans.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCoffeeBeans" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCoffeeSeed.json b/src/main/resources/assets/actuallyadditions/models/item/itemCoffeeSeed.json index 7ac254b06..214854028 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCoffeeSeed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCoffeeSeed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCoffeeSeed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemColorLens.json b/src/main/resources/assets/actuallyadditions/models/item/itemColorLens.json index febf4f546..cf5e89623 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemColorLens.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemColorLens.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemColorLens" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrafterOnAStick.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrafterOnAStick.json index 81db3445f..7809fa335 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrafterOnAStick.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrafterOnAStick.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCrafterOnAStick" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrateKeeper.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrateKeeper.json index 3c716ea09..8308dba1f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrateKeeper.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrateKeeper.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCrateKeeper" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalBlack.json index d5f4a00d0..e908f2af2 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalBlue.json index af3722fea..b7809090b 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalGreen.json index 4749bb6b5..f2f6b2855 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBLue.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBLue.json deleted file mode 100644 index 4fc6ee310..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBLue.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:items/itemCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBlue.json new file mode 100644 index 000000000..f21e0d5d9 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalLightBlue.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemCrystalLightBlue" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalRed.json index 891e69014..3e47ab4dc 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalWhite.json index 89b94e961..a35bc0f6c 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDamageLens.json b/src/main/resources/assets/actuallyadditions/models/item/itemDamageLens.json index 7562af40d..3cf3e830d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDamageLens.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDamageLens.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDamageLens" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillBlack.json index 681c54fea..4b516a0d2 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillBlue.json index f1c323f28..61ddad537 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillBrown.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillBrown.json index 5848ed5ca..3fec2531c 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillBrown.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillBrown.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillBrown" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillCyan.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillCyan.json index 54f1e58b6..94a181a4d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillCyan.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillCyan.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillCyan" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillGray.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillGray.json index 6d151a083..cfa602871 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillGray.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillGray.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillGray" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillGreen.json index b59b23bf2..984be3b3f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillLightBlue.json index 79cf0516d..ec97eed09 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillLightGray.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillLightGray.json index 826c31cb2..88b452961 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillLightGray.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillLightGray.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillLightGray" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillLime.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillLime.json index cf6f8c952..cc1642732 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillLime.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillLime.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillLime" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillMagenta.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillMagenta.json index b07f6b08e..4e67eed5d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillMagenta.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillMagenta.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillMagenta" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillOrange.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillOrange.json index 4de274a3f..6a5ccefee 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillOrange.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillOrange.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillOrange" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillPink.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillPink.json index e90ef690e..1136e1d81 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillPink.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillPink.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillPink" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillPurple.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillPurple.json index fa524fa85..c55bacbc4 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillPurple.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillPurple.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillPurple" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillRed.json index e0a420b9b..5e999b492 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeBlockPlacing.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeBlockPlacing.json index 380ff4691..f698ed519 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeBlockPlacing.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeBlockPlacing.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeBlockPlacing" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFiveByFive.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFiveByFive.json index 06edaa9a1..1c25ff937 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFiveByFive.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFiveByFive.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeFiveByFive" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFortune.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFortune.json index 40d8a06b7..e35afc905 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFortune.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFortune.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeFortune" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFortuneII.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFortuneII.json index 897775de5..fa55e177d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFortuneII.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeFortuneII.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeFortuneII" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSilkTouch.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSilkTouch.json index c3a1030e5..ed35e7c71 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSilkTouch.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSilkTouch.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeSilkTouch" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeed.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeed.json index 93eb3981f..8dcc1bc00 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeSpeed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeedII.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeedII.json index 6a9cfcd6b..8b6de13cb 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeedII.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeedII.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeSpeedII" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeedIII.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeedIII.json index b871fd200..c884700f0 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeedIII.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeSpeedIII.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeSpeedIII" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeThreeByThree.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeThreeByThree.json index 1e6a9663d..5c0e64d32 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeThreeByThree.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillUpgradeThreeByThree.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDrillUpgradeThreeByThree" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillWhite.json index d753d890c..47873c0c6 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDrillYellow.json b/src/main/resources/assets/actuallyadditions/models/item/itemDrillYellow.json index fc7a27e1f..4762e03c4 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDrillYellow.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDrillYellow.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemDrillYellow" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemDust.json b/src/main/resources/assets/actuallyadditions/models/item/itemDust.json index c97b4b7d1..1845ef3a4 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemDust.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemDust.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemDust" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemExplosionLens.json b/src/main/resources/assets/actuallyadditions/models/item/itemExplosionLens.json index bbb387e76..a1d4eff1a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemExplosionLens.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemExplosionLens.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemExplosionLens" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFertilizer.json b/src/main/resources/assets/actuallyadditions/models/item/itemFertilizer.json index 21e5e68d3..ede15f37a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFertilizer.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFertilizer.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFertilizer" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFilter.json b/src/main/resources/assets/actuallyadditions/models/item/itemFilter.json new file mode 100644 index 000000000..2f3a59911 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFilter.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemFilter" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFlaxSeed.json b/src/main/resources/assets/actuallyadditions/models/item/itemFlaxSeed.json index 0087d9527..582d4985f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFlaxSeed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFlaxSeed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFlaxSeed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodBacon.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodBacon.json index 5eed1f061..68db47723 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodBacon.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodBacon.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodBacon" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodBaguette.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodBaguette.json index b9d80c5f0..1dcedd339 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodBaguette.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodBaguette.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodBaguette" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodBigCookie.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodBigCookie.json index b2d339305..c79571eef 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodBigCookie.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodBigCookie.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodBigCookie" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodCarrotJuice.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodCarrotJuice.json index a493df9f4..67a35870f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodCarrotJuice.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodCarrotJuice.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodCarrotJuice" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodCheese.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodCheese.json index b6fb363ac..9a11d2b2c 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodCheese.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodCheese.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodCheese" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolate.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolate.json index 458ceb6ac..e64434fb3 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolate.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolate.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodChocolate" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolateCake.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolateCake.json index 6d68ecd01..a7eca8eb5 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolateCake.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolateCake.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodChocolateCake" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolateToast.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolateToast.json index 79f80256a..37b956e5e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolateToast.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodChocolateToast.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodChocolateToast" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodDoughnut.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodDoughnut.json index c1192cfca..45e4ad998 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodDoughnut.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodDoughnut.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodDoughnut" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodFishNChips.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodFishNChips.json index 09b781a3b..b7bbe0b22 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodFishNChips.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodFishNChips.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodFishNChips" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodFrenchFries.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodFrenchFries.json index 9e854d5a3..64273194a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodFrenchFries.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodFrenchFries.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodFrenchFries" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodFrenchFry.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodFrenchFry.json index 0670a6565..d8cd6c69a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodFrenchFry.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodFrenchFry.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodFrenchFry" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodHamburger.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodHamburger.json index 400e7218e..d03a25d11 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodHamburger.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodHamburger.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodHamburger" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodNoodle.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodNoodle.json index 4b6894d91..90b72c2d3 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodNoodle.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodNoodle.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodNoodle" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodPizza.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodPizza.json index a6b4c00d0..7af7813cc 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodPizza.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodPizza.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodPizza" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodPumpkinStew.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodPumpkinStew.json index 2f2a0ec88..a9035f536 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodPumpkinStew.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodPumpkinStew.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodPumpkinStew" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodRice.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodRice.json index 7a28939c8..c1ca47eca 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodRice.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodRice.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodRice" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodRiceBread.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodRiceBread.json index f8ce8ddc9..267e9c805 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodRiceBread.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodRiceBread.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodRiceBread" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodSpaghetti.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodSpaghetti.json index c198d5688..c3d6193f6 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodSpaghetti.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodSpaghetti.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodSpaghetti" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodSubmarineSandwich.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodSubmarineSandwich.json index 11b9c1390..045cadcdb 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodSubmarineSandwich.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodSubmarineSandwich.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodSubmarineSandwich" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemFoodToast.json b/src/main/resources/assets/actuallyadditions/models/item/itemFoodToast.json index ec7d7d946..e103fa788 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemFoodToast.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemFoodToast.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemFoodToast" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemGrowthRing.json b/src/main/resources/assets/actuallyadditions/models/item/itemGrowthRing.json index 6a168e784..a497e5ec4 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemGrowthRing.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemGrowthRing.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemGrowthRing" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHairyBall.json b/src/main/resources/assets/actuallyadditions/models/item/itemHairyBall.json index 1b6d96ec5..646b0c71a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHairyBall.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHairyBall.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHairyBall" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalBlack.json index 9105de89c..bf26205e1 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalBlue.json index 9fc307f23..50ac82b4e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalGreen.json index 1d2d9075c..3a97208df 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalLightBlue.json index e8f611e5c..e2b12aa16 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalRed.json index f745d5a15..f30bcc650 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalWhite.json index 2991fdc1d..7e504dcc5 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmEmerald.json index 632f5f331..7c018afa3 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmObsidian.json index 1733d7047..7472acbee 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHelmQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemHelmQuartz.json index de80e361e..0c3bd38df 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHelmQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHelmQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemHelmQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalBlack.json index 083f0244f..83d951e4c 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemHoeCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalBlue.json new file mode 100644 index 000000000..47ef30fbb --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalBlue.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/handheldItem", + "textures": { + "layer0": "actuallyadditions:items/itemHoeCrystalBlue" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalGreen.json index 38502c282..93b7e633f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemHoeCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalLightBlue.json index c47310bd7..1449933aa 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemHoeCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalRed.json index 3abdd74ad..ea15741c8 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemHoeCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalWhite.json index f68baefa5..8006c03a5 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemHoeCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalblue.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalblue.json deleted file mode 100644 index e79636060..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeCrystalblue.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:items/itemHoeCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeEmerald.json index 62747b29b..45cb9e370 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemHoeEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeObsidian.json index 8f6a3b766..3d3272e39 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemHoeObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemHoeQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemHoeQuartz.json index 74f38d03a..e0fb71b3f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemHoeQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemHoeQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemHoeQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemJam.json b/src/main/resources/assets/actuallyadditions/models/item/itemJam.json index de9a01f4d..c8239f49d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemJam.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemJam.json @@ -1,19 +1,7 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemJam", "layer1": "actuallyadditions:items/itemJamOverlay" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemKnife.json b/src/main/resources/assets/actuallyadditions/models/item/itemKnife.json index 81ffc94b6..022c5cf1d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemKnife.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemKnife.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemKnife" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemLaserWrench.json b/src/main/resources/assets/actuallyadditions/models/item/itemLaserWrench.json index 1019bdcd4..edf75b25a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemLaserWrench.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemLaserWrench.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemLaserWrench" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemLeafBlower.json b/src/main/resources/assets/actuallyadditions/models/item/itemLeafBlower.json index f8cd64808..5ac9eea2a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemLeafBlower.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemLeafBlower.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemLeafBlower" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemLeafBlowerAdvanced.json b/src/main/resources/assets/actuallyadditions/models/item/itemLeafBlowerAdvanced.json index 069eb24a7..5555f3a08 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemLeafBlowerAdvanced.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemLeafBlowerAdvanced.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemLeafBlowerAdvanced" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscBatWing.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBatWing.json index dd74c149c..5fa974da3 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscBatWing.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBatWing.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscBatWing" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscBiocoal.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBiocoal.json new file mode 100644 index 000000000..9b517f39a --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBiocoal.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemMiscBiocoal" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscBiomass.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBiomass.json new file mode 100644 index 000000000..14bf007f0 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBiomass.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemMiscBiomass" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscBlackDye.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBlackDye.json index 253063d7e..f5667ffcb 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscBlackDye.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBlackDye.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscBlackDye" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscBlackQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBlackQuartz.json index aa5416518..1bc416f0b 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscBlackQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscBlackQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscBlackQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscCanola.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscCanola.json index 26df9bc37..ea2e3e484 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscCanola.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscCanola.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscCanola" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscCoil.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscCoil.json index 9ea7a8ed8..b4e3e5884 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscCoil.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscCoil.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscCoil" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscCoilAdvanced.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscCoilAdvanced.json index 4f695ffd7..09bd1dfac 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscCoilAdvanced.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscCoilAdvanced.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscCoilAdvanced" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscCup.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscCup.json index ae0e7b67b..ce9757e13 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscCup.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscCup.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscCup" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscDough.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscDough.json index ae5b963cf..092e8d5a6 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscDough.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscDough.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscDough" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscDrillCore.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscDrillCore.json index 06b4afe88..8ce6af6d0 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscDrillCore.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscDrillCore.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscDrillCore" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscEnderStar.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscEnderStar.json new file mode 100644 index 000000000..5f7b02daa --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscEnderStar.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemMiscEnderStar" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscKnifeBlade.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscKnifeBlade.json index 022ef9ef2..9f7d18846 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscKnifeBlade.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscKnifeBlade.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscKnifeBlade" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscKnifeHandle.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscKnifeHandle.json index a32e370c1..2b47e71a3 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscKnifeHandle.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscKnifeHandle.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscKnifeHandle" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscLens.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscLens.json index 1ae2e96f0..f76c7da1e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscLens.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscLens.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscLens" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscMashedFood.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscMashedFood.json index b3b778f22..c92c840a4 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscMashedFood.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscMashedFood.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscMashedFood" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscPaperCone.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscPaperCone.json index 24b378ed8..6095682c5 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscPaperCone.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscPaperCone.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscPaperCone" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscRiceDough.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscRiceDough.json index 4123b88da..1a3a900e2 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscRiceDough.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscRiceDough.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscRiceDough" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscRiceSlime.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscRiceSlime.json index f20e1520f..7f85c37c0 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscRiceSlime.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscRiceSlime.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscRiceSlime" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscRing.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscRing.json index ded1c493e..e66312b24 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscRing.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscRing.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscRing" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscSpawnerShard.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscSpawnerShard.json new file mode 100644 index 000000000..9373701b2 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscSpawnerShard.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemMiscSpawnerShard" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscTinyCharcoal.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscTinyCharcoal.json index 430bb6df2..02143f751 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscTinyCharcoal.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscTinyCharcoal.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscTinyCharcoal" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscTinyCoal.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscTinyCoal.json index 065e3d543..82f5f999a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemMiscTinyCoal.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscTinyCoal.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemMiscTinyCoal" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemMiscYoutubeIcon.json b/src/main/resources/assets/actuallyadditions/models/item/itemMiscYoutubeIcon.json new file mode 100644 index 000000000..0c1d55470 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemMiscYoutubeIcon.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemMiscYoutubeIcon" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalBlack.json index e4521de3b..3f137ac77 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalBlue.json index 6ed1bcbb5..9d551397d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalGreen.json index 0e50de466..4b3afa373 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalLightBlue.json index db3718cc6..4e3b4e17d 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalRed.json index f3f48adac..a40f58d9e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalWhite.json index adbd3061b..07c5e306e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsEmerald.json index 35b1f272d..8f6f95ad2 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsObsidian.json index 0597eca71..38e5c7fdc 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPantsQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemPantsQuartz.json index 5a955c125..c47d5c293 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPantsQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPantsQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPantsQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPaxel.json b/src/main/resources/assets/actuallyadditions/models/item/itemPaxel.json index ff9925e9e..0ced934f9 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPaxel.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPaxel.json @@ -1,19 +1,7 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPaxel", "layer1": "actuallyadditions:items/itemPaxelOverlay" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPhantomConnector.json b/src/main/resources/assets/actuallyadditions/models/item/itemPhantomConnector.json index bbc5cf49a..6c8c40553 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPhantomConnector.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPhantomConnector.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPhantomConnector" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalBlack.json index a0712b0a0..090bb22b5 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalBlue.json index b63d3202b..be7690eb3 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalGreen.json index 48c186437..b7ae20085 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalLightBlue.json index 9e8fd0fc8..416dad6aa 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalRed.json index ab913e50d..c712355fd 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalWhite.json index fb7d66be8..1d069bcdd 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeEmerald.json index d6278082d..131a9f504 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeObsidian.json index 131104662..a0f8762fd 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeQuartz.json index ffd45f524..6b0be8834 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPickaxeQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemPickaxeQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPotionRIng.json b/src/main/resources/assets/actuallyadditions/models/item/itemPotionRIng.json deleted file mode 100644 index f680f0012..000000000 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPotionRIng.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parent": "builtin/generated", - "textures": { - "layer0": "actuallyadditions:items/itemPotionRing" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPotionRing.json b/src/main/resources/assets/actuallyadditions/models/item/itemPotionRing.json new file mode 100644 index 000000000..f8a56de4e --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPotionRing.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemPotionRing" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemPotionRingAdvanced.json b/src/main/resources/assets/actuallyadditions/models/item/itemPotionRingAdvanced.json index 501577231..d16ea43da 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemPotionRingAdvanced.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemPotionRingAdvanced.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemPotionRingAdvanced" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemRarmorModuleReconstructor.json b/src/main/resources/assets/actuallyadditions/models/item/itemRarmorModuleReconstructor.json new file mode 100644 index 000000000..117a5e75c --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemRarmorModuleReconstructor.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemRarmorModuleReconstructor" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemResonantRice.json b/src/main/resources/assets/actuallyadditions/models/item/itemResonantRice.json index 2454d8596..66ac696a6 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemResonantRice.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemResonantRice.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemResonantRice" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemRiceSeed.json b/src/main/resources/assets/actuallyadditions/models/item/itemRiceSeed.json index 723b390dd..243266e7a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemRiceSeed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemRiceSeed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemRiceSeed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalBlack.json index ac520e37c..4ed41174e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemShovelCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalBlue.json index da7eb699e..ca07d6e06 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemShovelCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalGreen.json index 615b9a346..c952a11d9 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemShovelCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalLightBlue.json index 2c8303371..616865d0e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemShovelCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalRed.json index bdba83a91..433aa3563 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemShovelCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalWhite.json index 28d29b841..9b7a2038e 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemShovelCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelEmerald.json index f20613711..edc09f533 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemShovelEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelObsidian.json index 46fc160b3..b8b8b60ad 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemShovelObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemShovelQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemShovelQuartz.json index ef1374004..93f9bdaf2 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemShovelQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemShovelQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemShovelQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSolidifiedExperience.json b/src/main/resources/assets/actuallyadditions/models/item/itemSolidifiedExperience.json index 01c06e5d9..addd00e9b 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSolidifiedExperience.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSolidifiedExperience.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemSolidifiedExperience" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSpawnerChanger.json b/src/main/resources/assets/actuallyadditions/models/item/itemSpawnerChanger.json new file mode 100644 index 000000000..af917ee18 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSpawnerChanger.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/handheldItem", + "textures": { + "layer0": "actuallyadditions:items/itemSpawnerChanger" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSuctionRing.json b/src/main/resources/assets/actuallyadditions/models/item/itemSuctionRing.json index 5fc36c5bb..789e6d073 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSuctionRing.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSuctionRing.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemSuctionRing" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalBlack.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalBlack.json index b72ce7100..6e3926eea 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalBlack.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalBlack.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordCrystalBlack" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalBlue.json index 3db1d6962..9dfb59363 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordCrystalBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalGreen.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalGreen.json index dacd56119..c03b3cce2 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalGreen.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalGreen.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordCrystalGreen" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalLightBlue.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalLightBlue.json index 5145fb179..529249c2f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalLightBlue.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalLightBlue.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordCrystalLightBlue" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalRed.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalRed.json index 6c05bcefc..b7580c11f 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalRed.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalRed.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordCrystalRed" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalWhite.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalWhite.json index 1aae51b75..26ab9abe2 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalWhite.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordCrystalWhite.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordCrystalWhite" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordEmerald.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordEmerald.json index 78805d798..0678b4ee1 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordEmerald.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordEmerald.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordEmerald" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordObsidian.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordObsidian.json index bd1439eb6..c9aeb07fb 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordObsidian.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordObsidian.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordObsidian" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemSwordQuartz.json b/src/main/resources/assets/actuallyadditions/models/item/itemSwordQuartz.json index 7cc679035..06a8019c4 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemSwordQuartz.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemSwordQuartz.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemSwordQuartz" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemTeleStaff.json b/src/main/resources/assets/actuallyadditions/models/item/itemTeleStaff.json index 2488f5e93..fd78c0699 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemTeleStaff.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemTeleStaff.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/handheldItem", "textures": { "layer0": "actuallyadditions:items/itemTeleStaff" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemWaterBowl.json b/src/main/resources/assets/actuallyadditions/models/item/itemWaterBowl.json new file mode 100644 index 000000000..f4cb0246d --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/itemWaterBowl.json @@ -0,0 +1,6 @@ +{ + "parent": "actuallyadditions:item/standardItem", + "textures": { + "layer0": "actuallyadditions:items/itemWaterBowl" + } +} diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemWaterRemovalRing.json b/src/main/resources/assets/actuallyadditions/models/item/itemWaterRemovalRing.json index e833b971a..88ac40726 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemWaterRemovalRing.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemWaterRemovalRing.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemWaterRemovalRing" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/itemWingsOfTheBats.json b/src/main/resources/assets/actuallyadditions/models/item/itemWingsOfTheBats.json index 16ce4d11b..8f6baad6a 100644 --- a/src/main/resources/assets/actuallyadditions/models/item/itemWingsOfTheBats.json +++ b/src/main/resources/assets/actuallyadditions/models/item/itemWingsOfTheBats.json @@ -1,18 +1,6 @@ { - "parent": "builtin/generated", + "parent": "actuallyadditions:item/standardItem", "textures": { "layer0": "actuallyadditions:items/itemWingsOfTheBats" - }, - "display": { - "thirdperson": { - "rotation": [ -90, 0, 0 ], - "translation": [ 0, 1, -3 ], - "scale": [ 0.55, 0.55, 0.55 ] - }, - "firstperson": { - "rotation": [ 0, -135, 25 ], - "translation": [ 0, 4, 2 ], - "scale": [ 1.7, 1.7, 1.7 ] - } } } diff --git a/src/main/resources/assets/actuallyadditions/models/item/standardItem.json b/src/main/resources/assets/actuallyadditions/models/item/standardItem.json new file mode 100644 index 000000000..b449e1f77 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/item/standardItem.json @@ -0,0 +1,3 @@ +{ + "parent": "item/generated" +} diff --git a/src/main/resources/assets/actuallyadditions/sounds.json b/src/main/resources/assets/actuallyadditions/sounds.json index 3fbd30a78..aedb30d28 100644 --- a/src/main/resources/assets/actuallyadditions/sounds.json +++ b/src/main/resources/assets/actuallyadditions/sounds.json @@ -1,6 +1,6 @@ { - "duhDuhDuhDuuuh": { "category": "record", "sounds":["duhDuhDuhDuuuh"] }, - "coffeeMachine": { "category": "block", "sounds":["coffeeMachine"] }, - "reconstructor": { "category": "block", "sounds":["reconstructor"] }, - "crusher": { "category": "block", "sounds":["crusher"] } + "duhDuhDuhDuuuh": { "category": "record", "sounds":["actuallyadditions:duhDuhDuhDuuuh"] }, + "coffeeMachine": { "category": "block", "sounds":["actuallyadditions:coffeeMachine"] }, + "reconstructor": { "category": "block", "sounds":["actuallyadditions:reconstructor"] }, + "crusher": { "category": "block", "sounds":["actuallyadditions:crusher"] } } \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockDisplayStand.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockDisplayStand.png new file mode 100644 index 000000000..c3d2fbe55 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockDisplayStand.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockDisplayStandSide.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockDisplayStandSide.png new file mode 100644 index 000000000..c2cf32d38 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockDisplayStandSide.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockGiantChestLarge.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockGiantChestLarge.png new file mode 100644 index 000000000..49370b6cb Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockGiantChestLarge.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockGiantChestMedium.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockGiantChestMedium.png new file mode 100644 index 000000000..66772d667 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockGiantChestMedium.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockItemViewer.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockItemViewer.png new file mode 100644 index 000000000..7d050c569 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockItemViewer.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockPhantomRedstoneface.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockPhantomRedstoneface.png new file mode 100644 index 000000000..31cf7d4d3 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockPhantomRedstoneface.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockPlayerInterface.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockPlayerInterface.png new file mode 100644 index 000000000..bb4c30f25 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/blockPlayerInterface.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelBookletStand.png b/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelBookletStand.png new file mode 100644 index 000000000..822ab5dfa Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelBookletStand.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItem.png b/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItem.png new file mode 100644 index 000000000..1d1a654de Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItem.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItemWhitelist.png b/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItemWhitelist.png new file mode 100644 index 000000000..e9b6b2f5d Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItemWhitelist.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/booklet/guiBooklet.png b/src/main/resources/assets/actuallyadditions/textures/gui/booklet/guiBooklet.png index 1a67f3893..7f2c5572f 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/booklet/guiBooklet.png and b/src/main/resources/assets/actuallyadditions/textures/gui/booklet/guiBooklet.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/booklet/pageLushCaves.png b/src/main/resources/assets/actuallyadditions/textures/gui/booklet/pageLushCaves.png new file mode 100644 index 000000000..c5d536847 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/gui/booklet/pageLushCaves.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiCanolaPress.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiCanolaPress.png index 4472e793f..329ca83de 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiCanolaPress.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiCanolaPress.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiCoffeeMachine.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiCoffeeMachine.png index 338f8beb8..71dd7595e 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiCoffeeMachine.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiCoffeeMachine.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiFermentingBarrel.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiFermentingBarrel.png index 68f68415e..a50af9b98 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiFermentingBarrel.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiFermentingBarrel.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiFilter.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiFilter.png new file mode 100644 index 000000000..664ff5067 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/gui/guiFilter.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiFluidCollector.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiFluidCollector.png index 33714d691..c99b5f194 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiFluidCollector.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiFluidCollector.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiInputter.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiInputter.png index 9b4bc4d36..a5aadf9a0 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiInputter.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiInputter.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiInputterAdvanced.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiInputterAdvanced.png index 67673f121..7f42011c4 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiInputterAdvanced.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiInputterAdvanced.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiItemDisplay.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiItemDisplay.png new file mode 100644 index 000000000..f0ed62437 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/gui/guiItemDisplay.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiLaserRelayItemWhitelist.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiLaserRelayItemWhitelist.png new file mode 100644 index 000000000..bed3eee85 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/gui/guiLaserRelayItemWhitelist.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/guiOilGenerator.png b/src/main/resources/assets/actuallyadditions/textures/gui/guiOilGenerator.png index 79b7459c7..117ca75a8 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/guiOilGenerator.png and b/src/main/resources/assets/actuallyadditions/textures/gui/guiOilGenerator.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemFilter.png b/src/main/resources/assets/actuallyadditions/textures/items/itemFilter.png new file mode 100644 index 000000000..fedfddc1c Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemFilter.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemMinecartFireworkBox.png b/src/main/resources/assets/actuallyadditions/textures/items/itemMinecartFireworkBox.png new file mode 100644 index 000000000..cf0e4c108 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemMinecartFireworkBox.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemMiscBiocoal.png b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscBiocoal.png new file mode 100644 index 000000000..e607c2514 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscBiocoal.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemMiscBiomass.png b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscBiomass.png new file mode 100644 index 000000000..e3519d428 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscBiomass.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemMiscEnderStar.png b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscEnderStar.png new file mode 100644 index 000000000..7da40518b Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscEnderStar.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemMiscSpawnerShard.png b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscSpawnerShard.png new file mode 100644 index 000000000..2829b0490 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscSpawnerShard.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemMiscYoutubeIcon.png b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscYoutubeIcon.png new file mode 100644 index 000000000..ea9c8ab15 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemMiscYoutubeIcon.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemRarmorModuleReconstructor.png b/src/main/resources/assets/actuallyadditions/textures/items/itemRarmorModuleReconstructor.png new file mode 100644 index 000000000..6044c6497 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemRarmorModuleReconstructor.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png b/src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png deleted file mode 100644 index a2de4029f..000000000 Binary files a/src/main/resources/assets/actuallyadditions/textures/items/itemRoundedPrism.png and /dev/null differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemSpawnerChanger.png b/src/main/resources/assets/actuallyadditions/textures/items/itemSpawnerChanger.png new file mode 100644 index 000000000..9175733e1 Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemSpawnerChanger.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemWaterBowl.png b/src/main/resources/assets/actuallyadditions/textures/items/itemWaterBowl.png new file mode 100644 index 000000000..3df0edd4f Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemWaterBowl.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/logo.png b/src/main/resources/assets/actuallyadditions/textures/logo.png index c80dfb8e9..7da66346c 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/logo.png and b/src/main/resources/assets/actuallyadditions/textures/logo.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsBook.png b/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsBook.png new file mode 100644 index 000000000..08b38684e Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsBook.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsDrill.png b/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsDrill.png new file mode 100644 index 000000000..858ba1746 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsDrill.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsLeafBlo.png b/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsLeafBlo.png new file mode 100644 index 000000000..8d38b0f0e Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsLeafBlo.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsPhanCon.png b/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsPhanCon.png new file mode 100644 index 000000000..91e2936e8 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/banner/actuallyadditionsPhanCon.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsBook.png b/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsBook.png new file mode 100644 index 000000000..8704547c4 Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsBook.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsDrill.png b/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsDrill.png new file mode 100644 index 000000000..f7743ffea Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsDrill.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsLeafBlo.png b/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsLeafBlo.png new file mode 100644 index 000000000..7b52a66ae Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsLeafBlo.png differ diff --git a/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsPhanCon.png b/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsPhanCon.png new file mode 100644 index 000000000..151dd0ade Binary files /dev/null and b/src/main/resources/assets/minecraft/textures/entity/shield/actuallyadditionsPhanCon.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index c54d0a9cf..8d8a54262 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,6 +1,6 @@ [ { - "modid": "ActuallyAdditions", + "modid": "actuallyadditions", "name": "Actually Additions", "description": "Do you want Automation? Wireless Transport? Better Machines? A cup o' Coffee? Chests? Better Hoppers? Leaf Blowers? Faster Growth? Plants? Well, Actually Additions has all that and a lot more!", "version": "${version}", diff --git a/update/changelog.md b/update/changelog.md index 8524c2366..b50d5e3e8 100644 --- a/update/changelog.md +++ b/update/changelog.md @@ -1,3 +1,201 @@ +#1.10.2-r47 +* Updated to 1.10.2. Could've guessed that by the name. +* Fixed a crash when searching the booklet +* Made empty buckets be able to get pulled out of the coal generator +* Added biomass and biocoal made from canola seeds and made canola edible +* Added medium and large storage crates + +# 1.10-r46 +* Updated to 1.10. Obviously. +* Made booklet actually save its bookmarks +* Remove custom fake player in favor of vanilla one +* Made fluid collector not input and output fluids all the time causing infinite loops + +# 1.9.4-r45 +* Added Tesla Energy System support to all RF-using and generating blocks +* Added video introduction page to booklet +* Added Laser Wrench mode switch. Just right-click with one at some point. +* Fixed XP Solidifier values being off +* Made crafter on a stick not randomly create stacks with no items in them +* Changed the way fluids and RF are handled making them both pull AND push to other tiles +* Removed Rarmor integration (for now!) as the mod is in the process of being re-written +* Made Reconstructor and Display stand not keep their items on the client when having them removed +* Updated banner in the mods screen~ +* Fixed nullpointer caused by getting capabilities with a null facing sometimes +* Made the Miner less carry-around-y. + +# 1.9.4-r44 +* Fixed a weird crash with Item Laser Relays. +* Fixed drills sometimes crashing when breaking certain blocks. +###### I am extremely sorry for the amount of updates in the last couple of days. This is hopefully the last one for a few weeks as the most significant bugs with the new features have now been fixed. I hope this doesn't diminish your liking for the mod in any way. + +# 1.9.4-r43 +### This update increases the performance of some blocks by a significant bit. If you are experiencing lag in a world with many Laser Relays, install this. +* More proper laser relay bounding boxes +* Significantly upped the performance of Item Laser Relays +* Increased ESD performance +* Made Energy Laser Relays less performance intensive +* Changed energy handling system a bit, should be the same in-game +* Made coal and oil generator not randomly appear to be on even though they're not + +# 1.9.4-r42 +### The shut-up-about-EnderIO Update. +* Changed ESD to allow higher numbers of slots and have no limit on input values so that you can basically make it pull from infintely many slots if the amount of slots present is able to change +* Only add things to smart item laser relay whitelist when they aren't on it already +* Re-added IFluidHandler since apparently everyone's moaning about EnderIO not having updated and my stuff breaking because of it or something like that. + +# 1.9.4-r41 +* Changed white- and blacklists of laser relays and ESDs to be for putting and pulling. Check them in your world, they might all not work like you want them to anymore! +* Added item filters +* Made ESD's whitelist be a blacklist by default when placing it down +* Added display stand +* Made leaf blower work on display stand +* Made potion rings work on display stand +* Re-add invtweaks support for the storage crate +* Fixed a crash when having phantom liquifaces connected to a non-tileentity +* Made player interface display the amount of RF it has stored +* Made damage source from Reconstructor display properly +* Added a config option to only display the laser relay particles when holding a laser wrench +* Fixed miner sometimes crashing when placed next to certain blocks + +# 1.9.4-r40 +* Fixed a bug with Laser Relays sometimes randomly disconnecting on chunk load +### You only need this when you have been or are wanting to use Laser Relays of any sort. This version fixes a hideous bug that caused them to randomly disconnect when re-loading chunks for a reason that makes absolutely no sense to me and the people I asked. If you want to know what the bug was, [click here](https://github.com/Ellpeck/ActuallyAdditions/commit/d46bb306d87da57ea180afcd9e6cc00fc96637ef). Again, sorry for the amount of updates, this has just been driving me crazy. + +# 1.9.4-r39 +* Updated to forge's new fluid transfer and storage system +* Removed a possible memory leak source with world saving +* Added Player Interface +* Fixed configs resetting randomly sometimes +### Sorry for this amount of updates. I've been trying to fix a lot of bugs with them, but it just hasn't been going the way I wanted. + +# 1.9.4-r38 +* Added custom system to save world data because the Minecraft one always failed on me. +* Note: This WILL disconnect all of your laser relays, sorry. Just reconnect them again. If you find any bugs with the new system (Laser Relay connections), leave an issue on github. Thanks! + +# 1.9.4-r37 +* Fixed rendering bug with Greenhouse Glass +* Removed unfinished feature tags in booklet +* Added water bowl +* Fixed block breaking effects playing just the sound (drill, leaf blower etc.) +* Fixed aiots not having four times the durability of their base tools +* Made compost only acceppt the current recipe's amount of items +* Made shovels make path blocks instead of farmland +* Changed world data save system to hopefully make laser relays not disconnect on certain occasions but only on the server and I don't get why this is happening +* Made tools be held like tools and not like normal items in third person +* Fixed a syncing bug with tileentities on world join + +# 1.9.4-r36 +* Added a config option to print all of the booklet's text into a file on startup +* Made booklet words and characters not be more than they should be because everything was being done twice +* Added view online button to booklet +* Fixed a bug with some other mods causing NullPointerExceptions in ActAdd TileEntities +* Fixed ArmorMaterial (sokratis12GR) +* Removed ModelResourceLocation on server making servers not crash on startup anymore. + +# 1.9.4-r35 +* Added lush caves that spawn randomly in the overworld. Turn them off or change their spawn rate in the config if you don't like them. +* Changed some world data mechanics. Might break some Laser Relay Networks. Sorry about that, just reconnect them. +* Fixed a massive bug with TileEntities not syncing properly when re-entering unloaded chunks +* Re-added booklet stand. Is now a thing on the wall. But works the same. + +# 1.9.4-r34 +### MINECRAFT 1.9.4!! +* Made special drops dependent on the looting level you have +* Made drop chances for wings, solid xp and cobweb more common +* Added spawner changer to creative tab +* API Version 14 because of multiple changes + +# 1.9-r33 +* Made Growth Ring performance better +* Centered page number in booklet +* Made placers be able to place anything again +* Made Item Laser Relays that have a whitelist have more priority than those who don't +* Fixed a massive console spam issue of Whitelisted Item Laser Relays trying to send client update packages FROM the client +* The laser relay has less particles again now +* Added custom banner patterns +* Added custom shield patterns +* Remove InvTweaks integration +* Added a smart whitelist button to the whitelisted laser relay that automatically adds items in adjacent inventories to the filter +* Lots of API restructuring +* Bump API Version to 12 +* Put circles in front of the booklet entry buttons on the front page because it looks nice + +# 1.9-r32 +* Added Spawner Changer +* Added Spawner Shards +* Added Item Laser Relay Networks with Item Laser Relays, Advanced Item Laser Relays and Item Interfaces +* Fixed booklet sometimes not typing a letter into the search box +* Fixed sounds not working on servers +* Use universal buckets instead of custom ones +* Replaced bucket slots in GUIs with right click functionality +* Re-implemented village structures. No Villagers though. +* Fixed a bug with fluid placers replacing fluids in front of them +* Added max damage display to the advanced tooltip + +# 1.9-r31 +* Added Phantom Redstoneface +* Changed storage crate upgrade recipe because it was clashing with Storage Drawers +* Added Reconstruction Module as Rarmor integration. Install Canitzp's Rarmor to find out what it is and does. +* Added Patreon button to the booklet because I wantz all teh moneyz + +# 1.9-r30 +* Fixed mcmod.info being broken +* Fixed OreDictionary creating empty entries when searching for names +* Fixed laser relays making no particles when the less particle setting is on +* Made HarvestDropsEvents be posted when mining blocks automatically +* Rename itemPotionRIng to itemPotionRing so that it has a proper model and texture +* Rename itemCrystalLightBLue to itemCrystalLightBlue so that it has a proper model and texture +* Added the ender start which is a new crafting ingredient +* Made double furnace and double crusher use the double amount of energy when smelting/crushing two items at once +* Added a default extra whitelist config option for the Item Repairer +* Made directional breaker need energy in pulse mode. Duh. +* Added InvWrapper Capabilities so that inventories work with pipes from mods like NeoTech + +# 1.9-r29 +* Fixed blocks dropping twice when broken with the drill +* Made drill GUI be openable again (how did I even miss this?) +* Made XP drops from drill dependent on the forge event +* Fixed and re-implemented sounds +* Raised the amount of particles from the laser relay +* Made the knife not give extra attack damage in armor slots +* Fixed a couple of bugs with items that need to be held in hand not working +* Fixed all item models so that they're not held like shields +* Made slab placing a bit more proper +* Fixed most bounding boxes +* Fixed equipment slots in energizer and enervator being off +* Fixed fluid placer not being able to place +* Made fake player not persist into different worlds causing coordinate issues +* Fixed all block models of custom rendered stuff + +# 1.9-r28 +* Fixed a crash when trying to fill a bucket +##### Because it was pretty much gamebreaking. + +# 1.9-r27 +### Yes, really. This update pushes the mod's version to 1.9, however it probably is very unstable. There is a few notable bugs and things missing, but I wanted to push this version because a lot of people wanted it. +## If you encounter any bugs, please post them on the Issue Tracker here: https://github.com/Ellpeck/ActuallyAdditions/issues +* Updated the Mod to 1.9 +* Did some other stuff +* All of the items, when holding them in your hands, also look like shields right now. I couldn't be bothered to change the JSONs yet, so you'll have to live with it. + +# 1.8.9-r26 +### This update was done by canitzp. Thanks for helping me out <3 +* Made the knife not repairable +* Changed download link for updates to redirect to the proper page +* added click area to JEI for easy recipe access +* Set ESD incomplete. Because it's incomplete. +* Haphazardly revert implementation of new item system for ESD as it was completely broken +* Updated to official RF API. +* Fixed tool JSONs +* Reactivated Atomic Reconstructor Lens Renderer +* Rewrote Smiley Cloud renderer +* Hopefully fixed a minor miner bug (ha ha ha) +* Fixed Double Plant crash +* Fixed JEI booklet page rendering +* New compost rendering +* [API] Removed lens registry + # 1.8.9-r25 * Fixed assets derping because of wrong capitalization * Ignore NBT Tags of Energy items in JEI diff --git a/update/updateVersion.txt b/update/updateVersion.txt deleted file mode 100644 index 7d90cb450..000000000 --- a/update/updateVersion.txt +++ /dev/null @@ -1,2 +0,0 @@ -1.7.10-r21 -(This is a fallback for old versions which don't have the new update checker. Don't change.) \ No newline at end of file diff --git a/update/updateVersions.properties b/update/updateVersions.properties index f00da2961..debd0c5be 100644 --- a/update/updateVersions.properties +++ b/update/updateVersions.properties @@ -1,2 +1,6 @@ 1.7.10=21 -1.8.9=25 +1.8.9=26 +1.9=33 +1.9.4=45 +1.10=46 +1.10.2=47 \ No newline at end of file