Compare commits

...
34 Commits
Author SHA1 Message Date
Martin Robertz 98860ee317 pdate 2025-10-01 21:52:34 +02:00
Nikolay S.andglowredman 5ca552ce88 Great Renaming, Part 1 - Blocks & deobfParams (#106)
Co-authored-by: glowredman <35727266+glowredman@users.noreply.github.com>
2025-10-01 21:46:12 +02:00
Martin Robertz db1ad3a768 update 2025-10-01 17:29:01 +02:00
koolkrafter5 c047644908 Merge #104 to master (#105) 2025-09-29 20:17:26 +02:00
DarkShadow44andMartin Robertz 33be87e896 Fix reach ring (#95)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
2025-09-28 11:59:11 +00:00
Nikolay S.andMartin Robertz 7c42710a1a Activate Generic Injection (#100)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
2025-09-28 13:54:57 +02:00
Martin Robertz e4b5b2c2ff update 2025-09-26 17:50:27 +02:00
ABKQPOandghostflyby 8350bd9dc7 Modify line-breaking method for rendering fonts in PageText (#101)
Co-authored-by: ghostflyby <ghostflyby+git@outlook.com>
2025-09-26 20:09:24 +08:00
Martin Robertz 5dc4882038 update 2025-09-07 19:41:11 +02:00
koolkrafter5 9404223f53 Revert "Prevent overenchanting (#98)" (#99) 2025-09-07 05:19:10 -04:00
Caedis 9157df8e3b Prevent overenchanting (#98) 2025-09-06 12:59:34 -04:00
Martin Robertz 143b8286d8 update 2025-09-03 16:57:01 +02:00
sisyphussy 825758d639 Add Botania Multiblocks to StructureLib (#93) 2025-09-03 15:09:02 +02:00
Martin Robertz f4f7485a12 update 2025-08-28 09:22:54 +02:00
LewisSaber a0d7b4dde8 fix unbreaking not affecting instant repair (#94) 2025-08-27 15:44:43 +02:00
Matthew Bentham d3f4b99d23 Fix WAILA not displaying quartz pillar block name when placed on its side (#97) 2025-08-22 04:07:24 -05:00
boubou19andAlexdoru 96521a399b Restore methods so other addons work again (#92)
Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com>
2025-07-22 15:22:13 +00:00
koolkrafter5 c5ceef1a78 Improve Null Checking for Petal Apothecary (#91) 2025-07-20 19:40:03 +02:00
boubou19andAlexdoru c72988e435 Faster load (#89)
Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com>
2025-07-17 05:10:15 +02:00
koolkrafter5 26a8bd6a26 Fix achievement text typo (#88) 2025-07-13 05:36:01 +02:00
Martin Robertz 23e4f6760d update 2025-06-08 11:55:28 +02:00
Nikolay S. 72da2272d1 Fix the rest of the lang file mistakes in Botania (#84) 2025-06-06 20:57:18 +00:00
Nikolay S. 36deb60855 Add missing equals sign (#83) 2025-06-06 20:31:18 +00:00
Maya c387a30be8 update 2025-05-25 19:38:30 -06:00
brandynandMaya bcf96ed130 Add configurable F3 Debug (#78)
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
2025-05-25 19:38:18 -06:00
Martin Robertz 7b767d52c5 update 2025-05-16 18:32:31 +02:00
Caedis e812d33caf Replace Baubles with Baubles Expanded (#81) 2025-05-13 19:09:33 -05:00
Martin Robertz a0ba2f2d6a update 2025-03-04 10:08:44 +01:00
miozune 10f4e05d37 Update build (#76) 2025-03-02 15:54:17 +00:00
Dream Master 2b586edcf2 update 2025-01-15 12:01:33 +01:00
Shadow1590Shadow1590Maya
36dfeea862 Reach ring rewrite (#67)
Co-authored-by: Shadow1590 <>
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
2025-01-14 23:50:10 -06:00
glowredmanandMartin Robertz e8fb04df37 Small Cleanup (#68)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
2025-01-13 00:13:56 -06:00
Martin Robertz f5a21fe41e update 2024-12-27 10:06:52 +01:00
5b81cbe85e backported item filter for Rannuncarpus (#60)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
2024-12-26 22:29:04 -06:00
358 changed files with 3321 additions and 2668 deletions

No files matched your search

-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env bash
RUNDIR="run"
CRASH="crash-reports"
SERVERLOG="server.log"
if [[ -d $RUNDIR/$CRASH ]]; then
echo "Crash reports detected:"
cat $RUNDIR/$CRASH/crash*.txt
exit 1
fi
if grep --quiet "Fatal errors were detected" $SERVERLOG; then
echo "Fatal errors detected:"
cat server.log
exit 1
fi
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
echo "Server force stopped:"
cat server.log
exit 1
fi
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
echo "Server didn't finish startup:"
cat server.log
exit 1
fi
echo "No crash reports detected"
exit 0
+7 -1
View File
@@ -26,7 +26,13 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
src/main/resources/mixins.*([!.]).json
*.bat
*.DS_Store
!gradlew.bat
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
+10 -11
View File
@@ -1,19 +1,18 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:Baubles:1.0.4:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.15:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.0.5-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.5.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api') {transitive=false}
api('com.github.GTNewHorizons:GTNHLib:0.6.0:dev')
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.0-GTNH:dev')
api('com.github.GTNewHorizons:GTNHLib:0.7.0:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.44:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.6.8:dev') {transitive=false}
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.0-GTNH:dev')
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.33:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.0-GTNH:api') {transitive=false}
compileOnly('curse.maven:cofh-lib-220333:2388748')
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev')
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.23:dev")
}
+5 -14
View File
@@ -14,7 +14,7 @@ modId = Botania
modGroup = vazkii.botania
# Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
# When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
@@ -41,11 +41,11 @@ developmentEnvironmentUserName = Developer
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = false
enableModernJavaSyntax = true
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = false
enableGenericInjection = true
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
@@ -55,22 +55,13 @@ generateGradleTokenClass = vazkii.botania.common.Tags
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile =
# replaceGradleTokenInFile =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
@@ -151,7 +142,7 @@ modrinthProjectId =
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+2 -3
View File
@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
-20
View File
@@ -1,22 +1,2 @@
repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
maven {
name 'ic2'
url 'https://maven.ic2.player.to/'
url 'https://maven2.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
}
maven {
url 'https://jitpack.io'
}
}
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
}
@@ -60,37 +60,37 @@ import cpw.mods.fml.common.Loader;
public final class BotaniaAPI {
private static List<LexiconCategory> categories = new ArrayList<LexiconCategory>();
private static List<LexiconEntry> allEntries = new ArrayList<LexiconEntry>();
private static final List<LexiconCategory> categories = new ArrayList<>();
private static final List<LexiconEntry> allEntries = new ArrayList<>();
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<String, KnowledgeType>();
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<>();
public static Map<String, Brew> brewMap = new LinkedHashMap<String, Brew>();
public static Map<String, Brew> brewMap = new LinkedHashMap<>();
public static List<String> disposableBlocks = new ArrayList<String>();
public static List<String> semiDisposableBlocks = new ArrayList<String>();
public static List<String> disposableBlocks = new ArrayList<>();
public static List<String> semiDisposableBlocks = new ArrayList<>();
public static List<RecipePetals> petalRecipes = new ArrayList<RecipePetals>();
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<RecipePureDaisy>();
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<RecipeManaInfusion>();
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<RecipeRuneAltar>();
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<RecipeElvenTrade>();
public static List<RecipeBrew> brewRecipes = new ArrayList<RecipeBrew>();
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<RecipeManaInfusion>();
public static List<RecipePetals> petalRecipes = new ArrayList<>();
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<>();
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<>();
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<>();
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<>();
public static List<RecipeBrew> brewRecipes = new ArrayList<>();
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<>();
private static BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.<String, Class<? extends SubTileEntity>> create();
private static Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<Class<? extends SubTileEntity>, SubTileSignature>();
public static Set<String> subtilesForCreativeMenu = new LinkedHashSet();
public static Map<String, String> subTileMods = new HashMap<String, String>();
public static BiMap<String, String> miniFlowers = HashBiMap.<String, String> create();
private static final BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.create();
private static final Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<>();
public static Set<String> subtilesForCreativeMenu = new LinkedHashSet<>();
public static Map<String, String> subTileMods = new HashMap<>();
public static BiMap<String, String> miniFlowers = HashBiMap.create();
public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();
public static Map<String, Integer> oreWeightsNether = new HashMap<String, Integer>();
public static Map<Item, Block> seeds = new HashMap();
public static Set<Item> looniumBlacklist = new LinkedHashSet<Item>();
public static Set<Block> paintableBlocks = new LinkedHashSet<Block>();
public static Set<String> magnetBlacklist = new LinkedHashSet<String>();
public static Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<Class<? extends Entity>>();
public static Map<String, Integer> oreWeights = new HashMap<>();
public static Map<String, Integer> oreWeightsNether = new HashMap<>();
public static Map<Item, Block> seeds = new HashMap<>();
public static Set<Item> looniumBlacklist = new LinkedHashSet<>();
public static Set<Block> paintableBlocks = new LinkedHashSet<>();
public static Set<String> magnetBlacklist = new LinkedHashSet<>();
public static Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18);
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
@@ -108,7 +108,7 @@ public final class BotaniaAPI {
public static KnowledgeType basicKnowledge;
public static KnowledgeType elvenKnowledge;
// This is here for completeness sake, but you shouldn't use it
// This is here for completeness’s sake, but you shouldn't use it
public static KnowledgeType relicKnowledge;
// All of these categories are initialized during botania's PreInit stage.
@@ -290,14 +290,14 @@ public final class BotaniaAPI {
return fallbackBrew;
}
/*
/**
* Registers a Block as disposable using its Ore Dictionary Name.
*/
public static void registerDisposableBlock(String oreDictName) {
disposableBlocks.add(oreDictName);
}
/*
/**
* Registers a Block as semi disposable using its Ore Dictionary Name.
* This means it will not be trashed when sneaking.
*/
@@ -313,19 +313,19 @@ public final class BotaniaAPI {
return paintable;
}
/*
/**
* Blacklists an Entity from being affected by the Rod of the Shaded Mesa.
* Pass in the class for the Entity, e.g. EntityCow.class
*/
public static void blacklistEntityFromGravityRod(Class entity) {
public static void blacklistEntityFromGravityRod(Class<? extends Entity> entity) {
gravityRodBlacklist.add(entity);
}
/*
/**
* Checks if the provided Entity is contained in the Blacklist.
* Pass in the class for the Entity, e.g. entity.getClass()
*/
public static boolean isEntityBlacklistedFromGravityRod(Class entity) {
public static boolean isEntityBlacklistedFromGravityRod(Class<? extends Entity> entity) {
return gravityRodBlacklist.contains(entity);
}
@@ -476,7 +476,7 @@ public final class BotaniaAPI {
/**
* Registers a Brew Recipe (for the Botanical Brewery).
* @param brew The brew in to be set in this recipe.
* @inputs The items used in the recipe, no more than 6.
* @param inputs The items used in the recipe, no more than 6.
*/
public static RecipeBrew registerBrewRecipe(Brew brew, Object... inputs) {
RecipeBrew recipe = new RecipeBrew(brew, inputs);
@@ -592,7 +592,7 @@ public final class BotaniaAPI {
* https://gist.github.com/Vazkii/9493322
*/
public static void addOreWeightNether(String ore, int weight) {
if(ore.contains("Nether") && OreDictionary.getOres(ore.replace("Nether", "")).size() == 0)
if(ore.contains("Nether") && OreDictionary.getOres(ore.replace("Nether", "")).isEmpty())
return;
oreWeightsNether.put(ore, weight);
@@ -634,7 +634,7 @@ public final class BotaniaAPI {
*/
public static List<IRecipe> getLatestAddedRecipes(int x) {
List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
List<IRecipe> newList = new ArrayList();
List<IRecipe> newList = new ArrayList<>();
for(int i = x - 1; i >= 0; i--)
newList.add(list.get(list.size() - 1 - i));
@@ -42,7 +42,7 @@ public class Brew {
this.name = name;
this.color = color;
this.cost = cost;
this.effects = new ArrayList(Arrays.asList(effects));
this.effects = new ArrayList<>(Arrays.asList(effects));
}
/**
@@ -29,9 +29,9 @@ import vazkii.botania.api.BotaniaAPI;
public final class CorporeaHelper {
private static final List<IInventory> empty = Collections.unmodifiableList(new ArrayList());
private static final WeakHashMap<List<ICorporeaSpark>, List<IInventory>> cachedNetworks = new WeakHashMap();
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<ICorporeaAutoCompleteController>();
private static final List<IInventory> empty = Collections.unmodifiableList(new ArrayList<>());
private static final WeakHashMap<List<ICorporeaSpark>, List<IInventory>> cachedNetworks = new WeakHashMap<>();
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<>();
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
@@ -64,7 +64,7 @@ public final class CorporeaHelper {
return cache;
}
List<IInventory> inventories = new ArrayList();
List<IInventory> inventories = new ArrayList<>();
if(network != null)
for(ICorporeaSpark otherSpark : network)
if(otherSpark != null) {
@@ -125,7 +125,7 @@ public final class CorporeaHelper {
* called instead if the context for this exists to avoid having to get the value again.
*/
public static Map<IInventory, Integer> getInventoriesWithItemInNetwork(ItemStack stack,List<IInventory> inventories, boolean checkNBT) {
Map<IInventory, Integer> countMap = new HashMap<IInventory, Integer>();
Map<IInventory, Integer> countMap = new HashMap<>();
List<IWrappedInventory> wrappedInventories = BotaniaAPI.internalHandler.wrapInventory(inventories);
for (IWrappedInventory inv : wrappedInventories) {
CorporeaRequest request = new CorporeaRequest(stack, checkNBT, -1);
@@ -166,14 +166,14 @@ public final class CorporeaHelper {
* purposes of counting huge amounts.
*/
public static List<ItemStack> requestItem(Object matcher, int itemCount, ICorporeaSpark spark, boolean checkNBT, boolean doit) {
List<ItemStack> stacks = new ArrayList<ItemStack>();
List<ItemStack> stacks = new ArrayList<>();
CorporeaRequestEvent event = new CorporeaRequestEvent(matcher, itemCount, spark, checkNBT, doit);
if(MinecraftForge.EVENT_BUS.post(event))
return stacks;
List<IInventory> inventories = getInventoriesOnNetwork(spark);
List<IWrappedInventory> inventoriesW = BotaniaAPI.internalHandler.wrapInventory(inventories);
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap<ICorporeaInterceptor, ICorporeaSpark>();
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap<>();
CorporeaRequest request = new CorporeaRequest(matcher, checkNBT, itemCount);
for(IWrappedInventory inv : inventoriesW) {
@@ -39,12 +39,12 @@ public class DummyManaNetwork implements IManaNetwork {
@Override
public List<TileSignature> getAllCollectorsInWorld(World world) {
return new ArrayList();
return new ArrayList<>();
}
@Override
public List<TileSignature> getAllPoolsInWorld(World world) {
return new ArrayList();
return new ArrayList<>();
}
}
@@ -20,7 +20,7 @@ public final class VanillaPacketDispatcher {
public static void dispatchTEToNearbyPlayers(TileEntity tile) {
World world = tile.getWorldObj();
List players = world.playerEntities;
List<?> players = world.playerEntities;
for(Object player : players)
if(player instanceof EntityPlayerMP) {
EntityPlayerMP mp = (EntityPlayerMP) player;
@@ -20,7 +20,7 @@ public class LexiconCategory implements Comparable<LexiconCategory> {
private static int count = 0;
public final String unlocalizedName;
public final List<LexiconEntry> entries = new ArrayList<LexiconEntry>();
public final List<LexiconEntry> entries = new ArrayList<>();
private final int sortingId;
private ResourceLocation icon;
private int priority = 5;
@@ -27,11 +27,11 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
private KnowledgeType type = BotaniaAPI.basicKnowledge;
public List<LexiconPage> pages = new ArrayList<LexiconPage>();
public List<LexiconPage> pages = new ArrayList<>();
private boolean priority = false;
private ItemStack icon = null;
private List<ItemStack> extraDisplayedRecipes = new ArrayList();
private List<ItemStack> extraDisplayedRecipes = new ArrayList<>();
/**
* @param unlocalizedName The unlocalized name of this entry. This will be localized by the client display.
@@ -126,12 +126,12 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
}
public List<ItemStack> getDisplayedRecipes() {
ArrayList<ItemStack> list = new ArrayList();
ArrayList<ItemStack> list = new ArrayList<>();
for(LexiconPage page : pages) {
List<ItemStack> l = page.getDisplayedRecipes();
if(l != null) {
ArrayList<ItemStack> itemsAddedThisPage = new ArrayList();
ArrayList<ItemStack> itemsAddedThisPage = new ArrayList<>();
for(ItemStack s : l) {
addItem: {
@@ -23,7 +23,7 @@ import vazkii.botania.api.mana.IManaItem;
*/
public final class LexiconRecipeMappings {
private static Map<String, EntryData> mappings = new HashMap();
private static Map<String, EntryData> mappings = new HashMap<>();
/**
* Maps the given stack to the given page of the entry.
@@ -23,7 +23,7 @@ import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
*/
public interface IMultiblockRenderHook {
public static Map<Block, IMultiblockRenderHook> renderHooks = new HashMap();
public static Map<Block, IMultiblockRenderHook> renderHooks = new HashMap<>();
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks, MultiblockComponent comp, float alpha);
@@ -15,10 +15,15 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import cpw.mods.fml.common.FMLLog;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import org.apache.logging.log4j.Level;
import vazkii.botania.api.lexicon.multiblock.compat.MultiblockCompatRegistry;
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
import vazkii.botania.common.Botania;
/**
* This class describes a Mutiblock object. It's used to display a
@@ -27,22 +32,26 @@ import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
*/
public class Multiblock {
public List<MultiblockComponent> components = new ArrayList();
public List<ItemStack> materials = new ArrayList();
public List<MultiblockComponent> components = new ArrayList<>();
public List<ItemStack> materials = new ArrayList<>();
public int minX, minY, minZ, maxX, maxY, maxZ, offX, offY, offZ;
public HashMap<List<Integer>, MultiblockComponent> locationCache = new HashMap<List<Integer>, MultiblockComponent>();
public HashMap<List<Integer>, MultiblockComponent> locationCache = new HashMap<>();
/**
* Adds a multiblock component to this multiblock. The component's x y z
* coords should be pivoted to the center of the structure.
*/
public void addComponent(MultiblockComponent component) {
if(getComponentForLocation(component.relPos.posX, component.relPos.posY, component.relPos.posZ) != null)
throw new IllegalArgumentException("Location in multiblock already occupied");
ChunkCoordinates pos = component.relPos;
if(getComponentForLocation(pos.posX, pos.posY, pos.posZ) != null) {
MultiblockComponent comp = getComponentForLocation(pos.posX, pos.posY, pos.posZ);
throw new IllegalArgumentException(
"Location in multiblock {x=" + pos.posX + " y=" + pos.posY + " z=" + pos.posZ + "} already occupied by block " + comp.getBlock().getLocalizedName());
}
components.add(component);
changeAxisForNewComponent(component.relPos.posX, component.relPos.posY, component.relPos.posZ);
changeAxisForNewComponent(pos.posX, pos.posY, pos.posZ);
calculateCostForNewComponent(component);
addComponentToLocationCache(component);
}
@@ -138,6 +147,28 @@ public class Multiblock {
return blocks;
}
public <T extends TileEntity> MultiblockSet makeSetRegisterStructure(
Class<T> controllerTileClass, Block controllerBlock, MultiblockComponent... extra
) {
registerStructure(controllerTileClass, controllerBlock, extra);
return makeSet();
}
public <T extends TileEntity> void registerStructure(
Class<T> controllerTileClass, Block controllerBlock, MultiblockComponent... extra
) {
if (Botania.structureLibLoaded) {
try {
MultiblockCompatRegistry.registerMultiblock(
this, controllerTileClass, controllerBlock, extra
);
} catch (Exception e) {
e.printStackTrace();
FMLLog.log(Level.ERROR, "Failed to load a Botania Multiblock into StructureLib.");
}
}
}
/**
* Makes a MultiblockSet from this Multiblock and its rotations using
* createRotations().
@@ -176,7 +207,7 @@ public class Multiblock {
pos.posX,
pos.posY,
pos.posZ
), comp);
), comp);
}
/**
@@ -0,0 +1,228 @@
package vazkii.botania.api.lexicon.multiblock.compat;
import com.gtnewhorizon.structurelib.alignment.constructable.IMultiblockInfoContainer;
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureUtility;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import vazkii.botania.api.lexicon.multiblock.Multiblock;
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Only gets loaded if StructureLib is present inside the Modpack
*/
public class MultiblockCompatRegistry {
public static <T extends TileEntity> void registerMultiblock(
Multiblock mb, Class<T> controllerTileClass,
Block controllerBlock,
MultiblockComponent... extra
) {
List<MultiblockComponent> components = mb.getComponents();
if (extra.length != 0) {
components = new ArrayList<>(components);
Collections.addAll(components, extra);
}
Map<Integer, RawStructureData> structureDataMap = new HashMap<>();
int min_x = Integer.MAX_VALUE, max_x = Integer.MIN_VALUE;
int min_y = Integer.MAX_VALUE, max_y = Integer.MIN_VALUE;
int min_z = Integer.MAX_VALUE, max_z = Integer.MIN_VALUE;
char ch = 'a';
for (MultiblockComponent component : components) {
int hash = getHash(component.getBlock(), component.getMeta());
ChunkCoordinates pos = component.getRelativePosition();
RawStructureData structureData = structureDataMap.get(hash);
if (structureData == null) {
List<ChunkCoordinates> coordinates = new ArrayList<>();
structureData = new RawStructureData(
coordinates,
component.getBlock(),
component.getMeta(),
ch++
);
structureDataMap.put(hash, structureData);
}
structureData.getPositions().add(pos);
min_x = Math.min(min_x, pos.posX); max_x = Math.max(max_x, pos.posX);
min_y = Math.min(min_y, pos.posY); max_y = Math.max(max_y, pos.posY);
min_z = Math.min(min_z, pos.posZ); max_z = Math.max(max_z, pos.posZ);
}
int x_size = max_x - min_x + 1;
int y_size = max_y - min_y + 1;
int z_size = max_z - min_z + 1;
//Data is saved in [z][y][x] format
String[][] stringData = new String[z_size][y_size];
char[] buffer = new char[x_size];
Arrays.fill(buffer, ' ');
//Since Strings and their content are immutable, this is fine.
String filledWithSpaces = new String(buffer);
for (int z = 0; z < z_size; z++) {
for (int y = 0; y < y_size; y++) {
stringData[z][y] = filledWithSpaces;
}
}
int controller_x = 0, controller_y = 0, controller_z = 0;
StringBuilder builder = new StringBuilder(x_size);
for (RawStructureData data : structureDataMap.values()) {
for (ChunkCoordinates pos : data.getPositions()) {
int x = pos.posX - min_x;
int z = pos.posZ - min_z;
//Data has to get flipped
int y = (stringData[z].length - 1) - (pos.posY - min_y);
if (data.getBlock() == controllerBlock) {
controller_x = x;
controller_y = y;
controller_z = z;
}
String s = stringData[z][y];
builder.append(s);
builder.setCharAt(x, data.getBlockIdentifier());
stringData[z][y] = builder.toString();
builder.setLength(0);
}
}
StructureDefinition.Builder<? super T> structureBuilder = IStructureDefinition.builder()
.addShape("main", stringData);
for (RawStructureData data : structureDataMap.values()) {
structureBuilder.addElement(
data.getBlockIdentifier(),
StructureUtility.ofBlock(
data.getBlock(),
data.getMetadata()
)
);
}
IMultiblockInfoContainer.registerTileClass(
controllerTileClass,
new BotaniaMultiblockInfoContainer<>(
structureBuilder.build(),
controller_x,
controller_y,
controller_z
)
);
}
private static int getHash(Block block, int metadata) {
return block.hashCode() * 31 + metadata;
}
private static class BotaniaMultiblockInfoContainer<T extends TileEntity> implements IMultiblockInfoContainer<T> {
private final IStructureDefinition<? super T> structure;
private final int x_offset, y_offset, z_offset;
public BotaniaMultiblockInfoContainer(
IStructureDefinition<? super T> structure,
int x_offset, int y_offset, int z_offset
) {
this.structure = structure;
this.x_offset = x_offset;
this.y_offset = y_offset;
this.z_offset = z_offset;
}
@Override
public void construct(ItemStack stackSize, boolean hintsOnly, T tileEntity, ExtendedFacing aSide) {
structure.buildOrHints(
tileEntity,
stackSize,
"main",
tileEntity.getWorldObj(),
noSideWay(aSide),
tileEntity.xCoord,
tileEntity.yCoord,
tileEntity.zCoord,
x_offset,
y_offset,
z_offset,
hintsOnly
);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudge, ISurvivalBuildEnvironment env, T tileEntity, ExtendedFacing aSide) {
return structure.survivalBuild(
tileEntity,
stackSize,
"main",
tileEntity.getWorldObj(),
noSideWay(aSide),
tileEntity.xCoord,
tileEntity.yCoord,
tileEntity.zCoord,
x_offset,
y_offset,
z_offset,
elementBudge,
env,
false
);
}
@Override
public String[] getDescription(ItemStack stackSize) {
return new String[0];
}
private static ExtendedFacing noSideWay(ExtendedFacing aSide) {
return aSide.getDirection().offsetY != 0 ? ExtendedFacing.DEFAULT : aSide.getOppositeDirection();
}
}
private static class RawStructureData {
private final List<ChunkCoordinates> positions;
private final char identifier;
private final Block block;
private final int metadata;
public RawStructureData(List<ChunkCoordinates> positions, Block block, int metadata, char identifier) {
this.positions = positions;
this.identifier = identifier;
this.block = block;
this.metadata = metadata;
}
public Block getBlock() {
return block;
}
public int getMetadata() {
return metadata;
}
public List<ChunkCoordinates> getPositions() {
return positions;
}
public char getBlockIdentifier() {
return identifier;
}
}
}
@@ -39,7 +39,7 @@ public class MultiblockComponent {
}
public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, TileEntity tileEntity) {
this(relPos, block, meta, block.hasTileEntity() == (tileEntity != null), tileEntity);
this(relPos, block, meta, block.hasTileEntity(0) == (tileEntity != null), tileEntity);
}
public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, boolean doFancyRender, TileEntity tileEntity) {
@@ -23,10 +23,9 @@ public final class SparkHelper {
return SparkHelper.getEntitiesAround(ISparkEntity.class, world, x, y, z);
}
public static <T> List<T> getEntitiesAround(Class<? extends T> clazz, World world, double x, double y, double z) {
public static <T> List<T> getEntitiesAround(Class<T> clazz, World world, double x, double y, double z) {
int r = SPARK_SCAN_RANGE;
List<T> entities = world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r));
return entities;
return world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r));
}
}
@@ -28,7 +28,7 @@ public class RecipeBrew {
public RecipeBrew(Brew brew, Object... inputs) {
this.brew = brew;
List<Object> inputsToSet = new ArrayList();
List<Object> inputsToSet = new ArrayList<>();
for(Object obj : inputs) {
if(obj instanceof String || obj instanceof ItemStack)
inputsToSet.add(obj);
@@ -39,7 +39,7 @@ public class RecipeBrew {
}
public boolean matches(IInventory inv) {
List<Object> inputsMissing = new ArrayList(inputs);
List<Object> inputsMissing = new ArrayList<>(inputs);
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
@@ -92,7 +92,7 @@ public class RecipeBrew {
}
public List<Object> getInputs() {
return new ArrayList(inputs);
return new ArrayList<>(inputs);
}
public Brew getBrew() {
@@ -14,7 +14,7 @@ public class RecipeElvenTrade {
public RecipeElvenTrade(ItemStack output, Object... inputs) {
this.output = output;
List<Object> inputsToSet = new ArrayList();
List<Object> inputsToSet = new ArrayList<>();
for(Object obj : inputs) {
if(obj instanceof String || obj instanceof ItemStack)
inputsToSet.add(obj);
@@ -25,8 +25,8 @@ public class RecipeElvenTrade {
}
public boolean matches(List<ItemStack> stacks, boolean remove) {
List<Object> inputsMissing = new ArrayList(inputs);
List<ItemStack> stacksToRemove = new ArrayList();
List<Object> inputsMissing = new ArrayList<>(inputs);
List<ItemStack> stacksToRemove = new ArrayList<>();
for(ItemStack stack : stacks) {
if(stack == null) {
@@ -80,7 +80,7 @@ public class RecipeElvenTrade {
}
public List<Object> getInputs() {
return new ArrayList(inputs);
return new ArrayList<>(inputs);
}
public ItemStack getOutput() {
@@ -25,7 +25,7 @@ public class RecipePetals {
public RecipePetals(ItemStack output, Object... inputs) {
this.output = output;
List<Object> inputsToSet = new ArrayList();
List<Object> inputsToSet = new ArrayList<>();
for(Object obj : inputs) {
if(obj instanceof String || obj instanceof ItemStack)
inputsToSet.add(obj);
@@ -36,7 +36,7 @@ public class RecipePetals {
}
public boolean matches(IInventory inv) {
List<Object> inputsMissing = new ArrayList(inputs);
List<Object> inputsMissing = new ArrayList<>(inputs);
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
@@ -86,7 +86,7 @@ public class RecipePetals {
}
public List<Object> getInputs() {
return new ArrayList(inputs);
return new ArrayList<>(inputs);
}
public ItemStack getOutput() {
@@ -21,7 +21,7 @@ public class WikiHooks {
private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "http://ftb.gamepedia.com/%s");
private static final Map<String, IWikiProvider> modWikis = new HashMap();
private static final Map<String, IWikiProvider> modWikis = new HashMap<>();
public static IWikiProvider getWikiFor(Block block) {
UniqueIdentifier mod = GameRegistry.findUniqueIdentifierFor(block);
@@ -25,12 +25,12 @@ import vazkii.botania.common.lib.LibBlockNames;
public final class ModChallenges {
public static final EnumMap<EnumChallengeLevel, List<Challenge>> challenges = new EnumMap(EnumChallengeLevel.class);
public static final HashMap<String, Challenge> challengeLookup = new HashMap();
public static final EnumMap<EnumChallengeLevel, List<Challenge>> challenges = new EnumMap<>(EnumChallengeLevel.class);
public static final HashMap<String, Challenge> challengeLookup = new HashMap<>();
public static void init() {
for(EnumChallengeLevel level : EnumChallengeLevel.class.getEnumConstants())
challenges.put(level, new ArrayList());
challenges.put(level, new ArrayList<>());
addChallenge(EnumChallengeLevel.EASY, "flowerFarm", new ItemStack(ModBlocks.flower, 1, 6));
addChallenge(EnumChallengeLevel.EASY, "recordFarm", new ItemStack(Items.record_13));
@@ -78,7 +78,7 @@ public class ClientTickHandler {
if(player != null) {
ItemStack stack = player.getCurrentEquippedItem();
if(stack != null && stack.getItem() instanceof ItemTwigWand) {
List<TileSignature> list = new ArrayList(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld));
List<TileSignature> list = new ArrayList<>(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld));
for(TileSignature sig : list) {
if(!sig.remoteWorld)
continue;
@@ -68,7 +68,7 @@ public final class ContributorFancinessHandler {
}
public static void load(Properties props) {
flowerMap = new HashMap();
flowerMap = new HashMap<>();
for(String key : props.stringPropertyNames()) {
String value = props.getProperty(key);
@@ -39,10 +39,10 @@ public class CorporeaAutoCompleteHandler {
boolean isAutoCompleted = false;
String originalString = "";
List<CompletionData> completions = new ArrayList<CompletionData>();
List<CompletionData> completions = new ArrayList<>();
int position;
static TreeSet<String> itemNames = new TreeSet<String>(
static TreeSet<String> itemNames = new TreeSet<>(
new Comparator<String>() {
@Override
public int compare(String arg0, String arg1) {
@@ -55,7 +55,7 @@ public class CorporeaAutoCompleteHandler {
public static void updateItemList() {
itemNames.clear();
Iterator<Item> iterator = Item.itemRegistry.iterator();
ArrayList<ItemStack> curList = new ArrayList<ItemStack>();
ArrayList<ItemStack> curList = new ArrayList<>();
while(iterator.hasNext()) {
Item item = iterator.next();
@@ -144,9 +144,9 @@ public class CorporeaAutoCompleteHandler {
private ArrayList<CompletionData> getNames(String prefix) {
String s = prefix.trim();
if(s.isEmpty())
return new ArrayList();
return new ArrayList<>();
TreeSet<CompletionData> result = new TreeSet<CompletionData>();
TreeSet<CompletionData> result = new TreeSet<>();
String[] words = s.split(" ");
int i = words.length - 1;
String curPrefix = words[i];
@@ -156,11 +156,11 @@ public class CorporeaAutoCompleteHandler {
if(i >= 0)
curPrefix = words[i] + " " + curPrefix;
}
return new ArrayList<CompletionData>(result);
return new ArrayList<>(result);
}
private List<CompletionData> getNamesStartingWith(String prefix) {
ArrayList<CompletionData> result = new ArrayList<CompletionData>();
ArrayList<CompletionData> result = new ArrayList<>();
int length = prefix.length();
SortedSet<String> after = itemNames.tailSet(prefix);
for(String str : after) {
@@ -35,7 +35,7 @@ public final class DebugHandler {
@SubscribeEvent
public void onDrawDebugText(RenderGameOverlayEvent.Text event) {
World world = Minecraft.getMinecraft().theWorld;
if(Minecraft.getMinecraft().gameSettings.showDebugInfo) {
if(Minecraft.getMinecraft().gameSettings.showDebugInfo && ConfigHandler.showF3Debug) {
event.left.add(null);
String version = LibMisc.VERSION;
if(version.contains("GRADLE"))
@@ -128,7 +128,7 @@ public final class HUDHandler {
renderCrystalCubeHUD(event.resolution, (TileCorporeaCrystalCube) tile);
}
if(!TileCorporeaIndex.getInputHandler().getNearbyIndexes(mc.thePlayer).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) {
if(!TileCorporeaIndex.InputHandler.getNearbyIndexes(mc.thePlayer).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) {
profiler.startSection("nearIndex");
renderNearIndexDisplay(event.resolution);
profiler.endSection();
@@ -174,11 +174,11 @@ public class LightningHandler {
public static class LightningBolt {
public ArrayList<Segment> segments = new ArrayList<Segment>();
public ArrayList<Segment> segments = new ArrayList<>();
public Vector3 start;
public Vector3 end;
ChunkCoordinates target;
HashMap<Integer, Integer> splitparents = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> splitparents = new HashMap<>();
public double length;
public int numsegments0;
@@ -195,7 +195,7 @@ public class LightningHandler {
private World world;
private Entity source;
public static ConcurrentLinkedQueue<LightningBolt> boltlist = new ConcurrentLinkedQueue<LightningBolt>();
public static ConcurrentLinkedQueue<LightningBolt> boltlist = new ConcurrentLinkedQueue<>();
public float speed = 1.5F;
public static final int fadetime = 20;
@@ -347,7 +347,7 @@ public class LightningHandler {
return;
ArrayList<Segment> oldsegments = segments;
segments = new ArrayList<Segment>();
segments = new ArrayList<>();
Segment prev = null;
@@ -428,7 +428,7 @@ public class LightningHandler {
}
private void calculateCollisionAndDiffs() {
HashMap<Integer, Integer> lastactivesegment = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> lastactivesegment = new HashMap<>();
Collections.sort(segments, new SegmentSorter());
@@ -29,7 +29,7 @@ import vazkii.botania.common.item.ModItems;
public final class RedStringRenderer {
public static final Queue<TileRedString> redStringTiles = new ArrayDeque();
public static final Queue<TileRedString> redStringTiles = new ArrayDeque<>();
static float sizeAlpha = 0F;
public static void renderAll() {
@@ -64,7 +64,7 @@ public final class TooltipAdditionDisplayHandler {
try {
tooltip = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips);
} catch(Exception e) {
tooltip = new ArrayList();
tooltip = new ArrayList<>();
}
int width = 0;
for(String s : tooltip)
@@ -124,7 +124,6 @@ import vazkii.botania.client.render.tile.RenderTileTerraPlate;
import vazkii.botania.client.render.tile.RenderTileTeruTeruBozu;
import vazkii.botania.client.render.tile.RenderTileTinyPotato;
import vazkii.botania.client.render.world.SkyblockRenderEvents;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileAlfPortal;
import vazkii.botania.common.block.tile.TileAltar;
@@ -384,7 +383,8 @@ public class ClientProxy extends CommonProxy {
super.setExtraReach(entity, reach);
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
if(entity == player) {
// Player object might have changed, need to check the UUID.
if(entity.worldObj.isRemote && entity.getUniqueID().equals(player.getUniqueID())) {
if(!(mc.playerController instanceof IExtendedPlayerController)) {
GameType type = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.CURRENT_GAME_TYPE);
NetHandlerPlayClient net = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.NET_CLIENT_HANDLER);
@@ -31,8 +31,8 @@ public class FXSparkle extends EntityFX {
public static final ResourceLocation particles = new ResourceLocation(LibResources.MISC_PARTICLES);
public static Queue<FXSparkle> queuedRenders = new ArrayDeque();
public static Queue<FXSparkle> queuedCorruptRenders = new ArrayDeque();
public static Queue<FXSparkle> queuedRenders = new ArrayDeque<>();
public static Queue<FXSparkle> queuedCorruptRenders = new ArrayDeque<>();
// Queue values
float f;
@@ -31,8 +31,8 @@ public class FXWisp extends EntityFX {
public static final ResourceLocation particles = new ResourceLocation(LibResources.MISC_WISP_LARGE);
public static Queue<FXWisp> queuedRenders = new ArrayDeque();
public static Queue<FXWisp> queuedDepthIgnoringRenders = new ArrayDeque();
public static Queue<FXWisp> queuedRenders = new ArrayDeque<>();
public static Queue<FXWisp> queuedDepthIgnoringRenders = new ArrayDeque<>();
// Queue values
float f;
@@ -20,7 +20,7 @@ import cpw.mods.fml.client.config.GuiConfig;
public class GuiBotaniaConfig extends GuiConfig {
public GuiBotaniaConfig(GuiScreen parentScreen) {
super(parentScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), LibMisc.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
super(parentScreen, new ConfigElement<>(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), LibMisc.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
}
}
@@ -27,7 +27,7 @@ public class SlotLocked extends Slot {
}
@Override
public boolean isItemValid(ItemStack p_75214_1_) {
public boolean isItemValid(ItemStack stack) {
return false;
}
@@ -51,15 +51,15 @@ public abstract class ContainerMagicPlantBag extends Container {
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack itemstack = null;
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
Slot slot = (Slot)inventorySlots.get(index);
if(slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if(p_82846_2_ < 16) {
if(index < 16) {
if(!mergeItemStack(itemstack1, 16, 52, true))
return null;
} else {
@@ -78,7 +78,7 @@ public abstract class ContainerMagicPlantBag extends Container {
if(itemstack1.stackSize == itemstack.stackSize)
return null;
slot.onPickupFromSlot(p_82846_1_, itemstack1);
slot.onPickupFromSlot(player, itemstack1);
}
return itemstack;
@@ -24,14 +24,14 @@ public abstract class GuiMagicPlantBag extends GuiContainer {
}
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
String s = StatCollector.translateToLocal(getLocalizedNameKey());
fontRendererObj.drawString(s, xSize / 2 - fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(texture);
int k = (width - xSize) / 2;
@@ -55,7 +55,7 @@ public abstract class GuiMagicPlantBag extends GuiContainer {
}
@Override
protected boolean checkHotbarKeys(int p_146983_1_) {
protected boolean checkHotbarKeys(int keyCode) {
return false;
}
@@ -5,7 +5,6 @@ import net.minecraft.block.Block;
import net.minecraft.inventory.Slot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import vazkii.botania.common.block.ModBlocks;
public abstract class SlotMagicPlant extends Slot {
@@ -89,16 +89,16 @@ public class ContainerBaubleBox extends Container {
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack itemstack = null;
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
Slot slot = (Slot)inventorySlots.get(index);
if(slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
System.out.println(p_82846_2_ + " " + itemstack);
if(p_82846_2_ < 28) {
System.out.println(index + " " + itemstack);
if(index < 28) {
if(!mergeItemStack(itemstack1, 28, 64, true))
return null;
} else {
@@ -113,7 +113,7 @@ public class ContainerBaubleBox extends Container {
if(itemstack1.stackSize == itemstack.stackSize)
return null;
slot.onPickupFromSlot(p_82846_1_, itemstack1);
slot.onPickupFromSlot(player, itemstack1);
}
return itemstack;
@@ -29,12 +29,12 @@ public class GuiBaubleBox extends InventoryEffectRenderer {
}
@Override
protected boolean checkHotbarKeys(int p_146983_1_) {
protected boolean checkHotbarKeys(int keyCode) {
return false;
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(texture);
int k = (width - xSize) / 2;
@@ -47,7 +47,7 @@ public class GuiBaubleBox extends InventoryEffectRenderer {
drawTexturedModalRect(k+slot.xDisplayPosition, l+slot.yDisplayPosition, 200, 0, 16, 16);
}
GuiInventory.func_147046_a(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - p_146976_2_, guiTop + 45 - 30 - p_146976_3_, mc.thePlayer);
GuiInventory.func_147046_a(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - mouseX, guiTop + 45 - 30 - mouseY, mc.thePlayer);
}
}
@@ -57,7 +57,7 @@ public class ContainerCraftingHalo extends ContainerWorkbench {
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}
@@ -28,13 +28,13 @@ public class GuiCraftingHalo extends GuiContainer {
}
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752);
fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(craftingTableGuiTextures);
int k = (width - xSize) / 2;
@@ -70,7 +70,7 @@ public class GuiLexicon extends GuiScreen {
public static GuiLexicon currentOpenLexicon = new GuiLexicon();
public static ItemStack stackUsed;
public static HashMap<String, String> notes = new HashMap();
public static HashMap<String, String> notes = new HashMap<>();
private static final String TAG_TYPE = "type";
@@ -79,11 +79,11 @@ public class GuiLexicon extends GuiScreen {
public static final int BOOKMARK_START = 1337;
public static final int NOTES_BUTTON_ID = 1336; // random button tho
public static final int MAX_BOOKMARK_COUNT = 8;
public static List<GuiLexicon> bookmarks = new ArrayList();
public static List<String> bookmarkKeys = new ArrayList();
public static List<GuiLexicon> bookmarks = new ArrayList<>();
public static List<String> bookmarkKeys = new ArrayList<>();
boolean bookmarksNeedPopulation = false;
public static Queue<LexiconEntry> tutorial = new ArrayDeque();
public static Queue<LexiconEntry> tutorial = new ArrayDeque<>();
public static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_LEXICON);
public static final ResourceLocation textureToff = new ResourceLocation(LibResources.GUI_TOFF);
@@ -130,7 +130,7 @@ public class GuiLexicon extends GuiScreen {
}
public void onInitGui() {
allCategories = new ArrayList(BotaniaAPI.getAllCategories());
allCategories = new ArrayList<>(BotaniaAPI.getAllCategories());
Collections.sort(allCategories);
lastTime = ClientTickHandler.ticksInGame;
@@ -284,7 +284,7 @@ public class GuiLexicon extends GuiScreen {
boolean unicode = fontRendererObj.getUnicodeFlag();
fontRendererObj.setUnicodeFlag(true);
PageText.renderText(x + 5, y - 3, 92, 120, 0, noteDisplay);
PageText.renderText(x + 5, y - 3, 92, 0, noteDisplay);
fontRendererObj.setUnicodeFlag(unicode);
}
@@ -483,7 +483,7 @@ public class GuiLexicon extends GuiScreen {
}
void populateBookmarks() {
List remove = new ArrayList();
List<GuiButton> remove = new ArrayList<>();
List<GuiButton> buttons = buttonList;
for(GuiButton button : buttons)
if(button.id >= BOOKMARK_START)
@@ -20,7 +20,7 @@ import vazkii.botania.api.lexicon.LexiconEntry;
public class GuiLexiconHistory extends GuiLexiconIndex {
public static List<LexiconEntry> history = new ArrayList();
public static List<LexiconEntry> history = new ArrayList<>();
public GuiLexiconHistory() {
super(null);
@@ -57,7 +57,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
LexiconEntry currentEntry;
float infoTime;
List<LexiconEntry> entriesToDisplay = new ArrayList();
List<LexiconEntry> entriesToDisplay = new ArrayList<>();
public GuiLexiconIndex() {
parent = new GuiLexicon();
@@ -37,7 +37,7 @@ public class GuiButtonAchievement extends GuiButtonLexicon {
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 109 : 98, 191, 11, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.YELLOW + StatCollector.translateToLocal("botaniamisc.achievements"));
int tooltipY = (tooltip.size() - 1) * 10;
@@ -24,7 +24,7 @@ public class GuiButtonBookmark extends GuiButtonLexicon {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(field_146123_n);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
if(displayString.equals("+"))
tooltip.add(StatCollector.translateToLocal("botaniamisc.clickToAdd"));
else {
@@ -52,7 +52,7 @@ public class GuiButtonChallengeIcon extends GuiButtonLexicon {
}
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal(challenge.unlocalizedName));
int tooltipY = (tooltip.size() - 1) * 10;
@@ -33,7 +33,7 @@ public class GuiButtonChallengeInfo extends GuiButtonLexicon {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(field_146123_n);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(StatCollector.translateToLocal("botaniamisc.challengeInfo"));
int tooltipY = (tooltip.size() + 1) * 5;
@@ -37,7 +37,7 @@ public class GuiButtonChallenges extends GuiButtonLexicon {
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 131 : 120, 180, 11, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.YELLOW + StatCollector.translateToLocal("botaniamisc.challenges"));
int tooltipY = (tooltip.size() - 1) * 10;
@@ -46,7 +46,7 @@ public class GuiButtonDoot extends GuiButtonLexicon {
GL11.glDisable(GL11.GL_LIGHTING);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.LIGHT_PURPLE + "Happy Birthday Vazkii!");
tooltip.add(EnumChatFormatting.GRAY + "doot doot");
@@ -34,7 +34,7 @@ public class GuiButtonHistory extends GuiButtonLexicon {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(field_146123_n);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(StatCollector.translateToLocal("botaniamisc.historyLong"));
tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.historyDesc"));
@@ -17,13 +17,13 @@ import net.minecraft.util.ResourceLocation;
public class GuiButtonLexicon extends GuiButton {
public GuiButtonLexicon(int p_i1021_1_, int p_i1021_2_, int p_i1021_3_, int p_i1021_4_, int p_i1021_5_, String p_i1021_6_) {
super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_);
public GuiButtonLexicon(int stateName, int id, int p_i1021_3_, int p_i1021_4_, int p_i1021_5_, String p_i1021_6_) {
super(stateName, id, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_);
}
@Override
public void func_146113_a(SoundHandler p_146113_1_) {
p_146113_1_.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("botania:lexiconPage"), 1.0F));
public void func_146113_a(SoundHandler soundHandlerIn) {
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("botania:lexiconPage"), 1.0F));
}
}
@@ -40,7 +40,7 @@ public class GuiButtonNotes extends GuiButtonLexicon {
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 130 : 120, 191, 10, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
if(GuiLexicon.notesEnabled)
tooltip.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("botaniamisc.hideNotes"));
else {
@@ -37,7 +37,7 @@ public class GuiButtonOptions extends GuiButtonLexicon {
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 109 : 98, 180, 11, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
for(int i = 0; i < 3; i++)
tooltip.add((i == 0 ? EnumChatFormatting.RED : EnumChatFormatting.GRAY) + StatCollector.translateToLocal("botaniamisc.lexiconOptions" + i));
@@ -44,7 +44,7 @@ public class GuiButtonUpdateWarning extends GuiButtonLexicon {
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, red ? 153 : 142, 180, 11, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
String version = PersistentVariableHelper.lastBotaniaVersion;
for(int i = 0; i < 6; i++) {
tooltip.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocal("botaniamisc.changes" + i), version).replaceAll("&", "\u00a7"));
@@ -16,7 +16,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import codechicken.nei.LayoutManager;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.guihook.GuiContainerManager;
@@ -39,11 +38,11 @@ public class NEIInputHandler implements IContainerInputHandler {
if(stack != null && stack.getItem() != null) {
int count = 1;
int max = stack.getMaxStackSize();
if(gui.isShiftKeyDown()) {
if(GuiScreen.isShiftKeyDown()) {
count = max;
if(gui.isCtrlKeyDown())
if(GuiScreen.isCtrlKeyDown())
count /= 4;
} else if(gui.isCtrlKeyDown())
} else if(GuiScreen.isCtrlKeyDown())
count = max / 2;
if(count > 0) {
@@ -25,7 +25,7 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler {
public class CachedBreweryRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public int mana;
@@ -28,7 +28,7 @@ public class RecipeHandlerElvenTrade extends TemplateRecipeHandler {
public class CachedElvenTradeRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public CachedElvenTradeRecipe(RecipeElvenTrade recipe) {
@@ -19,7 +19,7 @@ public class RecipeHandlerFloatingFlowers extends TemplateRecipeHandler {
public class CachedFloatingFlowerRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public CachedFloatingFlowerRecipe(ItemStack floatingFlower, ItemStack specialFlower, ItemStack output) {
@@ -18,36 +18,19 @@ import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.oredict.OreDictionary;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.KnowledgeType;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerManaPool.CachedManaPoolRecipe;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.render.tile.RenderTilePool;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TilePool;
import vazkii.botania.common.core.helper.InventoryHelper;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lexicon.page.PageRecipe;
import vazkii.botania.common.lexicon.page.PageText;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
public class RecipeHandlerLexicaBotania extends TemplateRecipeHandler {
@@ -55,7 +38,7 @@ public class RecipeHandlerLexicaBotania extends TemplateRecipeHandler {
public LexiconEntry entry;
public PositionedStack item;
public List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
public List<PositionedStack> otherStacks = new ArrayList<>();
public CachedLexicaBotaniaRecipe(ItemStack stack, LexiconEntry entry) {
otherStacks.add(new PositionedStack(new ItemStack(ModItems.lexicon), 51, 5));
@@ -2,7 +2,6 @@ package vazkii.botania.client.integration.nei.recipe;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.minecraft.client.Minecraft;
@@ -23,7 +22,6 @@ import vazkii.botania.client.render.tile.RenderTilePool;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TilePool;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import vazkii.botania.common.core.helper.ItemNBTHelper;
@@ -32,9 +30,9 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler {
public class CachedManaPoolRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
public List<PositionedStack> otherStacks = new ArrayList<>();
public int mana;
public CachedManaPoolRecipe(RecipeManaInfusion recipe) {
@@ -25,7 +25,7 @@ public class RecipeHandlerPetalApothecary extends TemplateRecipeHandler {
public class CachedPetalApothecaryRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public CachedPetalApothecaryRecipe(RecipePetals recipe, boolean addCenterItem) {
@@ -2,7 +2,6 @@ package vazkii.botania.client.integration.nei.recipe;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.minecraft.block.Block;
@@ -19,7 +18,6 @@ import vazkii.botania.common.core.helper.ItemNBTHelper;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lib.LibBlockNames;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
@@ -27,9 +25,9 @@ public class RecipeHandlerPureDaisy extends TemplateRecipeHandler {
public class CachedPureDaisyRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
public List<PositionedStack> otherStacks = new ArrayList<>();
public CachedPureDaisyRecipe(RecipePureDaisy recipe) {
if(recipe == null)
@@ -17,10 +17,10 @@ import net.minecraft.client.model.ModelRenderer;
public class ModelPump extends ModelBase{
private ArrayList<ModelRenderer> parts = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> parts = new ArrayList<>();
private ArrayList<ModelRenderer> innerRing = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> outerRing = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> innerRing = new ArrayList<>();
private ArrayList<ModelRenderer> outerRing = new ArrayList<>();
public ModelPump() {
textureWidth = 64;
@@ -46,7 +46,7 @@ public class RenderTileSkullOverride extends TileEntitySkullRenderer {
if(gaia)
resourcelocation = minecraft.thePlayer.getLocationSkin();
else if(gameProfile != null) {
Map map = minecraft.func_152342_ad().func_152788_a(gameProfile);
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = minecraft.func_152342_ad().func_152788_a(gameProfile);
if (map.containsKey(MinecraftProfileTexture.Type.SKIN)) {
resourcelocation = minecraft.func_152342_ad().func_152792_a((MinecraftProfileTexture)map.get(MinecraftProfileTexture.Type.SKIN), MinecraftProfileTexture.Type.SKIN);
@@ -16,7 +16,6 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.world.WorldTypeSkyblock;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import java.util.stream.IntStream;
public final class SkyblockRenderEvents {
@@ -52,7 +52,6 @@ public class SkyblockSkyRenderer extends IRenderHandler {
return;
int glSkyList = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST);
int glSkyList2 = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.GL_SKY_LIST2); // Horizon line. We don't have it here
int starGLCallList = ReflectionHelper.getPrivateValue(RenderGlobal.class, mc.renderGlobal, LibObfuscation.STAR_GL_CALL_LIST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
@@ -181,8 +180,6 @@ public class SkyblockSkyRenderer extends IRenderHandler {
GL11.glRotatef(220F, 1F, 0F, 0F);
GL11.glColor4f(1F, 1F, 1F, a);
int angles = 90;
float s = 3F;
float m = 1F;
float y = 2F;
float y0 = 0F;
float uPer = 1F / 360F;
@@ -42,6 +42,7 @@ public class Botania {
public static boolean coloredLightsLoaded = false;
public static boolean etFuturumLoaded = false;
public static boolean storageDrawersLoaded = false;
public static boolean structureLibLoaded = false;
public static ILightHelper lightHelper;
@@ -61,6 +62,7 @@ public class Botania {
coloredLightsLoaded = Loader.isModLoaded("easycoloredlights");
etFuturumLoaded = Loader.isModLoaded("etfuturum");
storageDrawersLoaded = Loader.isModLoaded("StorageDrawers");
structureLibLoaded = Loader.isModLoaded("structurelib");
lightHelper = coloredLightsLoaded ? new LightHelperColored() : new LightHelperVanilla();
proxy.preInit(event);
@@ -5,8 +5,7 @@ import vazkii.botania.api.recipe.IFlowerComponent;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class CustomBotaniaAPI {
public static Map<Item, IFlowerComponent> extraFlowerComponents = new HashMap<Item, IFlowerComponent>();
public static Map<Item, IFlowerComponent> extraFlowerComponents = new HashMap<>();
}
@@ -21,7 +21,7 @@ import vazkii.botania.api.item.IRelic;
public class AchievementMod extends Achievement {
public static List<Achievement> achievements = new ArrayList();
public static List<Achievement> achievements = new ArrayList<>();
public AchievementMod(String name, int x, int y, ItemStack icon, Achievement parent) {
super("achievement.botania:" + name, "botania:" + name, x, y, icon, parent);
@@ -14,7 +14,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -27,7 +26,7 @@ import vazkii.botania.common.block.tile.TileAlfPortal;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockAlfPortal extends BlockModContainer implements IWandable, ILexiconable {
public class BlockAlfPortal extends BlockModContainer<TileAlfPortal> implements IWandable, ILexiconable {
IIcon iconOff, iconOn;
public static IIcon portalTex;
@@ -40,10 +39,10 @@ public class BlockAlfPortal extends BlockModContainer implements IWandable, ILex
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
iconOff = IconHelper.forBlock(par1IconRegister, this, 0);
iconOn = IconHelper.forBlock(par1IconRegister, this, 1);
portalTex = IconHelper.forBlock(par1IconRegister, this, "Inside");
public void registerBlockIcons(IIconRegister register) {
iconOff = IconHelper.forBlock(register, this, 0);
iconOn = IconHelper.forBlock(register, this, 1);
portalTex = IconHelper.forBlock(register, this, "Inside");
}
@Override
@@ -52,7 +51,7 @@ public class BlockAlfPortal extends BlockModContainer implements IWandable, ILex
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileAlfPortal createNewTileEntity(World world, int meta) {
return new TileAlfPortal();
}
@@ -56,9 +56,9 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
}
@Override
public Block setBlockName(String par1Str) {
GameRegistry.registerBlock(this, ItemCubeWithMetadataAndName.class, par1Str);
return super.setBlockName(par1Str);
public Block setBlockName(String name) {
GameRegistry.registerBlock(this, ItemCubeWithMetadataAndName.class, name);
return super.setBlockName(name);
}
@Override
@@ -67,16 +67,16 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
for(int i = 0; i < 6; i++)
list.add(new ItemStack(item, 1, i));
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
icons = new IIcon[SUBTYPES * 2];
for(int i = 0; i < icons.length; i++)
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
icons[i] = IconHelper.forBlock(register, this, i);
}
@Override
@@ -102,8 +102,8 @@ public class BlockAltGrass extends BlockMod implements ILexiconable {
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_);
public Item getItemDropped(int meta, Random random, int fortune) {
return Blocks.dirt.getItemDropped(0, random, fortune);
}
@Override
@@ -48,7 +48,7 @@ import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.registry.GameRegistry;
public class BlockAltar extends BlockModContainer implements ILexiconable {
public class BlockAltar extends BlockModContainer<TileAltar> implements ILexiconable {
Random random;
@@ -65,7 +65,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@@ -75,22 +75,23 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
}
@Override
public Block setBlockName(String par1Str) {
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
return super.setBlockName(par1Str);
public Block setBlockName(String name) {
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, name);
return super.setBlockName(name);
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
for(int i = 0; i < 9; i++)
list.add(new ItemStack(item, 1, i));
}
@Override
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
if(par5Entity instanceof EntityItem) {
TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4);
if(tile.collideEntityItem((EntityItem) par5Entity))
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity collider) {
if(collider instanceof EntityItem) {
TileAltar tile = (TileAltar) world.getTileEntity(x, y, z);
if (tile == null) return;
if(tile.collideEntityItem((EntityItem) collider))
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(tile);
}
}
@@ -98,64 +99,66 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z) {
TileAltar tile = (TileAltar) world.getTileEntity(x, y, z);
if (tile == null) return 0;
return tile.hasLava ? 15 : 0;
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
ItemStack stack = par5EntityPlayer.getCurrentEquippedItem();
TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4);
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) {
ItemStack stack = player.getCurrentEquippedItem();
TileAltar tile = (TileAltar) world.getTileEntity(x, y, z);
if (tile == null) return false;
if(par5EntityPlayer.isSneaking()) {
if(player.isSneaking()) {
for(int i = tile.getSizeInventory() - 1; i >= 0; i--) {
ItemStack stackAt = tile.getStackInSlot(i);
if(stackAt != null) {
ItemStack copy = stackAt.copy();
if(!par5EntityPlayer.inventory.addItemStackToInventory(copy))
par5EntityPlayer.dropPlayerItemWithRandomChoice(copy, false);
if(!player.inventory.addItemStackToInventory(copy))
player.dropPlayerItemWithRandomChoice(copy, false);
tile.setInventorySlotContents(i, null);
par1World.func_147453_f(par2, par3, par4, this);
world.func_147453_f(x, y, z, this);
break;
}
}
} else if(tile.isEmpty() && tile.hasWater && stack == null)
tile.trySetLastRecipe(par5EntityPlayer);
tile.trySetLastRecipe(player);
else {
if(stack != null && (isValidWaterContainer(stack) || stack.getItem() == ModItems.waterRod && ManaItemHandler.requestManaExact(stack, par5EntityPlayer, ItemWaterRod.COST, false))) {
if(stack != null && (isValidWaterContainer(stack) || stack.getItem() == ModItems.waterRod && ManaItemHandler.requestManaExact(stack, player, ItemWaterRod.COST, false))) {
if(!tile.hasWater) {
if(stack.getItem() == ModItems.waterRod)
ManaItemHandler.requestManaExact(stack, par5EntityPlayer, ItemWaterRod.COST, true);
else if(!par5EntityPlayer.capabilities.isCreativeMode)
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, getContainer(stack));
ManaItemHandler.requestManaExact(stack, player, ItemWaterRod.COST, true);
else if(!player.capabilities.isCreativeMode)
player.inventory.setInventorySlotContents(player.inventory.currentItem, getContainer(stack));
tile.setWater(true);
par1World.func_147453_f(par2, par3, par4, this);
world.func_147453_f(x, y, z, this);
}
return true;
} else if(stack != null && stack.getItem() == Items.lava_bucket) {
if(!par5EntityPlayer.capabilities.isCreativeMode)
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, getContainer(stack));
if(!player.capabilities.isCreativeMode)
player.inventory.setInventorySlotContents(player.inventory.currentItem, getContainer(stack));
tile.setLava(true);
tile.setWater(false);
par1World.func_147453_f(par2, par3, par4, this);
world.func_147453_f(x, y, z, this);
return true;
} else if(stack != null && stack.getItem() == Items.bucket && (tile.hasWater || tile.hasLava) && !Botania.gardenOfGlassLoaded) {
ItemStack bucket = tile.hasLava ? new ItemStack(Items.lava_bucket) : new ItemStack(Items.water_bucket);
if(stack.stackSize == 1)
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, bucket);
player.inventory.setInventorySlotContents(player.inventory.currentItem, bucket);
else {
if(!par5EntityPlayer.inventory.addItemStackToInventory(bucket))
par5EntityPlayer.dropPlayerItemWithRandomChoice(bucket, false);
if(!player.inventory.addItemStackToInventory(bucket))
player.dropPlayerItemWithRandomChoice(bucket, false);
stack.stackSize--;
}
if(tile.hasLava)
tile.setLava(false);
else tile.setWater(false);
par1World.func_147453_f(par2, par3, par4, this);
world.func_147453_f(x, y, z, this);
return true;
}
@@ -168,8 +171,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
public void fillWithRain(World world, int x, int y, int z) {
if(world.rand.nextInt(20) == 1) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileAltar) {
TileAltar altar = (TileAltar) tile;
if(tile instanceof TileAltar altar) {
if(!altar.hasLava && !altar.hasWater)
altar.setWater(true);
world.func_147453_f(x, y, z, this);
@@ -210,8 +212,8 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
}
@Override
public IIcon getIcon(int par1, int par2) {
return par2 == 0 ? Blocks.cobblestone.getIcon(par1, par2) : ModFluffBlocks.biomeStoneA.getIcon(par1, par2 + 7);
public IIcon getIcon(int side, int meta) {
return meta == 0 ? Blocks.cobblestone.getIcon(side, meta) : ModFluffBlocks.biomeStoneA.getIcon(side, meta + 7);
}
@Override
@@ -230,13 +232,13 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileAltar createNewTileEntity(World world, int meta) {
return new TileAltar();
}
@Override
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4);
public void breakBlock(World world, int x, int y, int z, Block blockBroken, int meta) {
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(x, y, z);
if (inv != null) {
for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) {
@@ -247,14 +249,14 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float)random.nextGaussian() * f3;
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
@@ -266,10 +268,10 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
}
}
par1World.func_147453_f(par2, par3, par4, par5);
world.func_147453_f(x, y, z, blockBroken);
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
super.breakBlock(world, x, y, z, blockBroken, meta);
}
@Override
@@ -278,8 +280,9 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
}
@Override
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
TileAltar altar = (TileAltar) par1World.getTileEntity(par2, par3, par4);
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
TileAltar altar = (TileAltar) world.getTileEntity(x, y, z);
if (altar == null) return 0;
return altar.hasWater ? 15 : 0;
}
@@ -21,7 +21,6 @@ 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.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
@@ -37,7 +36,7 @@ import vazkii.botania.common.block.tile.TileSimpleInventory;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockAvatar extends BlockModContainer implements ILexiconable {
public class BlockAvatar extends BlockModContainer<TileAvatar> implements ILexiconable {
private static final int[] META_ROTATIONS = new int[] { 2, 5, 3, 4 };
@@ -92,8 +91,8 @@ public class BlockAvatar extends BlockModContainer implements ILexiconable {
}
@Override
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4);
public void breakBlock(World world, int x, int y, int z, Block blockBroken, int meta) {
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(x, y, z);
if (inv != null) {
for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) {
@@ -104,14 +103,14 @@ public class BlockAvatar extends BlockModContainer implements ILexiconable {
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float)random.nextGaussian() * f3;
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
@@ -123,16 +122,16 @@ public class BlockAvatar extends BlockModContainer implements ILexiconable {
}
}
par1World.func_147453_f(par2, par3, par4, par5);
world.func_147453_f(x, y, z, blockBroken);
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
super.breakBlock(world, x, y, z, blockBroken, meta);
}
@Override
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, META_ROTATIONS[l], 2);
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) {
int l = MathHelper.floor_double(placer.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
world.setBlockMetadataWithNotify(x, y, z, META_ROTATIONS[l], 2);
}
@Override
@@ -141,7 +140,7 @@ public class BlockAvatar extends BlockModContainer implements ILexiconable {
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@@ -166,7 +165,7 @@ public class BlockAvatar extends BlockModContainer implements ILexiconable {
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileAvatar createNewTileEntity(World world, int meta) {
return new TileAvatar();
}
@@ -18,7 +18,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -35,7 +34,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBifrost extends BlockModContainer implements ILexiconable {
public class BlockBifrost extends BlockModContainer<TileBifrost> implements ILexiconable {
public BlockBifrost() {
super(Material.glass);
@@ -44,7 +43,7 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
setLightLevel(1F);
setBlockUnbreakable();
setStepSound(soundTypeGlass);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(new EventHandler());
}
@Override
@@ -62,15 +61,15 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
return new ItemStack(ModItems.rainbowRod);
}
public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
public boolean shouldSideBeRendered1(IBlockAccess worldIn, int x, int y, int z, int side) {
Block block = worldIn.getBlock(x, y, z);
return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
return block == this ? false : super.shouldSideBeRendered(worldIn, x, y, z, side);
}
@Override
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
return shouldSideBeRendered1(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_);
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
return shouldSideBeRendered1(worldIn, x, y, z, 1 - side);
}
@Override
@@ -83,7 +82,6 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
return 0;
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre event) {
if(event.map.getTextureType() == 0) {
@@ -95,12 +93,12 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileBifrost createNewTileEntity(World world, int meta) {
return new TileBifrost();
}
@@ -109,4 +107,11 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
return LexiconData.rainbowRod;
}
public class EventHandler {
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTexturesWrapper(TextureStitchEvent.Pre event) {
BlockBifrost.this.loadTextures(event);
}
}
}
@@ -44,7 +44,7 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@@ -53,15 +53,15 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
return false;
}
public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
public boolean shouldSideBeRendered1(IBlockAccess worldIn, int x, int y, int z, int side) {
Block block = worldIn.getBlock(x, y, z);
return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
return block == this ? false : super.shouldSideBeRendered(worldIn, x, y, z, side);
}
@Override
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
return shouldSideBeRendered1(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_);
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
return shouldSideBeRendered1(worldIn, x, y, z, 1 - side);
}
@Override
@@ -25,7 +25,7 @@ import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.tile.TileCacophonium;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockCacophonium extends BlockModContainer {
public class BlockCacophonium extends BlockModContainer<TileCacophonium> {
IIcon top;
@@ -72,14 +72,14 @@ public class BlockCacophonium extends BlockModContainer {
}
@Override
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
if(!par6EntityPlayer.capabilities.isCreativeMode)
dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
if(!player.capabilities.isCreativeMode)
dropBlockAsItem(world, x, y, z, meta, 0);
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> stacks = new ArrayList();
ArrayList<ItemStack> stacks = new ArrayList<>();
TileEntity tile = world.getTileEntity(x, y, z);
if(tile != null && tile instanceof TileCacophonium) {
@@ -93,7 +93,7 @@ public class BlockCacophonium extends BlockModContainer {
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileCacophonium createNewTileEntity(World world, int meta) {
return new TileCacophonium();
}
@@ -31,8 +31,8 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
static List<Integer> validRenderTypes = Arrays.asList(0, 31, 39);
protected BlockCamo(Material par2Material) {
super(par2Material);
protected BlockCamo(Material material) {
super(material);
}
@Override
@@ -59,12 +59,12 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileCamo) {
TileCamo camo = (TileCamo) tile;
ItemStack currentStack = par5EntityPlayer.getCurrentEquippedItem();
ItemStack currentStack = player.getCurrentEquippedItem();
if(currentStack == null)
currentStack = new ItemStack(Block.getBlockFromName("air"), 1, 0);
@@ -87,7 +87,7 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
if(doChange && currentStack.getItem() != null) {
int metadata = currentStack.getItemDamage();
if(block instanceof BlockDirectional) {
switch (par6) {
switch (side) {
case 0:
case 1:
break;
@@ -107,7 +107,7 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
}
camo.camo = Block.getBlockFromItem(currentStack.getItem());
camo.camoMeta = metadata;
par1World.markBlockForUpdate(par2,par3,par4);
world.markBlockForUpdate(x,y,z);
return true;
}
@@ -128,8 +128,8 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess par1World, int par2, int par3, int par4) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) {
TileEntity tile = worldIn.getTileEntity(x, y, z);
if(tile instanceof TileCamo) {
TileCamo camo = (TileCamo) tile;
Block block = camo.camo;
@@ -15,7 +15,6 @@ import java.util.ArrayList;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
@@ -23,7 +22,7 @@ import vazkii.botania.common.block.tile.TileCell;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockCell extends BlockModContainer implements ILexiconable {
public class BlockCell extends BlockModContainer<TileCell> implements ILexiconable {
public BlockCell() {
super(Material.gourd);
@@ -33,11 +32,11 @@ public class BlockCell extends BlockModContainer implements ILexiconable {
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList();
return new ArrayList<>();
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileCell createNewTileEntity(World world, int meta) {
return new TileCell();
}
@@ -18,7 +18,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
@@ -28,7 +27,7 @@ import vazkii.botania.common.block.tile.TileCocoon;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockCocoon extends BlockModContainer implements ILexiconable {
public class BlockCocoon extends BlockModContainer<TileCocoon> implements ILexiconable {
protected BlockCocoon() {
super(Material.cloth);
@@ -42,12 +41,12 @@ public class BlockCocoon extends BlockModContainer implements ILexiconable {
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@Override
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
public IIcon getIcon(int side, int meta) {
return Blocks.web.getBlockTextureFromSide(0);
}
@@ -81,7 +80,7 @@ public class BlockCocoon extends BlockModContainer implements ILexiconable {
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList();
return new ArrayList<>();
}
@Override
@@ -90,7 +89,7 @@ public class BlockCocoon extends BlockModContainer implements ILexiconable {
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileCocoon createNewTileEntity(World world, int meta) {
return new TileCocoon();
}
@@ -45,7 +45,7 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
setHardness(0.6F);
setStepSound(soundTypeGrass);
setBlockName(LibBlockNames.ENCHANTED_SOIL);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(new EventHandler());
}
@Override
@@ -55,11 +55,10 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre event) {
if(event.map.getTextureType() == 0) {
@@ -80,8 +79,8 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return Blocks.dirt.getItemDropped(0, p_149650_2_, p_149650_3_);
public Item getItemDropped(int meta, Random random, int fortune) {
return Blocks.dirt.getItemDropped(0, random, fortune);
}
@Override
@@ -99,4 +98,11 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
return LexiconData.overgrowthSeed;
}
public class EventHandler{
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTexturesWrapper(TextureStitchEvent.Pre event) {
BlockEnchantedSoil.this.loadTextures(event);
}
}
}
@@ -14,7 +14,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -25,7 +24,7 @@ import vazkii.botania.common.block.tile.TileEnderEye;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockEnderEye extends BlockModContainer implements ILexiconable {
public class BlockEnderEye extends BlockModContainer<TileEnderEye> implements ILexiconable {
IIcon iconOff, iconOn;
@@ -38,9 +37,9 @@ public class BlockEnderEye extends BlockModContainer implements ILexiconable {
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
iconOff = IconHelper.forBlock(par1IconRegister, this, 0);
iconOn = IconHelper.forBlock(par1IconRegister, this, 1);
public void registerBlockIcons(IIconRegister register) {
iconOff = IconHelper.forBlock(register, this, 0);
iconOn = IconHelper.forBlock(register, this, 1);
}
@Override
@@ -59,7 +58,7 @@ public class BlockEnderEye extends BlockModContainer implements ILexiconable {
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileEnderEye createNewTileEntity(World world, int meta) {
return new TileEnderEye();
}
@@ -18,7 +18,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
@@ -26,7 +25,7 @@ import net.minecraft.world.World;
import vazkii.botania.common.block.tile.TileFakeAir;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockFakeAir extends BlockModContainer {
public class BlockFakeAir extends BlockModContainer<TileFakeAir> {
public BlockFakeAir() {
super(Material.air);
@@ -52,7 +51,7 @@ public class BlockFakeAir extends BlockModContainer {
}
@Override
public int tickRate(World p_149738_1_) {
public int tickRate(World world) {
return 4;
}
@@ -77,7 +76,7 @@ public class BlockFakeAir extends BlockModContainer {
}
@Override
public boolean canCollideCheck(int par1, boolean par2) {
public boolean canCollideCheck(int meta, boolean includeLiquid) {
return false;
}
@@ -87,17 +86,17 @@ public class BlockFakeAir extends BlockModContainer {
}
@Override
public boolean canDropFromExplosion(Explosion par1Explosion) {
public boolean canDropFromExplosion(Explosion explosion) {
return false;
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList(); // Empty List
return new ArrayList<>(); // Empty List
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return null;
}
@@ -107,7 +106,7 @@ public class BlockFakeAir extends BlockModContainer {
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileFakeAir createNewTileEntity(World world, int meta) {
return new TileFakeAir();
}
@@ -44,48 +44,47 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
setBlockName(LibBlockNames.FEL_PUMPKIN);
setHardness(1F);
setStepSound(soundTypeWood);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(new EventHandler());
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return p_149691_1_ == 1 ? top : p_149691_1_ == 0 ? top : p_149691_2_ == 2 && p_149691_1_ == 2 ? face : p_149691_2_ == 3 && p_149691_1_ == 5 ? face : p_149691_2_ == 0 && p_149691_1_ == 3 ? face : p_149691_2_ == 1 && p_149691_1_ == 4 ? face : blockIcon;
public IIcon getIcon(int side, int meta) {
return side == 1 ? top : side == 0 ? top : meta == 2 && side == 2 ? face : meta == 3 && side == 5 ? face : meta == 0 && side == 3 ? face : meta == 1 && side == 4 ? face : blockIcon;
}
@Override
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {
super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_);
public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(world, x, y, z);
if(!p_149726_1_.isRemote && p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_) == Blocks.iron_bars && p_149726_1_.getBlock(p_149726_2_, p_149726_3_ - 2, p_149726_4_) == Blocks.iron_bars) {
p_149726_1_.setBlock(p_149726_2_, p_149726_3_, p_149726_4_, getBlockById(0), 0, 2);
p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 1, p_149726_4_, getBlockById(0), 0, 2);
p_149726_1_.setBlock(p_149726_2_, p_149726_3_ - 2, p_149726_4_, getBlockById(0), 0, 2);
EntityBlaze blaze = new EntityBlaze(p_149726_1_);
blaze.setLocationAndAngles(p_149726_2_ + 0.5D, p_149726_3_ - 1.95D, p_149726_4_ + 0.5D, 0.0F, 0.0F);
if(!world.isRemote && world.getBlock(x, y - 1, z) == Blocks.iron_bars && world.getBlock(x, y - 2, z) == Blocks.iron_bars) {
world.setBlock(x, y, z, getBlockById(0), 0, 2);
world.setBlock(x, y - 1, z, getBlockById(0), 0, 2);
world.setBlock(x, y - 2, z, getBlockById(0), 0, 2);
EntityBlaze blaze = new EntityBlaze(world);
blaze.setLocationAndAngles(x + 0.5D, y - 1.95D, z + 0.5D, 0.0F, 0.0F);
blaze.getEntityData().setBoolean(TAG_FEL_SPAWNED, true);
p_149726_1_.spawnEntityInWorld(blaze);
p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_, p_149726_4_, getBlockById(0));
p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 1, p_149726_4_, getBlockById(0));
p_149726_1_.notifyBlockChange(p_149726_2_, p_149726_3_ - 2, p_149726_4_, getBlockById(0));
world.spawnEntityInWorld(blaze);
world.notifyBlockChange(x, y, z, getBlockById(0));
world.notifyBlockChange(x, y - 1, z, getBlockById(0));
world.notifyBlockChange(x, y - 2, z, getBlockById(0));
}
}
@Override
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 2.5D) & 3;
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, l, 2);
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) {
int l = MathHelper.floor_double(placer.rotationYaw * 4.0F / 360.0F + 2.5D) & 3;
world.setBlockMetadataWithNotify(x, y, z, l, 2);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) {
face = IconHelper.forBlock(p_149651_1_, this);
public void registerBlockIcons(IIconRegister register) {
face = IconHelper.forBlock(register, this);
top = Blocks.pumpkin.getIcon(0, 0);
blockIcon = Blocks.pumpkin.getIcon(2, 0);
}
@SubscribeEvent
public void onDrops(LivingDropsEvent event) {
if(event.entity instanceof EntityBlaze && event.entity.getEntityData().getBoolean(TAG_FEL_SPAWNED))
if(event.drops.isEmpty())
@@ -102,4 +101,10 @@ public class BlockFelPumpkin extends BlockMod implements ILexiconable {
return LexiconData.gardenOfGlass;
}
public class EventHandler {
@SubscribeEvent
public void onDropsWrapper(LivingDropsEvent event) {
BlockFelPumpkin.this.onDrops(event);
}
}
}
@@ -35,6 +35,7 @@ import vazkii.botania.api.wand.IWandHUD;
import vazkii.botania.api.wand.IWandable;
import vazkii.botania.common.block.decor.BlockFloatingFlower;
import vazkii.botania.common.block.tile.TileFloatingSpecialFlower;
import vazkii.botania.common.block.tile.TileMod;
import vazkii.botania.common.block.tile.TileSpecialFlower;
import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe;
import vazkii.botania.common.integration.coloredlights.LightHelper;
@@ -86,16 +87,16 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
// NO-OP
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
for(String s : BotaniaAPI.subtilesForCreativeMenu) {
par3List.add(ItemBlockSpecialFlower.ofType(new ItemStack(par1), s));
list.add(ItemBlockSpecialFlower.ofType(new ItemStack(item), s));
if(BotaniaAPI.miniFlowers.containsKey(s))
par3List.add(ItemBlockSpecialFlower.ofType(new ItemStack(par1), BotaniaAPI.miniFlowers.get(s)));
list.add(ItemBlockSpecialFlower.ofType(new ItemStack(item), BotaniaAPI.miniFlowers.get(s)));
}
}
@@ -106,16 +107,16 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
if(!par6EntityPlayer.capabilities.isCreativeMode) {
dropBlockAsItem(par1World, par2, par3, par4, par5, 0);
((TileSpecialFlower) par1World.getTileEntity(par2, par3, par4)).onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
if(!player.capabilities.isCreativeMode) {
dropBlockAsItem(world, x, y, z, meta, 0);
((TileSpecialFlower) world.getTileEntity(x, y, z)).onBlockHarvested(world, x, y, z, meta, player);
}
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> list = new ArrayList();
ArrayList<ItemStack> list = new ArrayList<>();
TileEntity tile = world.getTileEntity(x, y, z);
if(tile != null) {
@@ -128,10 +129,10 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false;
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventData) {
super.onBlockEventReceived(world, x, y, z, eventId, eventData);
TileEntity tileentity = world.getTileEntity(x, y, z);
return tileentity != null ? tileentity.receiveClientEvent(eventId, eventData) : false;
}
@Override
@@ -165,7 +166,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileMod createNewTileEntity(World world, int meta) {
return new TileFloatingSpecialFlower();
}
@@ -14,7 +14,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
@@ -24,7 +23,7 @@ import vazkii.botania.common.block.tile.TileForestEye;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockForestEye extends BlockModContainer implements ILexiconable {
public class BlockForestEye extends BlockModContainer<TileForestEye> implements ILexiconable {
IIcon[] icons;
@@ -38,15 +37,15 @@ public class BlockForestEye extends BlockModContainer implements ILexiconable {
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
icons = new IIcon[6];
for(int i = 0; i < icons.length; i++)
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
icons[i] = IconHelper.forBlock(register, this, i);
}
@Override
public IIcon getIcon(int par1, int par2) {
return icons[Math.min(icons.length - 1, par1)];
public IIcon getIcon(int side, int meta) {
return icons[Math.min(icons.length - 1, side)];
}
@Override
@@ -65,13 +64,13 @@ public class BlockForestEye extends BlockModContainer implements ILexiconable {
}
@Override
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
TileForestEye eye = (TileForestEye) par1World.getTileEntity(par2, par3, par4);
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
TileForestEye eye = (TileForestEye) world.getTileEntity(x, y, z);
return Math.min(15, Math.max(0, eye.entities - 1));
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileForestEye createNewTileEntity(World world, int meta) {
return new TileForestEye();
}
@@ -39,29 +39,29 @@ public class BlockGaiaHead extends BlockSkull {
}
@Override
public Block setBlockName(String par1Str) {
GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str);
return super.setBlockName(par1Str);
public Block setBlockName(String name) {
GameRegistry.registerBlock(this, ItemBlockMod.class, name);
return super.setBlockName(name);
}
@Override
@SideOnly(Side.CLIENT)
public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
public Item getItem(World world, int x, int y, int z) {
return ModItems.gaiaHead;
}
@Override
public void registerBlockIcons(IIconRegister p_149651_1_) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@Override
public ArrayList<ItemStack> getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<>();
if((p_149749_6_ & 8) == 0) {
if((meta & 8) == 0) {
ItemStack itemstack = new ItemStack(ModItems.gaiaHead, 1);
TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
TileEntitySkull tileentityskull = (TileEntitySkull)world.getTileEntity(x, y, z);
if(tileentityskull == null)
return ret;
@@ -72,29 +72,29 @@ public class BlockGaiaHead extends BlockSkull {
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
public Item getItemDropped(int meta, Random random, int fortune) {
return ModItems.gaiaHead;
}
@Override
public int getDamageValue(World p_149643_1_, int p_149643_2_, int p_149643_3_, int p_149643_4_) {
public int getDamageValue(World world, int x, int y, int z) {
return 0;
}
@Override
public int damageDropped(int p_149692_1_) {
public int damageDropped(int meta) {
return 0;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
public TileEntity createNewTileEntity(World world, int meta) {
return new TileGaiaHead();
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return Blocks.coal_block.getBlockTextureFromSide(p_149691_1_);
public IIcon getIcon(int side, int meta) {
return Blocks.coal_block.getBlockTextureFromSide(side);
}
}
@@ -38,23 +38,22 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
public BlockGhostRail() {
super(true);
setCreativeTab(BotaniaCreativeTab.INSTANCE);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(new EventHandler());
setBlockName(LibBlockNames.GHOST_RAIL);
}
@Override
public Block setBlockName(String par1Str) {
GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str);
return super.setBlockName(par1Str);
public Block setBlockName(String name) {
GameRegistry.registerBlock(this, ItemBlockMod.class, name);
return super.setBlockName(name);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
blockIcon = IconHelper.forBlock(par1IconRegister, this);
public void registerBlockIcons(IIconRegister register) {
blockIcon = IconHelper.forBlock(register, this);
}
@SubscribeEvent
public void onMinecartUpdate(MinecartUpdateEvent event) {
int x = MathHelper.floor_double(event.entity.posX);
int y = MathHelper.floor_double(event.entity.posY);
@@ -90,4 +89,11 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable {
return LexiconData.ghostRail;
}
public class EventHandler {
@SubscribeEvent
public void onMinecartUpdateWrapper(MinecartUpdateEvent event) {
BlockGhostRail.this.onMinecartUpdate(event);
}
}
}
@@ -21,7 +21,6 @@ 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.tileentity.TileEntity;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@@ -40,7 +39,7 @@ import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockHourglass extends BlockModContainer implements IManaTrigger, IWandable, IWandHUD, ILexiconable {
public class BlockHourglass extends BlockModContainer<TileHourglass> implements IManaTrigger, IWandable, IWandHUD, ILexiconable {
Random random;
@@ -110,8 +109,8 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
}
@Override
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4);
public void breakBlock(World world, int x, int y, int z, Block blockBroken, int meta) {
TileSimpleInventory inv = (TileSimpleInventory) world.getTileEntity(x, y, z);
if (inv != null) {
for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) {
@@ -122,14 +121,14 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
float f1 = random.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; world.spawnEntityInWorld(entityitem)) {
int k1 = random.nextInt(21) + 10;
if (k1 > itemstack.stackSize)
k1 = itemstack.stackSize;
itemstack.stackSize -= k1;
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (float)random.nextGaussian() * f3;
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
@@ -141,19 +140,19 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
}
}
par1World.func_147453_f(par2, par3, par4, par5);
world.func_147453_f(x, y, z, blockBroken);
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
super.breakBlock(world, x, y, z, blockBroken, meta);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@Override
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
public IIcon getIcon(int side, int meta) {
return ModBlocks.manaGlass.getIcon(0, 0);
}
@@ -173,7 +172,7 @@ public class BlockHourglass extends BlockModContainer implements IManaTrigger, I
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileHourglass createNewTileEntity(World world, int meta) {
return new TileHourglass();
}
@@ -17,7 +17,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
@@ -32,7 +31,7 @@ import vazkii.botania.common.block.tile.TileIncensePlate;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockIncensePlate extends BlockModContainer implements ILexiconable {
public class BlockIncensePlate extends BlockModContainer<TileIncensePlate> implements ILexiconable {
private static final int[] META_ROTATIONS = new int[] { 2, 5, 3, 4 };
@@ -80,9 +79,9 @@ public class BlockIncensePlate extends BlockModContainer implements ILexiconable
}
@Override
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, META_ROTATIONS[l], 2);
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) {
int l = MathHelper.floor_double(placer.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
world.setBlockMetadataWithNotify(x, y, z, META_ROTATIONS[l], 2);
}
@Override
@@ -117,12 +116,12 @@ public class BlockIncensePlate extends BlockModContainer implements ILexiconable
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
// NO-OP
}
@Override
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
public IIcon getIcon(int side, int meta) {
return ModBlocks.livingwood.getIcon(0, 0);
}
@@ -142,7 +141,7 @@ public class BlockIncensePlate extends BlockModContainer implements ILexiconable
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileIncensePlate createNewTileEntity(World world, int meta) {
return new TileIncensePlate();
}
@@ -53,7 +53,7 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
}
@Override
public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) {
public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) {
return false;
}
@@ -71,20 +71,18 @@ public class BlockLightLauncher extends BlockMod implements ILexiconable {
}
public void pickUpEntities(World world, int x, int y, int z) {
List<TileLightRelay> relays = new ArrayList();
List<TileLightRelay> relays = new ArrayList<>();
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) {
TileEntity tile = world.getTileEntity(x + dir.offsetX, y, z + dir.offsetZ);
if(tile instanceof TileLightRelay) {
TileLightRelay relay = (TileLightRelay) tile;
if(relay.getBinding() != null)
if(tile instanceof TileLightRelay relay) {
if(relay.getBinding() != null)
relays.add(relay);
}
}
if(!relays.isEmpty()) {
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
List<Entity> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, aabb);
entities.addAll(world.getEntitiesWithinAABB(EntityItem.class, aabb));
List<Entity> entities = world.selectEntitiesWithinAABB(Entity.class, aabb, e -> e instanceof EntityLivingBase || e instanceof EntityItem);
if(!entities.isEmpty()) {
for(Entity entity : entities) {
@@ -20,7 +20,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@@ -36,7 +35,7 @@ import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.registry.GameRegistry;
public class BlockLightRelay extends BlockModContainer implements IWandable, ILexiconable {
public class BlockLightRelay extends BlockModContainer<TileLightRelay> implements IWandable, ILexiconable {
public static IIcon invIcon, worldIcon, invIconRed, worldIconRed;
@@ -48,9 +47,9 @@ public class BlockLightRelay extends BlockModContainer implements IWandable, ILe
}
@Override
public Block setBlockName(String par1Str) {
register(par1Str);
return super.setBlockName(par1Str);
public Block setBlockName(String name) {
register(name);
return super.setBlockName(name);
}
void register(String name) {
@@ -58,7 +57,7 @@ public class BlockLightRelay extends BlockModContainer implements IWandable, ILe
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
for(int i = 0; i < 2; i++)
list.add(new ItemStack(item, 1, i));
}
@@ -74,7 +73,7 @@ public class BlockLightRelay extends BlockModContainer implements IWandable, ILe
}
@Override
public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) {
public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) {
return false;
}
@@ -85,12 +84,12 @@ public class BlockLightRelay extends BlockModContainer implements IWandable, ILe
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return null;
}
@Override
public int tickRate(World p_149738_1_) {
public int tickRate(World world) {
return 2;
}
@@ -111,11 +110,11 @@ public class BlockLightRelay extends BlockModContainer implements IWandable, ILe
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
invIcon = IconHelper.forBlock(par1IconRegister, this, 0);
worldIcon = IconHelper.forBlock(par1IconRegister, this, 1);
invIconRed = IconHelper.forBlock(par1IconRegister, this, 2);
worldIconRed = IconHelper.forBlock(par1IconRegister, this, 3);
public void registerBlockIcons(IIconRegister register) {
invIcon = IconHelper.forBlock(register, this, 0);
worldIcon = IconHelper.forBlock(register, this, 1);
invIconRed = IconHelper.forBlock(register, this, 2);
worldIconRed = IconHelper.forBlock(register, this, 3);
}
@Override
@@ -139,7 +138,7 @@ public class BlockLightRelay extends BlockModContainer implements IWandable, ILe
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
public TileLightRelay createNewTileEntity(World world, int meta) {
return new TileLightRelay();
}
@@ -49,32 +49,32 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
}
@Override
public int damageDropped(int par1) {
return par1;
public int damageDropped(int meta) {
return meta;
}
@Override
public Block setBlockName(String par1Str) {
GameRegistry.registerBlock(this, ItemCubeWithMetadataAndName.class, par1Str);
return super.setBlockName(par1Str);
public Block setBlockName(String name) {
GameRegistry.registerBlock(this, ItemCubeWithMetadataAndName.class, name);
return super.setBlockName(name);
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
for(int i = 0; i < TYPES; i++)
par3List.add(new ItemStack(par1, 1, i));
list.add(new ItemStack(item, 1, i));
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
icons = new IIcon[TYPES];
for(int i = 0; i < TYPES; i++)
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
icons[i] = IconHelper.forBlock(register, this, i);
}
@Override
public IIcon getIcon(int par1, int par2) {
return icons[Math.min(TYPES - 1, par2)];
public IIcon getIcon(int side, int meta) {
return icons[Math.min(TYPES - 1, meta)];
}
@Override
@@ -53,14 +53,14 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
}
@Override
public int damageDropped(int par1) {
return par1;
public int damageDropped(int meta) {
return meta;
}
@Override
public Block setBlockName(String par1Str) {
register(par1Str);
return super.setBlockName(par1Str);
public Block setBlockName(String name) {
register(name);
return super.setBlockName(name);
}
void register(String name) {
@@ -68,21 +68,21 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
for(int i = 0; i < TYPES; i++)
par3List.add(new ItemStack(par1, 1, i));
list.add(new ItemStack(item, 1, i));
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
public void registerBlockIcons(IIconRegister register) {
icons = new IIcon[TYPES];
for(int i = 0; i < TYPES; i++)
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
icons[i] = IconHelper.forBlock(register, this, i);
}
@Override
public IIcon getIcon(int par1, int par2) {
return icons[Math.min(TYPES - 1, par2)];
public IIcon getIcon(int side, int meta) {
return icons[Math.min(TYPES - 1, meta)];
}
@Override
Loaded 100 of 358 files, more files were not shown because too many files have changed in this diff. Show more