Compare commits

...
9 Commits
Author SHA1 Message Date
Jason Mitchell 7c2c6b7966 Add back the randomly aging (non 0 meta) fires. (#33) 2023-09-10 11:11:57 -07:00
Jason Mitchell acbc864d76 Infused fire (#31)
* BS + SA

* Intellij Cleanups

* Add missing overrides

* Cleanup fire code

* Less allocations

* Get rid of BlockTuple -> Far fewer allocations (It was only used for Ordo Fire which isn't very useful for NH)
Neuter Ordo fire (will be reworked once we figure out what it should do)
Mixin to fix fire rendering on water -- call the subclass's canCatchFire instead of the base class
Properly tether the fire spread to 15 blocks from the source, which never burns out.

* rm

* Spotless
2023-09-10 07:17:59 -07:00
Martin Robertz c762ad9915 Merge pull request #32 from wohaopa/master
Fix potential unsaves
2023-07-17 08:22:22 +02:00
初夏同学 f8fb442525 Fix potential unsaves 2023-07-16 00:29:26 +08:00
Martin Robertz 3bb2edda24 Merge pull request #30 from bearsdotzone/master
Bug: Aspect Crops will never yield a certain valid drop
2023-04-25 19:49:01 +02:00
abneyonline 587027c24e updated dependencies 2023-04-25 11:18:04 -05:00
Bears Dot Zone a8259fe5cc Fix off by one when generating aspect crop loot. 2023-04-25 04:22:49 +00:00
Connor-Colenso 2e906240da Merge pull request #29 from GTNewHorizons/fixarrowexploit
should fix arrow exploits for gt materials
2023-03-26 19:18:28 +01:00
chochem d79f97397a should fix arrow exploits 2023-03-26 17:57:11 +01:00
198 changed files with 1463 additions and 1388 deletions

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
src/main/resources/mixins.*([!.]).json
*.bat
*.DS_Store
!gradlew.bat
+507 -178
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -1,10 +1,10 @@
// Add your dependencies here
dependencies {
compile('com.github.GTNewHorizons:Baubles:1.0.1.14:dev')
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-147-GTNH:api')
api('com.github.GTNewHorizons:Baubles:1.0.1.14:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-195-GTNH:api')
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Botania:1.9.1-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.6:dev') {transitive=false}
@@ -14,7 +14,7 @@ dependencies {
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.9.0.13-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.1.5.3:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.23-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.1-GTNH:api') {transitive=false}
compileOnly('curse.maven:computercraft-67504:2269339')
compileOnly('curse.maven:cofh-lib-220333:2388748')
+4 -2
View File
@@ -42,11 +42,13 @@ apiPackage = api
accessTransformersFile = ThaumicTinkerer_at.cfg
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
usesMixins = true
# Adds some debug arguments like verbose output and export
usesMixinDebug = true
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
mixinsPackage = mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
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-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+4 -3
View File
@@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
@@ -13,15 +13,15 @@ package thaumic.tinkerer.client.core.handler;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.client.gui.GuiResearchRecipe;
import thaumic.tinkerer.client.core.handler.kami.ToolModeHUDHandler;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.client.gui.GuiResearchPeripheral;
import thaumic.tinkerer.common.lib.LibResearch;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
public class ClientTickHandler {
@@ -5,15 +5,15 @@ import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv;
/**
* Created by Katrina on 28/02/14.
@@ -23,12 +23,12 @@ import net.minecraft.util.StatCollector;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import thaumcraft.api.wands.ItemFocusBasic;
import thaumcraft.common.config.Config;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumic.tinkerer.client.core.helper.ClientHelper;
import thaumic.tinkerer.common.item.foci.ItemFocusDislocation;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public final class HUDHandler {
@@ -2,9 +2,9 @@ package thaumic.tinkerer.client.core.handler.kami;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.client.FMLClientHandler;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.network.packet.kami.PacketToggleArmor;
import cpw.mods.fml.client.FMLClientHandler;
/**
* Created by Katrina on 02/03/14.
@@ -16,9 +16,9 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public final class PlacementMirrorPredictionRenderer {
@@ -20,12 +20,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.lib.LibResources;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
public final class SoulHeartClientHandler {
@@ -95,8 +95,6 @@ public final class SoulHeartClientHandler {
}
}
// GL11.glEnable(3008);
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(Gui.icons);
}
}
@@ -22,10 +22,10 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import org.lwjgl.opengl.GL11;
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
public final class ToolModeHUDHandler {
@@ -20,6 +20,13 @@ import net.minecraftforge.client.EnumHelperClient;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import thaumcraft.client.fx.ParticleEngine;
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
import thaumic.tinkerer.client.core.handler.GemArmorKeyHandler;
@@ -53,13 +60,6 @@ import thaumic.tinkerer.common.item.ItemInfusedSeeds;
import thaumic.tinkerer.common.item.ItemMobDisplay;
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
import thaumic.tinkerer.common.item.kami.foci.ItemFocusShadowbeam;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
public class TTClientProxy extends TTCommonProxy {
@@ -38,8 +38,8 @@ public class GuiAnimationTablet extends GuiContainer {
int x, y;
TileAnimationTablet tablet;
List<GuiButtonAT> buttonListAT = new ArrayList();
List<IRadioButton> radioButtons = new ArrayList();
List<GuiButtonAT> buttonListAT = new ArrayList<>();
List<IRadioButton> radioButtons = new ArrayList<>();
public GuiAnimationTablet(TileAnimationTablet tablet, InventoryPlayer playerInv) {
super(new ContainerAnimationTablet(tablet, playerInv));
@@ -43,7 +43,7 @@ public class GuiEnchanting extends GuiContainer {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ENCHANTER);
public TileEnchanter enchanter;
public List<String> tooltip = new ArrayList();
public List<String> tooltip = new ArrayList<>();
int x, y;
GuiButtonEnchantment[] enchantButtons = new GuiButtonEnchantment[16];
List<Integer> lastTickEnchants;
@@ -56,8 +56,8 @@ public class GuiEnchanting extends GuiContainer {
this.enchanter = enchanter;
lastTickStack = enchanter.getStackInSlot(0);
currentStack = enchanter.getStackInSlot(0);
lastTickEnchants = new ArrayList(enchanter.enchantments);
lastTickLevels = new ArrayList(enchanter.levels);
lastTickEnchants = new ArrayList<>(enchanter.enchantments);
lastTickLevels = new ArrayList<>(enchanter.levels);
}
@Override
@@ -173,8 +173,8 @@ public class GuiEnchanting extends GuiContainer {
buildButtonList();
lastTickStack = currentStack;
lastTickEnchants = new ArrayList(enchanter.enchantments);
lastTickLevels = new ArrayList(enchanter.enchantments);
lastTickEnchants = new ArrayList<>(enchanter.enchantments);
lastTickLevels = new ArrayList<>(enchanter.enchantments);
}
@Override
@@ -231,7 +231,7 @@ public class GuiEnchanting extends GuiContainer {
}
if (mx > x && mx <= x + 10 && my > y - size && my <= y) {
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add('\u00a7' + aspect.getChatcolor() + aspect.getName());
tooltip.add(current + "/" + totalCost);
this.tooltip = tooltip;
@@ -42,8 +42,8 @@ public class GuiMobMagnet extends GuiContainer {
ItemStack stack = null;
TileMobMagnet mobMagnet;
List<GuiButtonMM> buttonListMM = new ArrayList();
List<IRadioButton> radioButtons = new ArrayList();
List<GuiButtonMM> buttonListMM = new ArrayList<>();
List<IRadioButton> radioButtons = new ArrayList<>();
public GuiMobMagnet(TileMobMagnet tile, InventoryPlayer playerInv) {
super(new ContainerMobMagnet(tile, playerInv));
@@ -28,8 +28,8 @@ public class GuiRemotePlacer extends GuiContainer {
private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ASPECT_ANALYZER);
int x, y;
List<IRadioButton> radioButtons = new ArrayList();
List<GuiButtonRP> buttonListRP = new ArrayList();
List<IRadioButton> radioButtons = new ArrayList<>();
List<GuiButtonRP> buttonListRP = new ArrayList<>();
TileRPlacer placer;
Aspect aspectHovered = null;
@@ -16,10 +16,10 @@ import java.net.URI;
import net.minecraft.util.StatCollector;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.client.gui.GuiResearchRecipe;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.client.gui.GuiResearchRecipe;
@SideOnly(Side.CLIENT)
public class GuiResearchPeripheral extends GuiResearchRecipe {
@@ -51,7 +51,7 @@ public class GuiButtonEnchant extends GuiButton {
&& par3 >= yPosition
&& par3 < yPosition + 15
&& !enchanter.working) {
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("ttmisc.startEnchant"));
parent.tooltip = tooltip;
}
@@ -54,7 +54,7 @@ public class GuiButtonEnchantment extends GuiButton {
GL11.glDisable(GL11.GL_BLEND);
if (par2 >= xPosition && par2 < xPosition + 16 && par3 >= yPosition && par3 < yPosition + 16) {
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal(enchant.getName()));
for (Aspect aspect : data.aspects.getAspectsSorted()) tooltip.add(
" \u00a7" + aspect.getChatcolor()
@@ -31,6 +31,7 @@ public class GuiIchorPouch extends GuiContainer {
// Overridden to prevent a dupe
// See issue 367
@Override
protected boolean checkHotbarKeys(int slot) {
if (this.mc.gameSettings.keyBindsHotbar[this.mc.thePlayer.inventory.currentItem].getKeyCode() != slot) {
super.checkHotbarKeys(slot);
@@ -44,7 +44,7 @@ public class GuiWarpGateDestinations extends GuiScreen {
int lastMouseX, lastMouseY;
int x, y;
int ticks;
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
public GuiWarpGateDestinations(TileWarpGate warpGate) {
this.warpGate = warpGate;
@@ -113,7 +113,7 @@ public class GuiWarpGateDestinations extends GuiScreen {
int gateY = warpGate.zCoord - y;
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
List<Object[]> coords = new ArrayList();
List<Object[]> coords = new ArrayList<>();
for (int i = 0; i < warpGate.getSizeInventory(); i++) {
ItemStack stack = warpGate.getStackInSlot(i);
@@ -7,10 +7,10 @@ import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumcraft.api.aspects.Aspect;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.common.block.BlockInfusedGrain;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
/**
* Created by pixlepix on 8/4/14.
@@ -18,10 +18,10 @@ import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.client.render.tile.RenderTileMagnet;
import thaumic.tinkerer.common.block.tile.TileMagnet;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderMagnet implements ISimpleBlockRenderingHandler {
@@ -18,9 +18,9 @@ import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.common.block.tile.TileRepairer;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderRepairer implements ISimpleBlockRenderingHandler {
@@ -19,10 +19,10 @@ import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import thaumcraft.client.renderers.block.BlockRenderer;
import thaumic.tinkerer.client.lib.LibRenderIDs;
import thaumic.tinkerer.common.block.kami.BlockWarpGate;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderWarpGate extends BlockRenderer implements ISimpleBlockRenderingHandler {
@@ -126,12 +126,5 @@ public class RenderGenericSeeds implements IItemRenderer {
tesselator.draw();
}
private void setColorForAspect(Aspect aspect) {
// if(!aspect.isPrimal()){
// float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F;
// float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F;
// float b = (aspect.getColor() & 0xFF) / 255.0F;
// GL11.glColor3f(r, g, b);
// }
}
private void setColorForAspect(Aspect aspect) {}
}
@@ -20,8 +20,6 @@ public class RenderPlacementMirror implements IItemRenderer {
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
// return type != ItemRenderType.INVENTORY && type!=ItemRenderType.ENTITY;
// return type != ItemRenderType.INVENTORY ;
return true;
}
@@ -20,6 +20,15 @@ import net.minecraftforge.common.DimensionManager;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import thaumcraft.common.CommonProxy;
import thaumcraft.common.Thaumcraft;
import thaumic.tinkerer.api.InterModCommsOperations;
@@ -33,15 +42,6 @@ import thaumic.tinkerer.common.lib.LibMisc;
import thaumic.tinkerer.common.peripheral.PeripheralHandler;
import thaumic.tinkerer.common.registry.TTRegistry;
import thaumic.tinkerer.common.research.KamiResearchItem;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES)
public class ThaumicTinkerer {
@@ -31,6 +31,8 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -47,8 +49,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockAnimationTablet extends BlockModContainer {
@@ -91,10 +91,6 @@ public class BlockAnimationTablet extends BlockModContainer {
if (l1 == 3) b0 = 4;
par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);
// TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
// if(par5EntityLiving instanceof EntityPlayer) {
// tablet.Owner = ((EntityPlayer) par5EntityLiving).username;
// }
}
@Override
@@ -102,11 +98,7 @@ public class BlockAnimationTablet extends BlockModContainer {
TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4);
if (tablet != null) {
if (tablet.getIsBreaking()) {
// ChunkCoordinates coords = tablet.getTargetLoc();
// par1World.destroyBlockInWorldPartially(tablet.getFakePlayer().entityId, coords.posX, coords.posY,
// coords.posZ, -1);
}
if (tablet.getIsBreaking()) {}
for (int j1 = 0; j1 < tablet.getSizeInventory(); ++j1) {
ItemStack itemstack = tablet.getStackInSlot(j1);
@@ -206,8 +198,6 @@ public class BlockAnimationTablet extends BlockModContainer {
return true;
} else {
// if(tablet.Owner==null || tablet.Owner.equals(""))
// tablet.Owner=par5EntityPlayer.username;
par5EntityPlayer
.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_TABLET, par1World, par2, par3, par4);
}
@@ -26,6 +26,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.common.Loader;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -42,7 +43,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.common.Loader;
public class BlockAspectAnalyzer extends BlockModContainer {
@@ -27,9 +27,9 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumic.tinkerer.common.block.tile.TileCamo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.block.tile.TileCamo;
public abstract class BlockCamo extends BlockModContainer<TileCamo> {
@@ -28,6 +28,8 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -45,8 +47,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockEnchanter extends BlockModContainer {
@@ -28,7 +28,7 @@ public class BlockForcefield extends BlockMod {
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList<ItemStack>();
return new ArrayList<>();
}
@Override
@@ -29,6 +29,8 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -42,8 +44,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockFunnel extends BlockModContainer {
@@ -25,12 +25,12 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
@@ -118,7 +118,7 @@ public abstract class BlockGas extends BlockMod implements ITTinkererBlock {
@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
@@ -17,10 +17,10 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.lib.LibBlockNames;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.lib.LibBlockNames;
public class BlockGaseousLight extends BlockGas {
@@ -17,10 +17,10 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.lib.LibBlockNames;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.lib.LibBlockNames;
public class BlockGaseousShadow extends BlockGas {
@@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.Loader;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -24,7 +25,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.common.Loader;
public class BlockGolemConnector extends BlockCamo {
@@ -15,14 +15,14 @@ import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.block.tile.TileInfusedFarmland;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Created by pixlepix on 8/4/14.
@@ -113,11 +113,13 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo
@Override
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return p_149691_1_ == 1 ? (iconWet) : Blocks.dirt.getBlockTextureFromSide(p_149691_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.iconWet = IconHelper.forBlock(p_149651_1_, this);
@@ -125,7 +125,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
ArrayList<ItemStack> ret = new ArrayList<>();
if (world == null) return ret;
Random rand = new Random();
int count = 1;
@@ -173,6 +173,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock {
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
// Prevent normal growth from occuring
// Growth takes place in the tile entity
@@ -30,6 +30,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -53,8 +55,6 @@ import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.RecipeHelper;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBlock {
@@ -284,7 +284,7 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl
@Override
public HashMap<Class<? extends TileEntity>, String> getAdditionalTileEntities() {
HashMap<Class<? extends TileEntity>, String> r = new HashMap<Class<? extends TileEntity>, String>();
HashMap<Class<? extends TileEntity>, String> r = new HashMap<>();
r.put(TileMobMagnet.class, LibBlockNames.MOB_MAGNET);
return r;
}
@@ -19,11 +19,11 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class BlockMod extends Block implements ITTinkererBlock {
@@ -18,11 +18,11 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class BlockModContainer<T extends TileEntity> extends BlockContainer implements ITTinkererBlock {
@@ -21,13 +21,13 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.item.ItemBrightNitor;
import thaumic.tinkerer.common.item.kami.armor.ItemGemLegs;
import thaumic.tinkerer.common.lib.LibBlockNames;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockNitorGas extends BlockGas {
@@ -30,6 +30,9 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -45,9 +48,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockRepairer extends BlockModContainer {
@@ -25,6 +25,8 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -40,8 +42,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockSummon extends Block implements ITTinkererBlock {
@@ -17,6 +17,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigBlocks;
import thaumic.tinkerer.common.ThaumicTinkerer;
@@ -27,8 +29,6 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Created by Katrina on 13/04/2015.
@@ -64,11 +64,6 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock {
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class));
}
// @Override
// public int idDropped(int par1, Random par2Random, int par3) {
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
// }
@Override
public ItemStack createStackedBlock(int par1) {
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class));
@@ -1,7 +1,6 @@
package thaumic.tinkerer.common.block;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
@@ -23,6 +22,8 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigBlocks;
import thaumic.tinkerer.common.ThaumicTinkerer;
@@ -34,8 +35,6 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Created by Katrina on 13/04/2015.
@@ -72,11 +71,6 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEn
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class));
}
// @Override
// public int idDropped(int par1, Random par2Random, int par3) {
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
// }
@Override
public ItemStack createStackedBlock(int par1) {
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class));
@@ -192,10 +186,9 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEn
(double) (y + 1),
(double) (z + 1)).expand(1.0D, 1.0D, 1.0D));
if (!var10.isEmpty()) {
Iterator iterator = var10.iterator();
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
for (Object o : var10) {
Entity entity = (Entity) o;
if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer)) {
Thaumcraft.proxy.blockRunes(
world,
@@ -2,16 +2,16 @@ package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -22,6 +22,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
public class BlockFireAir extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
@Override
public String getBlockName() {
return LibBlockNames.BLOCK_FIRE_AIR;
@@ -51,25 +53,31 @@ public class BlockFireAir extends BlockFireBase {
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.AIR, 5));
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(Blocks.log), new BlockTuple(Blocks.sand));
result.put(new BlockTuple(Blocks.leaves), new BlockTuple(Blocks.sandstone));
result.put(new BlockTuple(Blocks.leaves2), new BlockTuple(Blocks.sandstone));
result.put(new BlockTuple(Blocks.log2), new BlockTuple(Blocks.sand));
result.put(new BlockTuple(Blocks.ice), new BlockTuple(Blocks.glass));
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(Blocks.log, Blocks.sand);
blockTransformation.put(Blocks.leaves, Blocks.sandstone);
blockTransformation.put(Blocks.leaves2, Blocks.sandstone);
blockTransformation.put(Blocks.log2, Blocks.sand);
blockTransformation.put(Blocks.ice, Blocks.glass);
if (ConfigHandler.enableCake) {
result.put(new BlockTuple(Blocks.water), new BlockTuple(Blocks.cake));
blockTransformation.put(Blocks.water, Blocks.cake);
}
result.put(new BlockTuple(Blocks.dirt), new BlockTuple(Blocks.sand));
result.put(new BlockTuple(Blocks.grass), new BlockTuple(Blocks.sand));
return result;
blockTransformation.put(Blocks.dirt, Blocks.sand);
blockTransformation.put(Blocks.grass, Blocks.sand);
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -1,6 +1,11 @@
package thaumic.tinkerer.common.block.fire;
import static net.minecraftforge.common.util.ForgeDirection.*;
import static net.minecraftforge.common.util.ForgeDirection.DOWN;
import static net.minecraftforge.common.util.ForgeDirection.EAST;
import static net.minecraftforge.common.util.ForgeDirection.NORTH;
import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
import static net.minecraftforge.common.util.ForgeDirection.UP;
import static net.minecraftforge.common.util.ForgeDirection.WEST;
import java.util.ArrayList;
import java.util.HashMap;
@@ -16,238 +21,180 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
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;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.item.ItemBlockFire;
import thaumic.tinkerer.common.registry.ITTinkererBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock {
public static final String LARGESMOKE = "largesmoke";
private IIcon[] icons;
private IIcon itemIcon;
public abstract HashMap<BlockTuple, BlockTuple> getBlockTransformation();
private static final Random random = new Random();
public boolean isTransmutationTarget(Block block, World w, int x, int y, int z) {
public abstract HashMap<Block, Block> getBlockTransformation();
return isTransmutationTarget(new BlockTuple(block), w, x, y, z);
public boolean isTransmutationTarget(Block block, IBlockAccess w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).containsKey(block);
}
public boolean isTransmutationResult(Block block, World w, int x, int y, int z) {
return isTransmutationResult(new BlockTuple(block), w, x, y, z);
public boolean isTransmutationResult(Block block, IBlockAccess w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).containsValue(block);
}
public boolean isTransmutationTarget(BlockTuple block, World w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).keySet().contains(block);
}
public boolean isTransmutationResult(BlockTuple block, World w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).values().contains(block);
}
public abstract HashMap<BlockTuple, BlockTuple> getBlockTransformation(World w, int x, int y, int z);
public abstract HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z);
public boolean isNeighborTarget(World w, int x, int y, int z) {
for (ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) {
if (w.blockExists(x + f.offsetX, y + f.offsetY, z + f.offsetZ) && isTransmutationTarget(
w.getBlock(x + f.offsetX, y + f.offsetY, z + f.offsetZ),
w,
x + f.offsetX,
y + f.offsetY,
z + f.offsetZ)) {
for (final ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) {
final int xTar = x + f.offsetX;
final int yTar = y + f.offsetY;
final int zTar = z + f.offsetZ;
if (!w.blockExists(xTar, yTar, zTar)) continue;
if (isTransmutationTarget(w.getBlock(xTar, yTar, zTar), w, xTar, yTar, zTar)) {
return true;
}
}
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_,
int p_149668_4_) {
return null;
}
public int getDecayChance(World w, int x, int y, int z) {
return 1;
}
public boolean isOpaqueCube() {
return false;
}
public boolean renderAsNormalBlock() {
return false;
}
public int getRenderType() {
return 3;
}
public int quantityDropped(Random p_149745_1_) {
return 0;
}
@Override
public int tickRate(World p_149738_1_) {
return ConfigHandler.enableFireMechanics ? 200 : 0x7ffffff0;
}
public void setBlockWithTransmutationTarget(World world, int x, int y, int z, int meta, Block block) {
Random random = new Random();
if (isTransmutationTarget(world.getBlock(x, z, y), world, x, y, z)
&& random.nextInt(getDecayChance(world, x, y, z)) == 0) {
world.setBlock(
x,
z,
y,
getBlockTransformation(world, x, y, z).get(new BlockTuple(world.getBlock(x, z, y))).block,
getBlockTransformation(world, x, y, z).get(new BlockTuple(world.getBlock(x, z, y))).meta,
3);
final Block targetBlock = world.getBlock(x, y, z);
if (isTransmutationTarget(targetBlock, world, x, y, z)) {
final Block targetTransform = getBlockTransformation(world, x, y, z).get(targetBlock);
world.setBlock(x, y, z, targetTransform, 0, 3);
} else {
world.setBlock(x, z, y, block, meta, 3);
world.setBlock(x, y, z, block, meta, 3);
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if (world.getGameRules().getGameRuleBooleanValue("doFireTick") && ConfigHandler.enableFire
&& ConfigHandler.enableFireMechanics) {
if (!(world.getGameRules().getGameRuleBooleanValue("doFireTick") && ConfigHandler.enableFire
&& ConfigHandler.enableFireMechanics)) {
return;
}
if (world.isRaining() && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z)
|| world.canLightningStrikeAt(x + 1, y, z)
|| world.canLightningStrikeAt(x, y, z - 1)
|| world.canLightningStrikeAt(x, y, z + 1))) {
world.setBlockToAir(x, y, z);
} else {
if (!isNeighborTarget(world, x, y, z)) {
world.setBlockToAir(x, y, z);
}
if (rand.nextInt(20) == 0) {
if (isNeighborTarget(world, x, y, z)) {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
if (isTransmutationTarget(
world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ),
world,
x + dir.offsetX,
y + dir.offsetY,
z + dir.offsetZ)) {
Random random = new Random();
if (random.nextInt(
getDecayChance(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))
== 0) {
world.setBlock(
x + dir.offsetX,
y + dir.offsetY,
z + dir.offsetZ,
getBlockTransformation(
world,
x + dir.offsetX,
y + dir.offsetY,
z + dir.offsetZ).get(
new BlockTuple(
world.getBlock(
x + dir.offsetX,
y + dir.offsetY,
z + dir.offsetZ))).block,
getBlockTransformation(
world,
x + dir.offsetX,
y + dir.offsetY,
z + dir.offsetZ).get(
new BlockTuple(
world.getBlock(
x + dir.offsetX,
y + dir.offsetY,
z + dir.offsetZ))).meta,
3);
} else {
world.setBlockToAir(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
}
}
}
if (world.isRaining() && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z)
|| world.canLightningStrikeAt(x + 1, y, z)
|| world.canLightningStrikeAt(x, y, z - 1)
|| world.canLightningStrikeAt(x, y, z + 1))) {
// Check if it's raining and if it can be put out by rain
world.setBlockToAir(x, y, z);
return;
}
final int blockMeta = world.getBlockMetadata(x, y, z);
// Source block doesn't burn out
if (blockMeta != 0 && !isNeighborTarget(world, x, y, z)) {
// Extinguish if there's no valid fuel around
world.setBlockToAir(x, y, z);
return;
}
// Check Transforms
if (rand.nextInt(20) == 0 && (isNeighborTarget(world, x, y, z))) {
for (final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
final int xT = x + dir.offsetX;
final int yT = y + dir.offsetY;
final int zT = z + dir.offsetZ;
final Block targetBlock = world.getBlock(xT, yT, zT);
final Block targetTransform = getBlockTransformation(world, xT, yT, zT).get(targetBlock);
if (targetTransform == null) continue;
world.setBlock(xT, yT, zT, targetTransform, 0, 3);
}
}
if (blockMeta < 15 && blockMeta > 0) {
// Randomly increase the age of a fire
// 0 meta is considered a source and never increases, for any other meta we have a chance to increase
final int newMeta = Math.min(blockMeta + rand.nextInt(3) / 2, 15);
if (newMeta > blockMeta) {
world.setBlockMetadataWithNotify(x, y, z, newMeta, 4);
}
} else if (blockMeta >= 15) {
// No spreading if we're at max meta
return;
}
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + rand.nextInt(3));
final boolean highHumidity = world.isBlockHighHumidity(x, y, z);
byte strMod = 0;
if (highHumidity) {
strMod = -50;
}
// Spread
for (final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
this.tryCatchFire(
world,
x + dir.offsetX,
y + dir.offsetY,
z + dir.offsetZ,
300 + strMod,
rand,
blockMeta,
dir);
}
for (int xt = x - 1; xt <= x + 1; xt++) {
for (int zt = z - 1; zt <= z + 1; zt++) {
for (int yt = y - 1; yt <= y + 2; yt++) {
if (xt == x && yt == y && zt == z) {
continue;
}
}
}
int l = world.getBlockMetadata(x, y, z);
int fireChance = this.getChanceOfNeighborsEncouragingFire(world, xt, yt, zt);
if (l < 15) {
world.setBlockMetadataWithNotify(x, y, z, l + rand.nextInt(3) / 2, 4);
}
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + rand.nextInt(3));
boolean flag1 = world.isBlockHighHumidity(x, y, z);
byte b0 = 0;
if (flag1) {
b0 = -50;
}
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
this.tryCatchFire(
world,
x + direction.offsetX,
y + direction.offsetY,
z + direction.offsetZ,
300 + b0,
rand,
l,
direction);
}
for (int i1 = x - 1; i1 <= x + 1; i1++) {
for (int j1 = z - 1; j1 <= z + 1; j1++) {
for (int k1 = y - 1; k1 <= y + 2; k1++) {
if (i1 != x || k1 != y || j1 != z) {
int l1 = 100;
int i2 = this.getChanceOfNeighborsEncouragingFire(world, i1, k1, j1);
if (i2 > 0) {
int j2 = (i2 + 70) / (l + 30);
j2 += 70;
if (flag1) {
j2 /= 2;
}
if (j2 > 0 && rand.nextInt(l1) <= j2
&& (!world.isRaining() || !world.canLightningStrikeAt(i1, k1, j1))
&& !world.canLightningStrikeAt(i1 - 1, k1, z)
&& !world.canLightningStrikeAt(i1 + 1, k1, j1)
&& !world.canLightningStrikeAt(i1, k1, j1 - 1)
&& !world.canLightningStrikeAt(i1, k1, j1 + 1)) {
int k2 = l + rand.nextInt(5) / 4;
if (k2 > 15) {
k2 = 15;
}
setBlockWithTransmutationTarget(world, i1, j1, k1, k2, this);
}
}
}
if (fireChance <= 0) {
continue;
}
fireChance = ((fireChance + 70) / (blockMeta + 30)) + 70;
if (highHumidity) {
fireChance /= 2;
}
if (fireChance <= 0 || rand.nextInt(100) > fireChance
|| (world.isRaining() && world.canLightningStrikeAt(xt, yt, zt))
|| world.canLightningStrikeAt(xt - 1, yt, z)
|| world.canLightningStrikeAt(xt + 1, yt, zt)
|| world.canLightningStrikeAt(xt, yt, zt - 1)
|| world.canLightningStrikeAt(xt, yt, zt + 1)) {
continue;
}
final int targetMeta = Math.min(blockMeta + 1, 15);
setBlockWithTransmutationTarget(world, xt, yt, zt, targetMeta, this);
}
}
}
}
public boolean func_149698_L() {
return false;
}
public int getBlockFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
if (isTransmutationTarget(world.getBlock(x, y, z), (World) world, x, y, z)) {
final Block block = world.getBlock(x, y, z);
if (isTransmutationTarget(block, world, x, y, z)) {
return 100;
}
if (isTransmutationResult(world.getBlock(x, y, z), (World) world, x, y, z)) {
if (isTransmutationResult(block, world, x, y, z)) {
return 0;
}
@@ -255,27 +202,24 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
}
private void tryCatchFire(World world, int x, int y, int z, int strength, Random rand, int meta,
ForgeDirection face) {
int j1 = getBlockFlammability(world, x, y, z, face);
ForgeDirection dir) {
final int blockFlammability = getBlockFlammability(world, x, y, z, dir);
if (rand.nextInt(strength) < j1) {
boolean flag = world.getBlock(x, y, z) == Blocks.tnt;
if (rand.nextInt(strength) >= blockFlammability) {
return;
}
final boolean isTnt = world.getBlock(x, y, z) == Blocks.tnt;
if (rand.nextInt(meta + 10) < 5 && !world.canLightningStrikeAt(x, y, z)) {
int k1 = meta + rand.nextInt(5) / 4;
if (rand.nextInt(meta + 10) < 5 && !world.canLightningStrikeAt(x, y, z)) {
// Newer fires have a higher chance of transmuting
final int nextMeta = Math.max(Math.min(meta + rand.nextInt(5) / 4, 15), 1);
setBlockWithTransmutationTarget(world, x, y, z, nextMeta, this);
} else {
setBlockWithTransmutationTarget(world, x, y, z, 0, Blocks.air);
}
if (k1 > 15) {
k1 = 15;
}
setBlockWithTransmutationTarget(world, x, y, z, k1, this);
} else {
setBlockWithTransmutationTarget(world, x, y, z, 0, Blocks.air);
}
if (flag) {
Blocks.tnt.onBlockDestroyedByPlayer(world, x, y, z, 1);
}
if (isTnt) {
Blocks.tnt.onBlockDestroyedByPlayer(world, x, y, z, 1);
}
}
@@ -300,54 +244,52 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
}
}
/**
* Returns if this block is collidable (only used by Fire). Args: x, y, z
*/
public boolean isCollidable() {
return false;
}
/**
* Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z
*/
@Override
@Deprecated
public boolean canBlockCatchFire(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) {
return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP);
}
@Deprecated
public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_) {
return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP);
public boolean canBlockCatchFire(IBlockAccess w, int x, int y, int z) {
return canCatchFire(w, x, y, z, UP);
}
@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_) {
if (p_149689_5_ instanceof EntityPlayer)
ThaumicTinkerer.log.info("Player: " + ((EntityPlayer) p_149689_5_).getDisplayName() + " placed TT Fire");
@Deprecated
public int func_149846_a(World w, int x, int y, int z, int chance) {
return getChanceToEncourageFire(w, x, y, z, chance, UP);
}
@Override
public void onBlockPlacedBy(World w, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) {
if (entity instanceof EntityPlayer)
ThaumicTinkerer.log.info("Player: " + ((EntityPlayer) entity).getDisplayName() + " placed TT Fire");
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) {
@Override
public boolean canPlaceBlockAt(World w, int x, int y, int z) {
return true;
}
@Override
public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
return getBlockFlammability(world, x, y, z, face) > 0;
}
@Override
public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face) {
int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
final int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face);
return (newChance > oldChance ? newChance : oldChance);
return (Math.max(newChance, oldChance));
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor Block
*/
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !this.canNeighborBurn(world, x, y, z)) {
world.setBlockToAir(x, y, z);
@@ -357,6 +299,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
/**
* Called whenever the block is added into the world. Args: world, x, y, z
*/
@Override
public void onBlockAdded(World world, int x, int y, int z) {
if (world.provider.dimensionId > 0 || !Blocks.portal.func_150000_e(world, x, y, z)) {
world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world) + world.rand.nextInt(10));
@@ -366,13 +309,14 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
/**
* A randomly called display update to be able to add particles or other items for display
*/
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
if (rand.nextInt(24) == 0) {
world.playSound(
(double) ((float) x + 0.5F),
(double) ((float) y + 0.5F),
(double) ((float) z + 0.5F),
x + 0.5F,
y + 0.5F,
z + 0.5F,
"fire.fire",
1.0F + rand.nextFloat(),
rand.nextFloat() * 0.7F + 0.3F,
@@ -388,58 +332,59 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
&& !Blocks.fire.canCatchFire(world, x, y - 1, z, UP)) {
if (Blocks.fire.canCatchFire(world, x - 1, y, z, EAST)) {
for (l = 0; l < 2; ++l) {
f = (float) x + rand.nextFloat() * 0.1F;
f1 = (float) y + rand.nextFloat();
f2 = (float) z + rand.nextFloat();
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat() * 0.1F;
f1 = y + rand.nextFloat();
f2 = z + rand.nextFloat();
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
if (Blocks.fire.canCatchFire(world, x + 1, y, z, WEST)) {
for (l = 0; l < 2; ++l) {
f = (float) (x + 1) - rand.nextFloat() * 0.1F;
f1 = (float) y + rand.nextFloat();
f2 = (float) z + rand.nextFloat();
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = (x + 1) - rand.nextFloat() * 0.1F;
f1 = y + rand.nextFloat();
f2 = z + rand.nextFloat();
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
if (Blocks.fire.canCatchFire(world, x, y, z - 1, SOUTH)) {
for (l = 0; l < 2; ++l) {
f = (float) x + rand.nextFloat();
f1 = (float) y + rand.nextFloat();
f2 = (float) z + rand.nextFloat() * 0.1F;
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat();
f1 = y + rand.nextFloat();
f2 = z + rand.nextFloat() * 0.1F;
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
if (Blocks.fire.canCatchFire(world, x, y, z + 1, NORTH)) {
for (l = 0; l < 2; ++l) {
f = (float) x + rand.nextFloat();
f1 = (float) y + rand.nextFloat();
f2 = (float) (z + 1) - rand.nextFloat() * 0.1F;
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat();
f1 = y + rand.nextFloat();
f2 = (z + 1) - rand.nextFloat() * 0.1F;
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
if (Blocks.fire.canCatchFire(world, x, y + 1, z, DOWN)) {
for (l = 0; l < 2; ++l) {
f = (float) x + rand.nextFloat();
f1 = (float) (y + 1) - rand.nextFloat() * 0.1F;
f2 = (float) z + rand.nextFloat();
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat();
f1 = (y + 1) - rand.nextFloat() * 0.1F;
f2 = z + rand.nextFloat();
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
} else {
for (l = 0; l < 3; ++l) {
f = (float) x + rand.nextFloat();
f1 = (float) y + rand.nextFloat() * 0.5F + 0.5F;
f2 = (float) z + rand.nextFloat();
world.spawnParticle("largesmoke", (double) f, (double) f1, (double) f2, 0.0D, 0.0D, 0.0D);
f = x + rand.nextFloat();
f1 = y + rand.nextFloat() * 0.5F + 0.5F;
f2 = z + rand.nextFloat();
world.spawnParticle(LARGESMOKE, f, f1, f2, 0.0D, 0.0D, 0.0D);
}
}
}
@Override
public MapColor getMapColor(int p_149728_1_) {
return MapColor.tntColor;
}
@@ -469,6 +414,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
return ItemBlockFire.class;
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.icons = new IIcon[] { IconHelper.forName(iconRegister, this.getBlockName() + "_layer_0"),
@@ -497,6 +443,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
itemIcon = IconHelper.forName(iconRegister, s);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getFireIcon(int p_149840_1_) {
return this.icons[p_149840_1_];
@@ -505,19 +452,10 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock
/**
* Gets the block's texture. Args: side, meta
*/
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
return itemIcon;
}
private static class FireInfo {
public int encouragement = 0;
public int flammibility = 0;
public FireInfo(int flammibility, int encouragement) {
this.flammibility = flammibility;
this.encouragement = encouragement;
}
}
}
@@ -2,8 +2,10 @@ package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
@@ -12,7 +14,6 @@ import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -23,6 +24,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
public class BlockFireChaos extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
@Override
public String getBlockName() {
return LibBlockNames.BLOCK_FIRE_CHAOS;
@@ -60,31 +63,26 @@ public class BlockFireChaos extends BlockFireBase {
return 1;
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireAir.class)),
new BlockTuple(Blocks.fire));
result.put(
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireWater.class)),
new BlockTuple(Blocks.fire));
result.put(
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireEarth.class)),
new BlockTuple(Blocks.fire));
result.put(
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireIgnis.class)),
new BlockTuple(Blocks.fire));
result.put(
new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireOrder.class)),
new BlockTuple(Blocks.fire));
return result;
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireAir.class), Blocks.fire);
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireWater.class), Blocks.fire);
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireEarth.class), Blocks.fire);
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireIgnis.class), Blocks.fire);
blockTransformation.put(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireOrder.class), Blocks.fire);
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -2,16 +2,16 @@ package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -22,6 +22,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
public class BlockFireEarth extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
public BlockFireEarth() {
super();
}
@@ -55,33 +57,39 @@ public class BlockFireEarth extends BlockFireBase {
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.EARTH, 5));
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.gravel), new BlockTuple(Blocks.clay));
result.put(new BlockTuple(Blocks.nether_brick), new BlockTuple(Blocks.planks));
result.put(new BlockTuple(Blocks.nether_brick_fence), new BlockTuple(Blocks.fence));
result.put(new BlockTuple(Blocks.nether_brick_stairs), new BlockTuple(Blocks.oak_stairs));
result.put(new BlockTuple(Blocks.cactus), new BlockTuple(Blocks.log));
result.put(new BlockTuple(Blocks.snow_layer), new BlockTuple(Blocks.tallgrass));
result.put(new BlockTuple(Blocks.stone), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.mob_spawner), new BlockTuple(Blocks.iron_block));
result.put(new BlockTuple(Blocks.log), new BlockTuple(Blocks.dirt));
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(Blocks.sand, Blocks.dirt);
blockTransformation.put(Blocks.gravel, Blocks.clay);
blockTransformation.put(Blocks.nether_brick, Blocks.planks);
blockTransformation.put(Blocks.nether_brick_fence, Blocks.fence);
blockTransformation.put(Blocks.nether_brick_stairs, Blocks.oak_stairs);
blockTransformation.put(Blocks.cactus, Blocks.log);
blockTransformation.put(Blocks.snow_layer, Blocks.tallgrass);
blockTransformation.put(Blocks.stone, Blocks.dirt);
blockTransformation.put(Blocks.mob_spawner, Blocks.iron_block);
blockTransformation.put(Blocks.log, Blocks.dirt);
result.put(new BlockTuple(Blocks.log2), new BlockTuple(Blocks.dirt));
blockTransformation.put(Blocks.log2, Blocks.dirt);
result.put(new BlockTuple(Blocks.leaves), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.leaves2), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.cobblestone), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.planks), new BlockTuple(Blocks.dirt));
result.put(new BlockTuple(Blocks.glass), new BlockTuple(Blocks.dirt));
return result;
blockTransformation.put(Blocks.leaves, Blocks.dirt);
blockTransformation.put(Blocks.leaves2, Blocks.dirt);
blockTransformation.put(Blocks.cobblestone, Blocks.dirt);
blockTransformation.put(Blocks.planks, Blocks.dirt);
blockTransformation.put(Blocks.glass, Blocks.dirt);
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -2,16 +2,16 @@ package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -22,6 +22,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
public class BlockFireIgnis extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
@Override
public String getBlockName() {
return LibBlockNames.BLOCK_FIRE_FIRE;
@@ -51,34 +53,40 @@ public class BlockFireIgnis extends BlockFireBase {
new AspectList().add(Aspect.FIRE, 10).add(Aspect.AIR, 5));
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(Blocks.grass), new BlockTuple(Blocks.netherrack));
result.put(new BlockTuple(Blocks.dirt), new BlockTuple(Blocks.netherrack));
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.soul_sand));
result.put(new BlockTuple(Blocks.gravel), new BlockTuple(Blocks.soul_sand));
result.put(new BlockTuple(Blocks.clay), new BlockTuple(Blocks.glowstone));
result.put(new BlockTuple(Blocks.coal_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.iron_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.diamond_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.emerald_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.gold_block), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.lapis_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.redstone_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.lit_redstone_ore), new BlockTuple(Blocks.quartz_ore));
result.put(new BlockTuple(Blocks.water), new BlockTuple(Blocks.lava));
result.put(new BlockTuple(Blocks.wheat), new BlockTuple(Blocks.nether_wart));
result.put(new BlockTuple(Blocks.potatoes), new BlockTuple(Blocks.nether_wart));
result.put(new BlockTuple(Blocks.carrots), new BlockTuple(Blocks.nether_wart));
result.put(new BlockTuple(Blocks.red_flower), new BlockTuple(Blocks.brown_mushroom));
result.put(new BlockTuple(Blocks.yellow_flower), new BlockTuple(Blocks.yellow_flower));
return result;
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(Blocks.grass, Blocks.netherrack);
blockTransformation.put(Blocks.dirt, Blocks.netherrack);
blockTransformation.put(Blocks.sand, Blocks.soul_sand);
blockTransformation.put(Blocks.gravel, Blocks.soul_sand);
blockTransformation.put(Blocks.clay, Blocks.glowstone);
blockTransformation.put(Blocks.coal_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.iron_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.diamond_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.emerald_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.gold_block, Blocks.quartz_ore);
blockTransformation.put(Blocks.lapis_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.redstone_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.lit_redstone_ore, Blocks.quartz_ore);
blockTransformation.put(Blocks.water, Blocks.lava);
blockTransformation.put(Blocks.wheat, Blocks.nether_wart);
blockTransformation.put(Blocks.potatoes, Blocks.nether_wart);
blockTransformation.put(Blocks.carrots, Blocks.nether_wart);
blockTransformation.put(Blocks.red_flower, Blocks.brown_mushroom);
blockTransformation.put(Blocks.yellow_flower, Blocks.yellow_flower);
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -1,26 +1,17 @@
package thaumic.tinkerer.common.block.fire;
import java.util.ArrayList;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -31,15 +22,15 @@ import thaumic.tinkerer.common.research.TTResearchItem;
public class BlockFireOrder extends BlockFireBase {
public HashMap<BlockTuple, BlockTuple> fireResults = new HashMap<BlockTuple, BlockTuple>();
public HashMap<Block, Block> fireResults = new HashMap<>();
private HashMap<Block, Block> oreDictinaryOresCache;
public BlockFireOrder() {
super();
fireResults.put(new BlockTuple(Blocks.stone), null);
fireResults.put(new BlockTuple(Blocks.glass), null);
fireResults.put(new BlockTuple(Blocks.sand), null);
fireResults.put(new BlockTuple(Blocks.gravel), null);
fireResults.put(Blocks.stone, null);
fireResults.put(Blocks.glass, null);
fireResults.put(Blocks.sand, null);
fireResults.put(Blocks.gravel, null);
}
@Override
@@ -72,107 +63,22 @@ public class BlockFireOrder extends BlockFireBase {
}
@Override
public int getDecayChance(World world, int x, int y, int z) {
int dropSize = world.getBlock(x, y, z).getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0).size();
if (dropSize == 2) {
return 2;
}
if (dropSize >= 3) {
return 1;
}
return 3;
}
public HashMap<Block, Block> getOreDictionaryOres() {
if (oreDictinaryOresCache == null) {
HashMap<Block, Block> result = new HashMap<Block, Block>();
for (String ore : OreDictionary.getOreNames()) {
if (ore.startsWith("ore")) {
for (String block : OreDictionary.getOreNames()) {
if (block.startsWith("block") && block.substring(5).equalsIgnoreCase(ore.substring(3))) {
if (OreDictionary.getOres(block).size() > 0 && OreDictionary.getOres(ore).size() > 0) {
result.put(
((ItemBlock) OreDictionary.getOres(ore).get(0).getItem()).field_150939_a,
((ItemBlock) OreDictionary.getOres(block).get(0).getItem()).field_150939_a);
}
}
}
}
}
oreDictinaryOresCache = result;
}
return oreDictinaryOresCache;
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
public HashMap<Block, Block> getBlockTransformation() {
return fireResults;
}
@Override
public boolean isTransmutationResult(BlockTuple block, World w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).values().contains(block);
}
public ItemStack getBlockCraftingResult(World w, ItemStack itemStack) {
InventoryCrafting blockCraftInventory = new InventoryCrafting(new Container() {
@Override
public boolean canInteractWith(EntityPlayer entityPlayer) {
return false;
}
}, 3, 3);
for (int i = 0; i < 9; i++) {
blockCraftInventory.setInventorySlotContents(i, itemStack);
}
return CraftingManager.getInstance().findMatchingRecipe(blockCraftInventory, w);
}
private boolean allEqual(ArrayList<ItemStack> list) {
for (ItemStack o : list) {
if (!o.isItemEqual(list.get(0))) {
return false;
}
}
return true;
public boolean isTransmutationResult(Block block, IBlockAccess w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).containsValue(block);
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation(World w, int x, int y, int z) {
Block block = w.getBlock(x, y, z);
int meta = w.getBlockMetadata(x, y, z);
if (!fireResults.containsKey(new BlockTuple(block, meta))) {
Block result = null;
int resultMeta = 0;
ArrayList<ItemStack> drops = block.getDrops(w, x, y, z, meta, 0);
if (drops.size() > 0 && (drops.size() == 1 || allEqual(drops))) {
ItemStack stack = drops.get(0);
ItemStack blockStack = getBlockCraftingResult(w, stack);
if (blockStack == null) {
ItemStack ingotStack = FurnaceRecipes.smelting().getSmeltingResult(stack);
blockStack = getBlockCraftingResult(w, ingotStack);
}
if (blockStack != null && Block.getBlockFromItem(blockStack.getItem()) != null) {
result = Block.getBlockFromItem(blockStack.getItem());
resultMeta = blockStack.getItemDamage();
}
}
fireResults.put(new BlockTuple(block, meta), new BlockTuple(result, resultMeta));
}
return fireResults;
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
public boolean isTransmutationTarget(BlockTuple block, World w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).keySet().contains(block)
&& getBlockTransformation().get(block) != null
&& getBlockTransformation().get(block).block != null;
@Override
public boolean isTransmutationTarget(Block block, IBlockAccess w, int x, int y, int z) {
return getBlockTransformation(w, x, y, z).containsKey(block) && getBlockTransformation().get(block) != null;
}
}
@@ -2,16 +2,16 @@ package thaumic.tinkerer.common.block.fire;
import java.util.HashMap;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.IBlockAccess;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.core.helper.BlockTuple;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe;
@@ -22,6 +22,8 @@ import thaumic.tinkerer.common.research.TTResearchItem;
public class BlockFireWater extends BlockFireBase {
private static HashMap<Block, Block> blockTransformation = null;
public BlockFireWater() {
super();
}
@@ -55,21 +57,27 @@ public class BlockFireWater extends BlockFireBase {
new AspectList().add(Aspect.FIRE, 5).add(Aspect.MAGIC, 5).add(Aspect.WATER, 5));
}
@Override
public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.ice));
result.put(new BlockTuple(Blocks.netherrack), new BlockTuple(Blocks.snow));
result.put(new BlockTuple(Blocks.soul_sand), new BlockTuple(Blocks.ice));
result.put(new BlockTuple(Blocks.glowstone), new BlockTuple(Blocks.ice));
result.put(new BlockTuple(Blocks.lava), new BlockTuple(Blocks.obsidian));
result.put(new BlockTuple(Blocks.flowing_lava), new BlockTuple(Blocks.obsidian));
return result;
private static void initBlockTransformation() {
blockTransformation = new HashMap<>();
blockTransformation.put(Blocks.sand, Blocks.ice);
blockTransformation.put(Blocks.netherrack, Blocks.snow);
blockTransformation.put(Blocks.soul_sand, Blocks.ice);
blockTransformation.put(Blocks.glowstone, Blocks.ice);
blockTransformation.put(Blocks.lava, Blocks.obsidian);
blockTransformation.put(Blocks.flowing_lava, Blocks.obsidian);
}
@Override
public HashMap<thaumic.tinkerer.common.core.helper.BlockTuple, thaumic.tinkerer.common.core.helper.BlockTuple> getBlockTransformation(
World w, int x, int y, int z) {
public HashMap<Block, Block> getBlockTransformation() {
if (blockTransformation == null) {
initBlockTransformation();
}
return blockTransformation;
}
@Override
public HashMap<Block, Block> getBlockTransformation(IBlockAccess w, int x, int y, int z) {
return getBlockTransformation();
}
}
@@ -21,6 +21,9 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.block.BlockMod;
import thaumic.tinkerer.common.block.tile.kami.TileBedrockPortal;
@@ -31,9 +34,6 @@ import thaumic.tinkerer.common.dim.WorldProviderBedrock;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBedrockPortal extends BlockMod {
@@ -98,6 +98,7 @@ public class BlockBedrockPortal extends BlockMod {
return false;
}
@Override
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
if (par5 != 1 && par5 != 0 && !super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)) {
return false;
@@ -10,6 +10,8 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
@@ -24,8 +26,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockMobilizer extends BlockMod {
@@ -11,6 +11,8 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.config.ConfigBlocks;
@@ -23,8 +25,6 @@ import thaumic.tinkerer.common.lib.LibResearch;
import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockMobilizerRelay extends BlockMod {
@@ -24,6 +24,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.client.core.helper.IconHelper;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.BlockMod;
@@ -35,8 +37,6 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipeMulti;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockDarkQuartz extends BlockMod {
@@ -23,6 +23,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
import thaumic.tinkerer.common.item.quartz.ItemDarkQuartzSlab;
@@ -32,8 +34,6 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock;
import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe;
import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe;
import thaumic.tinkerer.common.research.IRegisterableResearch;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock {
@@ -66,11 +66,6 @@ public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock {
return Item.getItemFromBlock(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class));
}
// @Override
// public int idDropped(int par1, Random par2Random, int par3) {
// return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID;
// }
@Override
public ItemStack createStackedBlock(int par1) {
return new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class));
@@ -14,11 +14,6 @@ package thaumic.tinkerer.common.block.tile;
import java.util.HashMap;
import java.util.Map;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -27,15 +22,19 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
import thaumic.tinkerer.common.lib.LibBlockNames;
import appeng.api.movable.IMovableTile;
import cpw.mods.fml.common.Optional;
import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.peripheral.IPeripheral;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
import thaumic.tinkerer.common.lib.LibBlockNames;
@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") })
@@ -196,7 +195,7 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple
public Object[] getAspectsMethod() {
AspectList aspects = getAspectList();
Map<Double, String> retVals = new HashMap<Double, String>();
Map<Double, String> retVals = new HashMap<>();
if (aspects == null) return new Object[] { retVals };
double i = 1;
for (Aspect aspect : aspects.getAspectsSorted()) retVals.put(i++, aspect.getTag());
@@ -205,7 +204,7 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple
public Object[] getAspectsAmountsMethod() {
AspectList aspects = getAspectList();
Map<String, Double> retVals = new HashMap<String, Double>();
Map<String, Double> retVals = new HashMap<>();
if (aspects == null) return new Object[] { retVals };
for (Aspect aspect : aspects.getAspectsSorted())
retVals.put(aspect.getTag(), (double) aspects.getAmount(aspect));
@@ -28,6 +28,9 @@ import net.minecraftforge.common.util.Constants;
import org.apache.commons.lang3.ArrayUtils;
import appeng.api.movable.IMovableTile;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.Thaumcraft;
@@ -37,9 +40,6 @@ import thaumic.tinkerer.common.core.helper.Tuple4Int;
import thaumic.tinkerer.common.enchantment.core.EnchantmentManager;
import thaumic.tinkerer.common.lib.LibBlockNames;
import thaumic.tinkerer.common.lib.LibFeatures;
import appeng.api.movable.IMovableTile;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
public class TileEnchanter extends TileEntity implements ISidedInventory, IMovableTile {
@@ -49,15 +49,15 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab
private static final String TAG_CURRENT_ASPECTS = "currentAspects";
private static final String TAG_WORKING = "working";
public List<Integer> enchantments = new ArrayList();
public List<Integer> levels = new ArrayList();
public List<Integer> enchantments = new ArrayList<>();
public List<Integer> levels = new ArrayList<>();
public AspectList totalAspects = new AspectList();
public AspectList currentAspects = new AspectList();
public boolean working = false;
ItemStack[] inventorySlots = new ItemStack[2];
private List<Tuple4Int> pillars = new ArrayList();
private List<Tuple4Int> pillars = new ArrayList<>();
public void clearEnchants() {
enchantments.clear();
@@ -141,7 +141,7 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab
AspectList wandAspects = wandItem.getAllVis(wand);
int missing, onWand;
List<Aspect> aspectsThatCanGet = new ArrayList();
List<Aspect> aspectsThatCanGet = new ArrayList<>();
for (Aspect aspect : LibFeatures.PRIMAL_ASPECTS) {
missing = totalAspects.getAmount(aspect) - currentAspects.getAmount(aspect);
@@ -207,8 +207,7 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab
Aspect[] aspectArray = aspects.getAspects();
int arrayLength = aspectArray.length;
for (int i$ = 0; i$ < arrayLength; ++i$) {
Aspect aspect = aspectArray[i$];
for (Aspect aspect : aspectArray) {
int cost = aspects.getAmount(aspect) * 100;
aspectList.add(aspect, cost);
}
@@ -6,11 +6,11 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.util.ForgeDirection;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.mobilizer.BlockMobilizer;
import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.movable.IMovableTile;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.mobilizer.BlockMobilizer;
public class TileEntityMobilizer extends TileEntity {
@@ -67,6 +67,7 @@ public class TileEntityMobilizer extends TileEntity {
}
}
@Override
public void updateEntity() {
// Check for ghost TEs
@@ -4,8 +4,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import thaumic.tinkerer.common.ThaumicTinkerer;
import appeng.api.movable.IMovableTile;
import thaumic.tinkerer.common.ThaumicTinkerer;
public class TileEntityRelay extends TileEntity implements IMovableTile {
@@ -25,6 +25,7 @@ import net.minecraft.util.Facing;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.movable.IMovableTile;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectContainer;
@@ -33,7 +34,6 @@ import thaumcraft.common.blocks.ItemJarFilled;
import thaumcraft.common.tiles.TileJarFillable;
import thaumcraft.common.tiles.TileJarFillableVoid;
import thaumic.tinkerer.common.lib.LibBlockNames;
import appeng.api.movable.IMovableTile;
public class TileFunnel extends TileEntity implements ISidedInventory, IAspectContainer, IMovableTile {
@@ -135,18 +135,6 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo
@Override
public ItemStack getStackInSlot(int i) {
AspectList aspects = getAspects();
// if(inventorySlots[i] != null && inventorySlots[i].itemID == ConfigItems.itemJarFilled.itemID && aspects ==
// null) {
// Aspect filter=((ItemJarFilled)inventorySlots[i].getItem()).getFilter(inventorySlots[i]);
// inventorySlots[i] = new ItemStack(ConfigBlocks.blockJar,1,inventorySlots[i].getItemDamage());
// if(filter!=null)
// {
// if(inventorySlots[i].getTagCompound()==null)
// inventorySlots[i].setTagCompound(new NBTTagCompound());
// inventorySlots[i].getTagCompound().setString("AspectFilter",filter.getTag());
// }
// onInventoryChanged();
// }
return inventorySlots[i];
}
@@ -2,25 +2,24 @@ package thaumic.tinkerer.common.block.tile;
import java.util.*;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.StatCollector;
import thaumcraft.common.entities.golems.EntityGolemBase;
import thaumcraft.common.entities.golems.Marker;
import thaumic.tinkerer.common.core.golems.EnumGolemCores;
import thaumic.tinkerer.common.core.golems.EnumGolemDecorations;
import cpw.mods.fml.common.Optional;
import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.lua.LuaException;
import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.peripheral.IPeripheral;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import thaumcraft.common.entities.golems.EntityGolemBase;
import thaumcraft.common.entities.golems.Marker;
import thaumic.tinkerer.common.core.golems.EnumGolemCores;
import thaumic.tinkerer.common.core.golems.EnumGolemDecorations;
@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") })
@@ -42,10 +41,9 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
EntityGolemBase.class,
AxisAlignedBB
.getBoundingBox(xCoord - 30, yCoord - 30, zCoord - 30, xCoord + 30, yCoord + 30, zCoord + 30));
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
EntityGolemBase entityGolem = (EntityGolemBase) iterator.next();
for (Object o : list) {
EntityGolemBase entityGolem = (EntityGolemBase) o;
if (entityGolem.getUniqueID().equals(golemConnected)) {
this.golem = entityGolem;
@@ -61,7 +59,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
public Object[] getGolemDecorationsImplementation() throws LuaException {
if (golem == null || golem.decoration == null || golem.decoration.length() == 0) return new String[] {};
HashMap<Double, String> decorations = new HashMap<Double, String>();
HashMap<Double, String> decorations = new HashMap<>();
for (int i = 0; i < golem.decoration.length(); i++) {
EnumGolemDecorations golemDec = EnumGolemDecorations.getFromChar(golem.decoration.charAt(i));
if (golemDec == null)
@@ -218,7 +216,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
private Object[] addMarkerImplementation(Map arguments) throws LuaException {
if (golem == null) return new String[] {};
ArrayList<Marker> markers = golem.getMarkers();
if (markers == null) markers = new ArrayList<Marker>();
if (markers == null) markers = new ArrayList<>();
Marker mark = toMarkerImplementation(arguments);
markers.add(mark);
golem.setMarkers(markers);
@@ -226,7 +224,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
}
private Object[] newMarkerImplementation() {
HashMap<String, Object> mark = new HashMap<String, Object>();
HashMap<String, Object> mark = new HashMap<>();
mark.put("posX", xCoord);
mark.put("posY", yCoord);
mark.put("posZ", zCoord);
@@ -240,7 +238,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
private Object[] setMarkersImplementation(Map arguments) throws LuaException {
if (golem == null) return new String[] {};
ArrayList<Marker> arrList = new ArrayList<Marker>();
ArrayList<Marker> arrList = new ArrayList<>();
for (Object map : arguments.values()) {
Marker mark = toMarkerImplementation((Map) map);
@@ -268,7 +266,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
private Object[] getMarkersImplementation() {
if (golem == null) return new String[] {};
ArrayList<Marker> markers = golem.getMarkers();
HashMap<Integer, HashMap<String, Object>> luaMarkers = new HashMap<Integer, HashMap<String, Object>>();
HashMap<Integer, HashMap<String, Object>> luaMarkers = new HashMap<>();
int i = 1;
for (Marker mark : markers) {
HashMap<String, Object> luaMarker = fromMarkerImplementation(mark);
@@ -282,7 +280,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC
* @return
*/
private HashMap<String, Object> fromMarkerImplementation(Marker mark) {
HashMap<String, Object> luaMarker = new HashMap<String, Object>();
HashMap<String, Object> luaMarker = new HashMap<>();
luaMarker.put("posX", mark.x);
luaMarker.put("posY", mark.y);
@@ -13,11 +13,6 @@ package thaumic.tinkerer.common.block.tile;
import java.util.List;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
@@ -25,14 +20,18 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.codechicken.lib.vec.Vector3;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.helper.MiscHelper;
import appeng.api.movable.IMovableTile;
import cpw.mods.fml.common.Optional;
import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.peripheral.IPeripheral;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import thaumcraft.codechicken.lib.vec.Vector3;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.helper.MiscHelper;
@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") })
@@ -80,13 +79,7 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile,
}
IEntitySelector getEntitySelector() {
return new IEntitySelector() {
@Override
public boolean isEntityApplicable(Entity entity) {
return entity instanceof EntityItem;
}
};
return entity -> entity instanceof EntityItem;
}
@Override
@@ -11,12 +11,7 @@
*/
package thaumic.tinkerer.common.block.tile;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
@@ -29,12 +24,15 @@ import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraftforge.common.util.Constants;
import thaumic.tinkerer.common.item.ItemSoulMould;
import thaumic.tinkerer.common.lib.LibBlockNames;
import appeng.api.movable.IMovableTile;
import cpw.mods.fml.common.Optional;
import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.peripheral.IComputerAccess;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import thaumic.tinkerer.common.item.ItemSoulMould;
import thaumic.tinkerer.common.lib.LibBlockNames;
public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTile {
@@ -44,24 +42,20 @@ public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTil
@Override
IEntitySelector getEntitySelector() {
return new IEntitySelector() {
return entity -> {
if (!(entity instanceof EntityLivingBase) || entity instanceof EntityPlayer) return false;
@Override
public boolean isEntityApplicable(Entity entity) {
if (!(entity instanceof EntityLivingBase) || entity instanceof EntityPlayer) return false;
boolean can = false;
if (entity instanceof EntityAgeable) can = adult != ((EntityAgeable) entity).isChild();
else can = true;
boolean can = false;
if (entity instanceof EntityAgeable) can = adult != ((EntityAgeable) entity).isChild();
else can = true;
if (can && inventorySlots[0] != null) {
String pattern = ItemSoulMould.getPatternName(inventorySlots[0]);
String name = EntityList.getEntityString(entity);
return name != null && name.equals(pattern);
}
return can;
if (can && inventorySlots[0] != null) {
String pattern = ItemSoulMould.getPatternName(inventorySlots[0]);
String name = EntityList.getEntityString(entity);
return name != null && name.equals(pattern);
}
return can;
};
}
@@ -25,6 +25,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.ForgeDirection;
import appeng.api.movable.IMovableTile;
import cpw.mods.fml.common.Loader;
import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
@@ -34,15 +36,13 @@ import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.compat.TinkersConstructCompat;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.lib.LibBlockNames;
import appeng.api.movable.IMovableTile;
import cpw.mods.fml.common.Loader;
/* import thaumic.tinkerer.common.compat.TinkersConstructCompat; */
public class TileRepairer extends TileEntity
implements ISidedInventory, IAspectContainer, IEssentiaTransport, IMovableTile {
private static final Map<Aspect, Integer> repairValues = new HashMap();
private static final Map<Aspect, Integer> repairValues = new HashMap<>();
static {
repairValues.put(Aspect.TOOL, 8);
@@ -25,7 +25,7 @@ public class TileSummon extends TileEntity {
return;
}
for (int radius = 1; radius < 6; radius++) {
ArrayList<TileEntity> pedestals = new ArrayList<TileEntity>();
ArrayList<TileEntity> pedestals = new ArrayList<>();
for (int x = xCoord - radius; x <= xCoord + radius; x++) {
for (int z = zCoord - radius; z <= zCoord + radius; z++) {
TileEntity tile = worldObj.getTileEntity(x, yCoord, z);
@@ -38,13 +38,13 @@ public class TileSummon extends TileEntity {
for (int i = 0; i < pedestals.size(); i++) {
for (int j = 0; j < pedestals.size(); j++) {
for (int k = 0; k < pedestals.size(); k++) {
for (TileEntity pedestal : pedestals) {
TilePedestal ped1 = (TilePedestal) pedestals.get(i);
TilePedestal ped2 = (TilePedestal) pedestals.get(j);
TilePedestal ped3 = (TilePedestal) pedestals.get(k);
TilePedestal ped3 = (TilePedestal) pedestal;
if ((ped1 != ped2) && (ped2 != ped3) && (ped1 != ped3)) {
ArrayList<Aspect> aspects = new ArrayList<Aspect>();
ArrayList<Aspect> aspects = new ArrayList<>();
aspects.add(ItemMobAspect.getAspect(ped1.getStackInSlot(0)));
aspects.add(ItemMobAspect.getAspect(ped2.getStackInSlot(0)));
@@ -1,6 +1,5 @@
package thaumic.tinkerer.common.block.tile;
import java.util.Iterator;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
@@ -24,10 +23,12 @@ public class TileWardedSlab extends TileEntity {
return this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord);
}
@Override
public boolean canUpdate() {
return true;
}
@Override
public void updateEntity() {
if (!this.worldObj.isRemote) {
if (this.count == 0) {
@@ -45,10 +46,9 @@ public class TileWardedSlab extends TileEntity {
(double) (this.yCoord + 3),
(double) (this.zCoord + 1)).expand(0.1D, 0.1D, 0.1D));
if (targets.size() > 0) {
Iterator i$ = targets.iterator();
while (i$.hasNext()) {
EntityLivingBase e = (EntityLivingBase) i$.next();
for (Object target : targets) {
EntityLivingBase e = (EntityLivingBase) target;
if (!e.onGround && !(e instanceof EntityPlayer)) {
e.addVelocity(
(double) (-MathHelper.sin((e.rotationYaw + 180.0F) * 3.1415927F / 180.0F) * 0.2F),
@@ -42,7 +42,7 @@ public class ContainerIchorPouch extends ContainerPlayerInv {
if (!player.worldObj.isRemote) try {
((InventoryIchorPouch) inv).stackList = ((ItemFocusPouch) pouch.getItem()).getInventory(pouch);
} catch (Exception e) {}
} catch (Exception ignored) {}
}
@Override
@@ -73,22 +73,31 @@ public class ContainerIchorPouch extends ContainerPlayerInv {
if (par1 == blockSlot) {
return null;
}
return super.slotClick(par1, par2, par3, par4EntityPlayer);
ItemStack stack = super.slotClick(par1, par2, par3, par4EntityPlayer);
if (!this.player.worldObj.isRemote) {
saveInventory();
}
return stack;
}
@Override
public void onContainerClosed(EntityPlayer par1EntityPlayer) {
super.onContainerClosed(par1EntityPlayer);
if (!player.worldObj.isRemote) {
((ItemFocusPouch) pouch.getItem()).setInventory(pouch, ((InventoryIchorPouch) inv).stackList);
if (player == null) return;
if (player.getHeldItem() != null && player.getHeldItem().isItemEqual(pouch))
player.setCurrentItemOrArmor(0, pouch);
player.inventory.markDirty();
saveInventory();
}
}
private void saveInventory() {
((ItemFocusPouch) pouch.getItem()).setInventory(pouch, ((InventoryIchorPouch) inv).stackList);
if (player == null) return;
if (player.getHeldItem() != null && player.getHeldItem().isItemEqual(pouch))
player.setCurrentItemOrArmor(0, pouch);
player.inventory.markDirty();
}
@Override
public boolean canInteractWith(EntityPlayer entityplayer) {
return true;
@@ -18,10 +18,10 @@ import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
import thaumcraft.common.lib.FakeThaumcraftPlayer;
import com.mojang.authlib.GameProfile;
import thaumcraft.common.lib.FakeThaumcraftPlayer;
public class TabletFakePlayer extends FakeThaumcraftPlayer {
TileAnimationTablet tablet;
@@ -14,11 +14,6 @@ package thaumic.tinkerer.common.block.tile.tablet;
import java.util.ArrayList;
import java.util.List;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
@@ -44,9 +39,6 @@ import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.BlockAnimationTablet;
import thaumic.tinkerer.common.lib.LibBlockNames;
import appeng.api.movable.IMovableTile;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.eventhandler.Event;
@@ -54,6 +46,13 @@ import dan200.computercraft.api.lua.ILuaContext;
import dan200.computercraft.api.lua.LuaException;
import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.peripheral.IPeripheral;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.BlockAnimationTablet;
import thaumic.tinkerer.common.lib.LibBlockNames;
@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") })
@@ -76,7 +75,7 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
public boolean leftClick = true;
public boolean redstone = false;
public int swingProgress = 0;
List<Entity> detectedEntities = new ArrayList();
List<Entity> detectedEntities = new ArrayList<>();
ItemStack[] inventorySlots = new ItemStack[1];
// public String Owner;
TabletFakePlayer player;
@@ -137,11 +136,6 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
Block block = worldObj.getBlock(coords.posX, coords.posY, coords.posZ);
player.setCurrentItemOrArmor(0, stack);
// EntityPlayer realPlayer=MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(Owner);
// NBTTagCompound data=realPlayer.getEntityData().getCompoundTag("PlayerPersisted");
// player.getEntityData().setCompoundTag("PlayerPersisted",data);
// NBTTagCompound cmp=player.getEntityData().getCompoundTag("PlayerPersisted");
// System.out.println(cmp.getCompoundTag("TCResearch").getTagList("TCResearchList").tagCount());
boolean done = false;
@@ -413,10 +407,6 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
swingProgress = par1NBTTagCompound.getInteger(TAG_PROGRESS);
// if(par1NBTTagCompound.hasKey(TAG_OWNER))
// Owner=par1NBTTagCompound.getString(TAG_OWNER);
// else
// Owner="";
readCustomNBT(par1NBTTagCompound);
}
@@ -433,14 +423,6 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
public void readCustomNBT(NBTTagCompound par1NBTTagCompound) {
leftClick = par1NBTTagCompound.getBoolean(TAG_LEFT_CLICK);
redstone = par1NBTTagCompound.getBoolean(TAG_REDSTONE);
// if(par1NBTTagCompound.hasKey("isBreaking"))
// isBreaking = par1NBTTagCompound.getBoolean("isBreaking");
// if(par1NBTTagCompound.hasKey("initialDamage"))
// initialDamage = par1NBTTagCompound.getInteger("initialDamage");
// if(par1NBTTagCompound.hasKey("curblockDamage"))
// curblockDamage = par1NBTTagCompound.getInteger("curblockDamage");
// if(par1NBTTagCompound.hasKey("durabilityRemainingOnBlock"))
// durabilityRemainingOnBlock=par1NBTTagCompound.getInteger("durabilityRemainingOnBlock");
NBTTagList var2 = par1NBTTagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
inventorySlots = new ItemStack[getSizeInventory()];
for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
@@ -453,10 +435,6 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
public void writeCustomNBT(NBTTagCompound par1NBTTagCompound) {
par1NBTTagCompound.setBoolean(TAG_LEFT_CLICK, leftClick);
par1NBTTagCompound.setBoolean(TAG_REDSTONE, redstone);
// par1NBTTagCompound.setBoolean("isBreaking",isBreaking);
// par1NBTTagCompound.setInteger("initialDamage", initialDamage);
// par1NBTTagCompound.setInteger("curblockDamage",curblockDamage);
// par1NBTTagCompound.setInteger("durabilityRemainingOnBlock",durabilityRemainingOnBlock);
NBTTagList var2 = new NBTTagList();
for (int var3 = 0; var3 < inventorySlots.length; ++var3) {
if (inventorySlots[var3] != null) {
@@ -205,10 +205,6 @@ public class TileTransvectorDislocator extends TileTransvector {
tile.updateContainingBlockInfo();
}
// if (block != null)
// block.onNeighborBlockChange(worldObj, coords.posX, coords.posY, coords.posZ,
// ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTransvectorDislocator.class));
worldObj.setBlockMetadataWithNotify(coords.posX, coords.posY, coords.posZ, meta, 2);
}
@@ -22,12 +22,6 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectContainer;
import thaumcraft.api.aspects.IEssentiaTransport;
import thaumic.tinkerer.common.compat.IndustrialcraftUnloadHelper;
import thaumic.tinkerer.common.lib.LibFeatures;
import cofh.api.energy.IEnergyHandler;
import cofh.api.energy.IEnergyProvider;
import cofh.api.energy.IEnergyReceiver;
@@ -38,6 +32,12 @@ import dan200.computercraft.api.lua.LuaException;
import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.peripheral.IPeripheral;
import ic2.api.energy.tile.*;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectContainer;
import thaumcraft.api.aspects.IEssentiaTransport;
import thaumic.tinkerer.common.compat.IndustrialcraftUnloadHelper;
import thaumic.tinkerer.common.lib.LibFeatures;
@Optional.InterfaceList({
@Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft"),
@@ -344,8 +344,6 @@ public class TileTransvectorInterface extends TileTransvector
@Override
public boolean isConnectable(ForgeDirection forgeDirection) {
// TileEntity tile = getTile();
// return tile instanceof IEssentiaTransport && ((IEssentiaTransport) tile).isConnectable(forgeDirection);
return true;
}
@@ -10,11 +10,11 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumic.tinkerer.common.item.foci.ItemFocusEnderChest;
import codechicken.enderstorage.api.EnderStorageManager;
import codechicken.enderstorage.storage.item.EnderItemStorage;
import codechicken.enderstorage.storage.item.TileEnderChest;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumic.tinkerer.common.item.foci.ItemFocusEnderChest;
public class EnderStorageFunctions {
@@ -7,15 +7,15 @@ import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.event.TextureStitchEvent;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.BlockGas;
import thaumic.tinkerer.common.item.ItemGasRemover;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import dan200.computercraft.api.peripheral.IPeripheral;
import dan200.computercraft.api.turtle.*;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.BlockGas;
import thaumic.tinkerer.common.item.ItemGasRemover;
/**
* Created by Katrina on 04/02/2015.
@@ -2,10 +2,10 @@ package thaumic.tinkerer.common.compat;
import net.minecraftforge.common.MinecraftForge;
import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface;
import ic2.api.energy.event.EnergyTileLoadEvent;
import ic2.api.energy.event.EnergyTileUnloadEvent;
import ic2.api.energy.tile.IEnergySink;
import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface;
/**
* Created by pixlepix on 8/26/14.
@@ -7,18 +7,17 @@ import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.BlockInfusedFarmland;
import thaumic.tinkerer.common.block.BlockInfusedGrain;
import thaumic.tinkerer.common.block.tile.TileInfusedGrain;
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
import com.enderio.core.common.compat.ICompat;
import com.enderio.core.common.util.BlockCoord;
import crazypants.enderio.machine.farm.TileFarmStation;
import crazypants.enderio.machine.farm.farmers.IHarvestResult;
import crazypants.enderio.machine.farm.farmers.PlantableFarmer;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.BlockInfusedFarmland;
import thaumic.tinkerer.common.block.BlockInfusedGrain;
import thaumic.tinkerer.common.block.tile.TileInfusedGrain;
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
/**
* Created by katsw on 02/02/2016.
@@ -2,10 +2,6 @@ package thaumic.tinkerer.common.compat;
import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -13,6 +9,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import thaumic.tinkerer.common.block.tile.TileMagnet;
import thaumic.tinkerer.common.block.tile.TileMobMagnet;
import thaumic.tinkerer.common.item.ItemSoulMould;
@@ -2,11 +2,6 @@ package thaumic.tinkerer.common.compat;
import java.util.List;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -14,6 +9,10 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import mcp.mobius.waila.api.IWailaRegistrar;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.block.BlockAnimationTablet;
import thaumic.tinkerer.common.block.BlockMagnet;
@@ -48,14 +48,10 @@ public class KamiUnlockedCommand extends CommandBase {
((EntityPlayer) icommandsender).addChatComponentMessage(new ChatComponentText("Yes"));
else {
((EntityPlayer) icommandsender).addChatComponentMessage(new ChatComponentText("No"));
List<String> list = new ArrayList<String>(parents);
List<String> list = new ArrayList<>(parents);
list.removeAll(unlocked);
((EntityPlayer) icommandsender)
.addChatComponentMessage(new ChatComponentText("Remaining: " + StringUtils.join(list, ',')));
// EntityPlayer player=(EntityPlayer)icommandsender;
// EntityGiantBrainyZombie bat=new EntityGiantBrainyZombie(player.worldObj);
// bat.setPositionAndRotation(player.posX,player.posY,player.posZ,1,1);
// player.worldObj.spawnEntityInWorld(bat);
}
}
@@ -12,7 +12,6 @@
package thaumic.tinkerer.common.core.handler;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.minecraft.block.Block;
@@ -33,7 +32,7 @@ public class ModCreativeTab extends CreativeTabs {
public static ModCreativeTab INSTANCE;
// Holds the registered items and blocks before they are sorted
public ArrayList<ItemStack> creativeTabQueue = new ArrayList<ItemStack>();
public ArrayList<ItemStack> creativeTabQueue = new ArrayList<>();
ItemStack displayItem;
List list = new ArrayList();
@@ -92,7 +91,7 @@ public class ModCreativeTab extends CreativeTabs {
}
public void addAllItemsAndBlocks() {
Collections.sort(creativeTabQueue, new ItemStackCompatator());
creativeTabQueue.sort(new ItemStackCompatator());
list.addAll(creativeTabQueue);
}
}
@@ -18,10 +18,10 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import thaumic.tinkerer.common.item.kami.ItemKamiResource;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class DimensionalShardDropHandler {
@@ -4,8 +4,8 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import thaumic.tinkerer.common.item.kami.tool.ItemIchorPickAdv;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import thaumic.tinkerer.common.item.kami.tool.ItemIchorPickAdv;
/**
* Created by Katrina on 31/03/14.
@@ -20,10 +20,10 @@ import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.lib.LibMisc;
import thaumic.tinkerer.common.network.packet.kami.PacketSoulHearts;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class SoulHeartHandler {
@@ -26,7 +26,7 @@ import thaumic.tinkerer.common.item.ItemInfusedGrain;
*/
public class AspectCropLootManager {
private static HashMap<Aspect, HashMap<ItemStack, Integer>> lootMap = new HashMap<Aspect, HashMap<ItemStack, Integer>>();
private static HashMap<Aspect, HashMap<ItemStack, Integer>> lootMap = new HashMap<>();
public static ItemStack getLootForAspect(Aspect aspect) {
HashMap<ItemStack, Integer> aspectHashmap = lootMap.get(aspect);
@@ -41,10 +41,10 @@ public class AspectCropLootManager {
Random rand = new Random();
int randInt = rand.nextInt(sum);
for (Map.Entry<ItemStack, Integer> pair : aspectHashmap.entrySet()) {
randInt -= pair.getValue();
if (randInt <= 0) {
return pair.getKey().copy();
}
randInt -= pair.getValue();
}
}
return null;
@@ -84,7 +84,7 @@ public class AspectCropLootManager {
public static void populateLootMap() {
for (Aspect a : Aspect.aspects.values()) {
lootMap.put(a, new HashMap<ItemStack, Integer>());
lootMap.put(a, new HashMap<>());
}
addAspectLoot(
Aspect.AIR,
@@ -118,7 +118,7 @@ public class AspectCropLootManager {
addAspectLoot(Aspect.ELDRITCH, new ItemStack(Items.ender_eye, 4), 5);
addAspectLoot(Aspect.ELDRITCH, "bucketEnder");
addAspectLoot(Aspect.TREE, "wood");
// addAspectLoot(Aspect.TREE, "wood");
addAspectLoot(Aspect.TREE, new ItemStack(Blocks.log));
@@ -1,35 +0,0 @@
package thaumic.tinkerer.common.core.helper;
import net.minecraft.block.Block;
/**
* Created by pixlepix on 9/28/14.
*/
public class BlockTuple {
public Block block;
public int meta;
public BlockTuple(Block b, int meta) {
this.block = b;
this.meta = meta;
}
public BlockTuple(Block b) {
this.block = b;
this.meta = 0;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof BlockTuple)) {
return false;
}
return ((BlockTuple) obj).block == block && ((BlockTuple) obj).meta == meta;
}
@Override
public int hashCode() {
return block.hashCode() + meta;
}
}
@@ -4,11 +4,11 @@ import net.minecraft.block.IGrowable;
import net.minecraftforge.event.entity.player.BonemealEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigItems;
import thaumic.tinkerer.common.block.BlockInfusedGrain;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
/**
* Created by pixlepix on 8/28/14.
@@ -9,6 +9,8 @@ import net.minecraft.entity.passive.*;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import com.google.common.collect.Maps;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.InfusionRecipe;
@@ -22,8 +24,6 @@ import thaumic.tinkerer.common.item.ItemMobAspect;
import thaumic.tinkerer.common.item.ItemMobDisplay;
import thaumic.tinkerer.common.lib.LibResearch;
import com.google.common.collect.Maps;
public enum EnumMobAspect {
SnowMan(EntitySnowman.class, new Aspect[] { Aspect.WATER, Aspect.WATER, Aspect.MAN }),
@@ -23,7 +23,7 @@ public class FakeContainerCrafting extends Container {
return false;
}
private class FakeInventory implements IInventory {
private static class FakeInventory implements IInventory {
ItemStack itemStack;
@@ -81,10 +81,6 @@ public final class ItemNBTHelper {
getNBT(stack).setTag(tag, cmp);
}
// public static void setCompound(ItemStack stack, NBTTagCompound cmp) {
// setCompound(stack, cmp, cmp);
// }
public static void setString(ItemStack stack, String tag, String s) {
getNBT(stack).setString(tag, s);
}
@@ -20,7 +20,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.BlockEvent;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.codechicken.lib.vec.Vector3;
import thaumic.tinkerer.common.ThaumicTinkerer;
@@ -67,8 +66,7 @@ public final class MiscHelper {
AspectList newList = list.copy();
if (multiplier == 1) return newList;
for (Aspect aspect : newList.aspects.keySet())
newList.aspects.put(aspect, (int) ((double) newList.aspects.get(aspect) * multiplier));
newList.aspects.replaceAll((a, v) -> (int) ((double) newList.aspects.get(a) * multiplier));
return newList;
}
@@ -6,7 +6,7 @@ import thaumcraft.api.aspects.Aspect;
public class NumericAspectHelper {
public static ArrayList<NumericAspectHelper> values = new ArrayList<NumericAspectHelper>();
public static ArrayList<NumericAspectHelper> values = new ArrayList<>();
private static int nextNum = 0;
public int num;
private Aspect aspect;
@@ -7,13 +7,13 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityThrowable;
import thaumcraft.common.entities.projectile.EntityFrostShard;
import com.google.common.base.Function;
import thaumcraft.common.entities.projectile.EntityFrostShard;
public final class ProjectileHelper {
private static Map<Class<? extends Entity>, Function<Entity, Entity>> ownerGetters = new IdentityHashMap<Class<? extends Entity>, Function<Entity, Entity>>();
private static Map<Class<? extends Entity>, Function<Entity, Entity>> ownerGetters = new IdentityHashMap<>();
public static Entity getOwner(Entity projectile) {
Function<Entity, Entity> ownerGetterForClass = ownerGetters.get(projectile.getClass());
@@ -62,7 +62,7 @@ public class ReflectionHelper {
while (clazz != null) {
try {
return clazz.getDeclaredMethod(name, argsTypes);
} catch (NoSuchMethodException e) {} catch (Exception e) {
} catch (NoSuchMethodException ignored) {} catch (Exception e) {
throw Throwables.propagate(e);
}
clazz = clazz.getSuperclass();
Loaded 100 of 198 files, more files were not shown because too many files have changed in this diff. Show more