mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 19:39:12 +00:00
Split more files into parts
This commit is contained in:
1 parent
e2f0558b6f
commit
5a87c102ea
61 files changed
+1365
-1499
No files matched your search
@@ -1,5 +1,7 @@
|
||||
package tconstruct;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import mantle.lib.TabTools;
|
||||
import mantle.module.ModuleController;
|
||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||
@@ -8,7 +10,6 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.client.TControls;
|
||||
import tconstruct.client.event.EventCloakRender;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
@@ -18,9 +19,6 @@ import tconstruct.library.crafting.LiquidCasting;
|
||||
import tconstruct.mechworks.landmine.behavior.Behavior;
|
||||
import tconstruct.mechworks.landmine.behavior.stackCombo.SpecialStackHandler;
|
||||
import tconstruct.util.EnvironmentChecks;
|
||||
import tconstruct.util.TCraftingHandler;
|
||||
import tconstruct.util.TEventHandler;
|
||||
import tconstruct.util.TEventHandlerAchievement;
|
||||
import tconstruct.util.config.DimensionBlacklist;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.util.network.packet.PacketPipeline;
|
||||
@@ -83,6 +81,8 @@ public class TConstruct
|
||||
|
||||
// The packet pipeline
|
||||
public static final PacketPipeline packetPipeline = new PacketPipeline();
|
||||
|
||||
public static Random random = new Random();
|
||||
|
||||
public TConstruct()
|
||||
{
|
||||
@@ -99,7 +99,6 @@ public class TConstruct
|
||||
}
|
||||
|
||||
EnvironmentChecks.verifyEnvironmentSanity();
|
||||
MinecraftForge.EVENT_BUS.register(events = new TEventHandler());
|
||||
//PluginController.registerModules();
|
||||
}
|
||||
|
||||
@@ -117,21 +116,10 @@ public class TConstruct
|
||||
basinCasting = new LiquidCasting();
|
||||
chiselDetailing = new Detailing();
|
||||
|
||||
events = new TEventHandler();
|
||||
MinecraftForge.EVENT_BUS.register(events);
|
||||
MinecraftForge.EVENT_BUS.register(new TEventHandlerAchievement());
|
||||
|
||||
proxy.registerRenderer();
|
||||
proxy.addNames();
|
||||
proxy.readManuals();
|
||||
proxy.registerKeys();
|
||||
proxy.registerTickHandler();
|
||||
|
||||
GameRegistry.registerWorldGenerator(new TBaseWorldGenerator(), 0);
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(new TerrainGenEventHandler());
|
||||
//GameRegistry.registerFuelHandler(content);
|
||||
FMLCommonHandler.instance().bus().register(new TCraftingHandler());
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
|
||||
//NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
|
||||
|
||||
if (PHConstruct.addToVillages)
|
||||
{
|
||||
@@ -177,18 +165,12 @@ public class TConstruct
|
||||
DimensionBlacklist.getBadBimensions();
|
||||
GameRegistry.registerWorldGenerator(new SlimeIslandGen(TinkerWorld.slimePool, 2), 2);
|
||||
|
||||
if (PHConstruct.achievementsEnabled)
|
||||
{
|
||||
TAchievements.init();
|
||||
}
|
||||
|
||||
moduleLoader.init();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit (FMLPostInitializationEvent evt)
|
||||
{
|
||||
proxy.postInit();
|
||||
packetPipeline.postInitialise();
|
||||
Behavior.registerBuiltInBehaviors();
|
||||
SpecialStackHandler.registerBuiltInStackHandlers();
|
||||
@@ -211,7 +193,6 @@ public class TConstruct
|
||||
return chiselDetailing;
|
||||
}
|
||||
|
||||
public static TEventHandler events;
|
||||
public static TPlayerHandler playerTracker;
|
||||
public static LiquidCasting tableCasting;
|
||||
public static LiquidCasting basinCasting;
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package tconstruct.achievements;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.AchievementPage;
|
||||
|
||||
public class TAchievements
|
||||
{
|
||||
|
||||
// Add achievements in here before the load executes(end of TC's init event)
|
||||
public static HashMap<String, Achievement> achievements = new HashMap<String, Achievement>();
|
||||
|
||||
// Warning: Will be null until after the init stage
|
||||
public static AchievementPage achievementPage = null;
|
||||
|
||||
public static void init ()
|
||||
{
|
||||
Achievement[] achs = achievements.values().toArray(new Achievement[0]);
|
||||
|
||||
for (Achievement a : achs)
|
||||
{
|
||||
a.registerStat();
|
||||
}
|
||||
|
||||
achievementPage = new AchievementPage(StatCollector.translateToLocal("tconstruct.achievementPage.name"), achs);
|
||||
|
||||
AchievementPage.registerAchievementPage(achievementPage);
|
||||
}
|
||||
|
||||
}
|
||||
+115
-118
@@ -1,96 +1,138 @@
|
||||
package tconstruct.client;
|
||||
package tconstruct.armor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.GuiIngameForge;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.model.WingModel;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import tconstruct.client.TControls;
|
||||
import tconstruct.client.TKeyHandler;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.client.gui.AdaptiveSmelteryGui;
|
||||
import tconstruct.client.gui.ArmorExtendedGui;
|
||||
import tconstruct.client.gui.CraftingStationGui;
|
||||
import tconstruct.client.gui.FrypanGui;
|
||||
import tconstruct.client.gui.FurnaceGui;
|
||||
import tconstruct.client.gui.GuiLandmine;
|
||||
import tconstruct.client.gui.KnapsackGui;
|
||||
import tconstruct.client.gui.PartCrafterGui;
|
||||
import tconstruct.client.gui.PatternChestGui;
|
||||
import tconstruct.client.gui.SmelteryGui;
|
||||
import tconstruct.client.gui.StencilTableGui;
|
||||
import tconstruct.client.gui.ToolForgeGui;
|
||||
import tconstruct.client.gui.ToolStationGui;
|
||||
import tconstruct.client.tabs.InventoryTabArmorExtended;
|
||||
import tconstruct.client.tabs.InventoryTabKnapsack;
|
||||
import tconstruct.client.tabs.InventoryTabVanilla;
|
||||
import tconstruct.client.tabs.TabRegistry;
|
||||
import tconstruct.mechworks.MechworksProxyCommon;
|
||||
import tconstruct.mechworks.inventory.ContainerLandmine;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import tconstruct.smeltery.SmelteryProxyCommon;
|
||||
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;
|
||||
import tconstruct.smeltery.logic.SmelteryLogic;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.CraftingStationLogic;
|
||||
import tconstruct.tools.logic.FrypanLogic;
|
||||
import tconstruct.tools.logic.FurnaceLogic;
|
||||
import tconstruct.tools.logic.PartBuilderLogic;
|
||||
import tconstruct.tools.logic.PatternChestLogic;
|
||||
import tconstruct.tools.logic.StencilTableLogic;
|
||||
import tconstruct.tools.logic.ToolForgeLogic;
|
||||
import tconstruct.tools.logic.ToolStationLogic;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class TClientEvents
|
||||
public class ArmorProxyClient extends ArmorProxyCommon
|
||||
{
|
||||
public ArmorProxyClient()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (ID == ArmorProxyCommon.inventoryGui)
|
||||
{
|
||||
GuiInventory inventory = new GuiInventory(player);
|
||||
TabRegistry.addTabsToInventory(inventory);
|
||||
return inventory;
|
||||
}
|
||||
if (ID == ArmorProxyCommon.armorGuiID)
|
||||
{
|
||||
TProxyClient.armorExtended.init(Minecraft.getMinecraft().thePlayer);
|
||||
return new ArmorExtendedGui(player.inventory, TProxyClient.armorExtended);
|
||||
}
|
||||
if (ID == ArmorProxyCommon.knapsackGuiID)
|
||||
{
|
||||
TProxyClient.knapsack.init(Minecraft.getMinecraft().thePlayer);
|
||||
return new KnapsackGui(player.inventory, TProxyClient.knapsack);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTickHandler ()
|
||||
{
|
||||
FMLCommonHandler.instance().bus().register(new ArmorTickHandler());
|
||||
new ArmorTickHandler();
|
||||
}
|
||||
|
||||
/* Keybindings */
|
||||
public static TControls controlInstance;
|
||||
|
||||
@Override
|
||||
public void registerKeys ()
|
||||
{
|
||||
controlInstance = new TControls();
|
||||
uploadKeyBindingsToGame(Minecraft.getMinecraft().gameSettings, controlInstance);
|
||||
|
||||
TabRegistry.registerTab(new InventoryTabVanilla());
|
||||
TabRegistry.registerTab(new InventoryTabArmorExtended());
|
||||
TabRegistry.registerTab(new InventoryTabKnapsack());
|
||||
}
|
||||
|
||||
public void uploadKeyBindingsToGame (GameSettings settings, TKeyHandler keyhandler)
|
||||
{
|
||||
ArrayList<KeyBinding> harvestedBindings = Lists.newArrayList();
|
||||
for (KeyBinding kb : keyhandler.keyBindings)
|
||||
{
|
||||
harvestedBindings.add(kb);
|
||||
}
|
||||
|
||||
KeyBinding[] modKeyBindings = harvestedBindings.toArray(new KeyBinding[harvestedBindings.size()]);
|
||||
KeyBinding[] allKeys = new KeyBinding[settings.keyBindings.length + modKeyBindings.length];
|
||||
System.arraycopy(settings.keyBindings, 0, allKeys, 0, settings.keyBindings.length);
|
||||
System.arraycopy(modKeyBindings, 0, allKeys, settings.keyBindings.length, modKeyBindings.length);
|
||||
settings.keyBindings = allKeys;
|
||||
settings.loadOptions();
|
||||
}
|
||||
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
/* Sounds */
|
||||
|
||||
boolean initSounds;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSound (SoundLoadEvent event)
|
||||
{
|
||||
if (!initSounds)
|
||||
{
|
||||
initSounds = true;
|
||||
try
|
||||
{
|
||||
/*
|
||||
* SoundManager soundmanager = event.manager;
|
||||
* soundmanager.addSound("tinker:frypan_hit.ogg");
|
||||
* soundmanager.addSound("tinker:little_saw.ogg");
|
||||
* soundmanager.addSound("tinker:launcher_clank.ogg");
|
||||
* TConstruct.logger.info("Successfully loaded sounds.");
|
||||
*/
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TConstruct.logger.error("Failed to register one or more sounds");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Liquids */
|
||||
|
||||
IIcon[] stillIcons = new IIcon[2];
|
||||
IIcon[] flowIcons = new IIcon[2];
|
||||
|
||||
@SubscribeEvent
|
||||
public void preStitch (TextureStitchEvent.Pre event)
|
||||
{
|
||||
TextureMap register = event.map;
|
||||
if (register.getTextureType() == 0)
|
||||
{
|
||||
stillIcons[0] = register.registerIcon("tinker:liquid_pigiron");
|
||||
flowIcons[0] = register.registerIcon("tinker:liquid_pigiron");
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void postStitch (TextureStitchEvent.Post event)
|
||||
{
|
||||
if (event.map.getTextureType() == 0)
|
||||
{
|
||||
for (int i = 0; i < TinkerSmeltery.fluidBlocks.length; i++)
|
||||
{
|
||||
TinkerSmeltery.fluids[i].setIcons(TinkerSmeltery.fluidBlocks[i].getIcon(0, 0), TinkerSmeltery.fluidBlocks[i].getIcon(2, 0));
|
||||
}
|
||||
TinkerSmeltery.pigIronFluid.setIcons(stillIcons[0], flowIcons[0]);
|
||||
}
|
||||
}
|
||||
|
||||
private static final ResourceLocation hearts = new ResourceLocation("tinker", "textures/gui/newhearts.png");
|
||||
private static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png");
|
||||
// public static int left_height = 39;
|
||||
@@ -248,49 +290,4 @@ public class TClientEvents
|
||||
}
|
||||
|
||||
double zLevel = 0;
|
||||
|
||||
/*
|
||||
* @SubscribeEvent public void fovModifier(FOVUpdateEvent event) { float f =
|
||||
* 1.0F;
|
||||
*
|
||||
* if (event.entity.capabilities.isFlying) { f *= 1.1F; }
|
||||
*
|
||||
* if (event.entity.isUsingItem() && event.entity.getItemInUse().getItem()
|
||||
* == Items.bow) { int i = event.entity.getItemInUseDuration(); float f1 =
|
||||
* (float) i / 20.0F;
|
||||
*
|
||||
* if (f1 > 1.0F) { f1 = 1.0F; } else { f1 *= f1; }
|
||||
*
|
||||
* f *= 1.0F - f1 * 0.15F; } event.newfov = f; }
|
||||
*/
|
||||
|
||||
/* Armor */
|
||||
ModelBiped model = new ModelBiped(5f);
|
||||
WingModel wings = new WingModel();
|
||||
|
||||
/*
|
||||
* static { model.bipedHead.showModel = false; }
|
||||
*/
|
||||
|
||||
private float interpolateRotation (float par1, float par2, float par3)
|
||||
{
|
||||
float f3;
|
||||
|
||||
for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
while (f3 >= 180.0F)
|
||||
{
|
||||
f3 -= 360.0F;
|
||||
}
|
||||
|
||||
return par1 + par3 * f3;
|
||||
}
|
||||
|
||||
protected float handleRotationFloat (EntityLiving par1EntityLiving, float par2)
|
||||
{
|
||||
return (float) par1EntityLiving.ticksExisted + par2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package tconstruct.armor;
|
||||
|
||||
import tconstruct.armor.inventory.ArmorExtendedContainer;
|
||||
import tconstruct.armor.inventory.KnapsackContainer;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
public class ArmorProxyCommon implements IGuiHandler
|
||||
{
|
||||
public static final int inventoryGui = 100;
|
||||
public static final int armorGuiID = 101;
|
||||
public static final int knapsackGuiID = 102;
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (ID == ArmorProxyCommon.inventoryGui)
|
||||
{
|
||||
// GuiInventory inv = new GuiInventory(player);
|
||||
return player.inventoryContainer;
|
||||
}
|
||||
if (ID == ArmorProxyCommon.armorGuiID)
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(player);
|
||||
return new ArmorExtendedContainer(player.inventory, stats.armor);
|
||||
}
|
||||
if (ID == ArmorProxyCommon.knapsackGuiID)
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(player);
|
||||
return new KnapsackContainer(player.inventory, stats.knapsack);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public void registerTickHandler ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void registerKeys ()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -1,27 +1,27 @@
|
||||
package tconstruct.client;
|
||||
package tconstruct.armor;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.init.Blocks;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.client.TControls;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TClientTickHandler
|
||||
public class ArmorTickHandler
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
TControls controlInstance = ((TProxyClient) TConstruct.proxy).controlInstance;
|
||||
TControls controlInstance = ((ArmorProxyClient)TinkerArmor.proxy).controlInstance;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void tickEnd (ClientTickEvent event)
|
||||
{
|
||||
TinkerWorld.oreBerry.setGraphicsLevel(Blocks.leaves.field_150121_P);
|
||||
/*TinkerWorld.oreBerry.setGraphicsLevel(Blocks.leaves.field_150121_P);
|
||||
TinkerWorld.oreBerrySecond.setGraphicsLevel(Blocks.leaves.field_150121_P);
|
||||
TinkerWorld.slimeLeaves.setGraphicsLevel(Blocks.leaves.field_150121_P);
|
||||
TinkerWorld.slimeLeaves.setGraphicsLevel(Blocks.leaves.field_150121_P);*/
|
||||
if (mc.thePlayer != null && mc.thePlayer.onGround)
|
||||
controlInstance.landOnGround();
|
||||
}
|
||||
@@ -1,5 +1,14 @@
|
||||
package tconstruct.armor;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.blocks.DryingRack;
|
||||
import tconstruct.armor.items.ArmorBasic;
|
||||
@@ -13,20 +22,14 @@ import tconstruct.library.armor.EnumArmorPart;
|
||||
import tconstruct.library.crafting.DryingRackRecipes;
|
||||
import tconstruct.library.crafting.LiquidCasting;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.smeltery.SmelteryProxyCommon;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.items.GoldenHead;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
@@ -39,6 +42,9 @@ public class TinkerArmor
|
||||
{
|
||||
@Instance("TinkerArmor")
|
||||
public static TinkerArmor instance;
|
||||
@SidedProxy(clientSide = "tconstruct.armor.ArmorProxyClient", serverSide = "tconstruct.armor.ArmorProxyCommon")
|
||||
public static ArmorProxyCommon proxy;
|
||||
|
||||
public static Item diamondApple;
|
||||
public static Item jerky;
|
||||
// public static Item stonePattern;
|
||||
@@ -63,12 +69,15 @@ public class TinkerArmor
|
||||
public static Item exoShoes;
|
||||
public static Item bootsWood;
|
||||
public static ArmorMaterial materialWood;
|
||||
|
||||
public TinkerArmor()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(new TinkerArmorEvents());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preInit (FMLPreInitializationEvent event)
|
||||
{
|
||||
|
||||
|
||||
TinkerArmor.dryingRack = new DryingRack().setBlockName("Armor.DryingRack");
|
||||
TinkerArmor.diamondApple = new DiamondApple().setUnlocalizedName("tconstruct.apple.diamond");
|
||||
GameRegistry.registerItem(TinkerArmor.diamondApple, "diamondApple");
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package tconstruct.armor;
|
||||
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.world.entity.BlueSlime;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class TinkerArmorEvents
|
||||
{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingDrop (LivingDropsEvent event)
|
||||
{
|
||||
if (event.entityLiving == null)
|
||||
return;
|
||||
|
||||
if (TConstruct.random.nextInt(200) == 0 && event.entityLiving instanceof IMob && event.source.damageType.equals("player"))
|
||||
{
|
||||
if (event.entityLiving instanceof BlueSlime)
|
||||
{
|
||||
BlueSlime slime = (BlueSlime) event.entityLiving;
|
||||
if (slime.getSlimeSize() < 8)
|
||||
return;
|
||||
}
|
||||
int count = event.entityLiving instanceof EntityDragon ? 5 : 1;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 1);
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving instanceof IBossDisplayData)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 3);
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class DryingRackRender implements ISimpleBlockRenderingHandler
|
||||
if (modelID == model)
|
||||
{
|
||||
renderer.setRenderBounds(0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package tconstruct.client;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class SuperSoakerRender implements IItemRenderer
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType (ItemStack item, ItemRenderType type)
|
||||
{
|
||||
return type != ItemRenderType.INVENTORY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack item, ItemRendererHelper helper)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem (ItemRenderType type, ItemStack item, Object... data)
|
||||
{
|
||||
if (type == ItemRenderType.EQUIPPED)
|
||||
renderEquippedItem(item, (RenderBlocks) data[0], (EntityLiving) data[1]);
|
||||
if (type == ItemRenderType.ENTITY)
|
||||
renderEntityItem(item, (RenderBlocks) data[0], (EntityItem) data[1]);
|
||||
}
|
||||
|
||||
void renderEquippedItem (ItemStack item, RenderBlocks renderBlocks, EntityLiving entityLiving)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void renderEntityItem (ItemStack item, RenderBlocks renderBlocks, EntityItem entityItem)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.potion.Potion;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
import tconstruct.client.event.EventCloakRender;
|
||||
import tconstruct.client.tabs.TabRegistry;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.util.network.packet.PacketDoubleJump;
|
||||
import tconstruct.util.network.packet.PacketExtendedInventory;
|
||||
|
||||
@@ -150,13 +150,13 @@ public class TControls extends TKeyHandler
|
||||
|
||||
public static void openArmorGui ()
|
||||
{
|
||||
AbstractPacket packet = new PacketExtendedInventory(TProxyCommon.armorGuiID);
|
||||
AbstractPacket packet = new PacketExtendedInventory(ArmorProxyCommon.armorGuiID);
|
||||
updateServer(packet);
|
||||
}
|
||||
|
||||
public static void openKnapsackGui ()
|
||||
{
|
||||
AbstractPacket packet = new PacketExtendedInventory(TProxyCommon.knapsackGuiID);
|
||||
AbstractPacket packet = new PacketExtendedInventory(ArmorProxyCommon.knapsackGuiID);
|
||||
updateServer(packet);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import mantle.client.MProxyClient;
|
||||
import mantle.client.SmallFontRenderer;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
@@ -38,11 +37,8 @@ import net.minecraft.client.particle.EntitySnowShovelFX;
|
||||
import net.minecraft.client.particle.EntitySpellParticleFX;
|
||||
import net.minecraft.client.particle.EntitySplashFX;
|
||||
import net.minecraft.client.particle.EntitySuspendFX;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -56,11 +52,11 @@ import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.RenderBlockFluid;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.TinkerArmor;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
import tconstruct.armor.modelblock.DryingRackRender;
|
||||
import tconstruct.armor.modelblock.DryingRackSpecialRender;
|
||||
import tconstruct.blocks.logic.DryingRackLogic;
|
||||
@@ -95,11 +91,13 @@ import tconstruct.library.client.TConstructClientRegistry;
|
||||
import tconstruct.library.client.ToolGuiElement;
|
||||
import tconstruct.library.crafting.ToolBuilder;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.mechworks.MechworksProxyCommon;
|
||||
import tconstruct.mechworks.entity.item.EntityLandmineFirework;
|
||||
import tconstruct.mechworks.entity.item.ExplosivePrimed;
|
||||
import tconstruct.mechworks.inventory.ContainerLandmine;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import tconstruct.mechworks.model.CartRender;
|
||||
import tconstruct.smeltery.SmelteryProxyCommon;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;
|
||||
import tconstruct.smeltery.logic.CastingBasinLogic;
|
||||
@@ -115,6 +113,7 @@ import tconstruct.smeltery.model.SmelteryRender;
|
||||
import tconstruct.smeltery.model.TankAirRender;
|
||||
import tconstruct.smeltery.model.TankRender;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.entity.ArrowEntity;
|
||||
import tconstruct.tools.entity.DaggerEntity;
|
||||
import tconstruct.tools.entity.FancyEntityItem;
|
||||
@@ -130,7 +129,7 @@ import tconstruct.tools.logic.ToolForgeLogic;
|
||||
import tconstruct.tools.logic.ToolStationLogic;
|
||||
import tconstruct.tools.model.FancyItemRender;
|
||||
import tconstruct.tools.model.FrypanRender;
|
||||
import tconstruct.tools.model.TableForgeRender;
|
||||
import tconstruct.tools.model.TableRender;
|
||||
import tconstruct.tools.model.TableRender;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.util.player.ArmorExtended;
|
||||
@@ -166,151 +165,12 @@ public class TProxyClient extends TProxyCommon
|
||||
public static ArmorExtended armorExtended = new ArmorExtended();
|
||||
public static KnapsackInventory knapsack = new KnapsackInventory();
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (ID == toolStationID)
|
||||
return new ToolStationGui(player.inventory, (ToolStationLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == partBuilderID)
|
||||
return new PartCrafterGui(player.inventory, (PartBuilderLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == patternChestID)
|
||||
return new PatternChestGui(player.inventory, (PatternChestLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == frypanGuiID)
|
||||
return new FrypanGui(player.inventory, (FrypanLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == smelteryGuiID)
|
||||
{
|
||||
if (PHConstruct.newSmeltery)
|
||||
return new AdaptiveSmelteryGui(player.inventory, (AdaptiveSmelteryLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
else
|
||||
return new SmelteryGui(player.inventory, (SmelteryLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
}
|
||||
if (ID == stencilTableID)
|
||||
return new StencilTableGui(player.inventory, (StencilTableLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == toolForgeID)
|
||||
return new ToolForgeGui(player.inventory, (ToolForgeLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == landmineID)
|
||||
return new GuiLandmine(new ContainerLandmine(player, (TileEntityLandmine) world.getTileEntity(x, y, z)));
|
||||
if (ID == craftingStationID)
|
||||
return new CraftingStationGui(player.inventory, (CraftingStationLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
|
||||
if (ID == furnaceID)
|
||||
return new FurnaceGui(player.inventory, (FurnaceLogic) world.getTileEntity(x, y, z));
|
||||
|
||||
if (ID == inventoryGui)
|
||||
{
|
||||
GuiInventory inventory = new GuiInventory(player);
|
||||
TabRegistry.addTabsToInventory(inventory);
|
||||
return inventory;
|
||||
}
|
||||
if (ID == armorGuiID)
|
||||
{
|
||||
TProxyClient.armorExtended.init(Minecraft.getMinecraft().thePlayer);
|
||||
return new ArmorExtendedGui(player.inventory, TProxyClient.armorExtended);
|
||||
}
|
||||
if (ID == knapsackGuiID)
|
||||
{
|
||||
TProxyClient.knapsack.init(Minecraft.getMinecraft().thePlayer);
|
||||
return new KnapsackGui(player.inventory, TProxyClient.knapsack);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(0, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(1, meta)));// block.getIcon(1, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(2, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(3, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(4, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(5, meta)));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public static void renderInvBlockFace (RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
GL11.glRotatef(45, 0, 1, 0);
|
||||
GL11.glRotatef(60, 1, 0, 0);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(0, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(1, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(2, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(3, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(4, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getIcon(block.getIcon(5, meta)));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public static boolean classMatches (Object paramObject, String paramString)
|
||||
{
|
||||
try
|
||||
{
|
||||
return paramObject.getClass().getName().equals(paramString);
|
||||
}
|
||||
catch (Exception localException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTickHandler ()
|
||||
{
|
||||
FMLCommonHandler.instance().bus().register(new TClientTickHandler());
|
||||
new TClientTickHandler();
|
||||
// TickRegistry.registerTickHandler(new TimeTicker(), Side.CLIENT);
|
||||
// TickRegistry.registerTickHandler(new TCommonTickHandler(),
|
||||
// Side.CLIENT);
|
||||
}
|
||||
|
||||
/* Registers any rendering code. */
|
||||
@Override
|
||||
public void registerRenderer ()
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
MinecraftForge.EVENT_BUS.register(new TClientEvents());
|
||||
smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), mc.renderEngine, false);
|
||||
RenderingRegistry.registerBlockHandler(new TableRender());
|
||||
RenderingRegistry.registerBlockHandler(new TableForgeRender());
|
||||
RenderingRegistry.registerBlockHandler(new FrypanRender());
|
||||
RenderingRegistry.registerBlockHandler(new TankRender());
|
||||
RenderingRegistry.registerBlockHandler(new TankAirRender());
|
||||
@@ -368,7 +228,6 @@ public class TProxyClient extends TProxyCommon
|
||||
public static Document smelter;
|
||||
public static ManualInfo manualData;
|
||||
|
||||
@Override
|
||||
public void readManuals ()
|
||||
{
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
@@ -814,256 +673,9 @@ public class TProxyClient extends TProxyCommon
|
||||
}
|
||||
}
|
||||
|
||||
/* Keybindings */
|
||||
public static TControls controlInstance;
|
||||
|
||||
@Override
|
||||
public void registerKeys ()
|
||||
{
|
||||
controlInstance = new TControls();
|
||||
uploadKeyBindingsToGame(Minecraft.getMinecraft().gameSettings, controlInstance);
|
||||
|
||||
TabRegistry.registerTab(new InventoryTabVanilla());
|
||||
TabRegistry.registerTab(new InventoryTabArmorExtended());
|
||||
TabRegistry.registerTab(new InventoryTabKnapsack());
|
||||
}
|
||||
|
||||
public void uploadKeyBindingsToGame (GameSettings settings, TKeyHandler keyhandler)
|
||||
{
|
||||
ArrayList<KeyBinding> harvestedBindings = Lists.newArrayList();
|
||||
for (KeyBinding kb : keyhandler.keyBindings)
|
||||
{
|
||||
harvestedBindings.add(kb);
|
||||
}
|
||||
|
||||
KeyBinding[] modKeyBindings = harvestedBindings.toArray(new KeyBinding[harvestedBindings.size()]);
|
||||
KeyBinding[] allKeys = new KeyBinding[settings.keyBindings.length + modKeyBindings.length];
|
||||
System.arraycopy(settings.keyBindings, 0, allKeys, 0, settings.keyBindings.length);
|
||||
System.arraycopy(modKeyBindings, 0, allKeys, settings.keyBindings.length, modKeyBindings.length);
|
||||
settings.keyBindings = allKeys;
|
||||
settings.loadOptions();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ)
|
||||
{
|
||||
this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ);
|
||||
}
|
||||
|
||||
public EntityFX doSpawnParticle (String par1Str, double par2, double par4, double par6, double par8, double par10, double par12)
|
||||
{
|
||||
if (this.mc == null)
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
|
||||
if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null)
|
||||
{
|
||||
int i = this.mc.gameSettings.particleSetting;
|
||||
|
||||
if (i == 1 && mc.theWorld.rand.nextInt(3) == 0)
|
||||
{
|
||||
i = 2;
|
||||
}
|
||||
|
||||
double d6 = this.mc.renderViewEntity.posX - par2;
|
||||
double d7 = this.mc.renderViewEntity.posY - par4;
|
||||
double d8 = this.mc.renderViewEntity.posZ - par6;
|
||||
EntityFX entityfx = null;
|
||||
|
||||
if (par1Str.equals("hugeexplosion"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityHugeExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12));
|
||||
}
|
||||
else if (par1Str.equals("largeexplode"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityLargeExplodeFX(mc.renderEngine, mc.theWorld, par2, par4, par6, par8, par10, par12));
|
||||
}
|
||||
else if (par1Str.equals("fireworksSpark"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityFireworkSparkFX(mc.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer));
|
||||
}
|
||||
|
||||
if (entityfx != null)
|
||||
{
|
||||
return (EntityFX) entityfx;
|
||||
}
|
||||
else
|
||||
{
|
||||
double d9 = 16.0D;
|
||||
|
||||
if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par1Str.equals("bubble"))
|
||||
{
|
||||
entityfx = new EntityBubbleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("suspended"))
|
||||
{
|
||||
entityfx = new EntitySuspendFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("depthsuspend"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("townaura"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("crit"))
|
||||
{
|
||||
entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("smoke"))
|
||||
{
|
||||
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("mobSpell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
||||
((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12);
|
||||
}
|
||||
else if (par1Str.equals("mobSpellAmbient"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
||||
((EntityFX) entityfx).setAlphaF(0.15F);
|
||||
((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12);
|
||||
}
|
||||
else if (par1Str.equals("spell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("instantSpell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
|
||||
}
|
||||
else if (par1Str.equals("witchMagic"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
|
||||
float f = mc.theWorld.rand.nextFloat() * 0.5F + 0.35F;
|
||||
((EntityFX) entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f);
|
||||
}
|
||||
else if (par1Str.equals("note"))
|
||||
{
|
||||
entityfx = new EntityNoteFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("portal"))
|
||||
{
|
||||
entityfx = new EntityPortalFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("enchantmenttable"))
|
||||
{
|
||||
entityfx = new EntityEnchantmentTableParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("explode"))
|
||||
{
|
||||
entityfx = new EntityExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("flame"))
|
||||
{
|
||||
entityfx = new EntityFlameFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("lava"))
|
||||
{
|
||||
entityfx = new EntityLavaFX(mc.theWorld, par2, par4, par6);
|
||||
}
|
||||
else if (par1Str.equals("footstep"))
|
||||
{
|
||||
entityfx = new EntityFootStepFX(mc.renderEngine, mc.theWorld, par2, par4, par6);
|
||||
}
|
||||
else if (par1Str.equals("splash"))
|
||||
{
|
||||
entityfx = new EntitySplashFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("largesmoke"))
|
||||
{
|
||||
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12, 2.5F);
|
||||
}
|
||||
else if (par1Str.equals("cloud"))
|
||||
{
|
||||
entityfx = new EntityCloudFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("reddust"))
|
||||
{
|
||||
entityfx = new EntityReddustFX(mc.theWorld, par2, par4, par6, (float) par8, (float) par10, (float) par12);
|
||||
}
|
||||
else if (par1Str.equals("snowballpoof"))
|
||||
{
|
||||
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Items.snowball);
|
||||
}
|
||||
else if (par1Str.equals("dripWater"))
|
||||
{
|
||||
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.water);
|
||||
}
|
||||
else if (par1Str.equals("dripLava"))
|
||||
{
|
||||
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.lava);
|
||||
}
|
||||
else if (par1Str.equals("snowshovel"))
|
||||
{
|
||||
entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("blueslime"))
|
||||
{
|
||||
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TinkerWorld.strangeFood);
|
||||
}
|
||||
else if (par1Str.equals("heart"))
|
||||
{
|
||||
entityfx = new EntityHeartFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("angryVillager"))
|
||||
{
|
||||
entityfx = new EntityHeartFX(mc.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12);
|
||||
((EntityFX) entityfx).setParticleTextureIndex(81);
|
||||
((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
else if (par1Str.equals("happyVillager"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntityFX) entityfx).setParticleTextureIndex(82);
|
||||
((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if (entityfx != null)
|
||||
{
|
||||
this.mc.effectRenderer.addEffect((EntityFX) entityfx);
|
||||
}
|
||||
|
||||
return (EntityFX) entityfx;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit ()
|
||||
{
|
||||
// MinecraftForgeClient.registerItemRenderer(TRepo.armorPattern.itemID,
|
||||
// new RenderArmorCast());
|
||||
}
|
||||
|
||||
public void recalculateHealth ()
|
||||
{
|
||||
armorExtended.recalculateHealth(mc.thePlayer, TPlayerStats.get(mc.thePlayer));
|
||||
}
|
||||
|
||||
private static IIcon getIcon (IIcon icon)
|
||||
{
|
||||
if (icon != null)
|
||||
return icon;
|
||||
return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,8 +6,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
import tconstruct.armor.inventory.ArmorExtendedContainer;
|
||||
import tconstruct.armor.inventory.KnapsackContainer;
|
||||
import tconstruct.mechworks.MechworksProxyCommon;
|
||||
import tconstruct.mechworks.inventory.ContainerLandmine;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
@@ -16,116 +18,9 @@ import tconstruct.util.player.TPlayerStats;
|
||||
* Common proxy class for InfiTools
|
||||
*/
|
||||
|
||||
public class TProxyCommon implements IGuiHandler
|
||||
public class TProxyCommon
|
||||
{
|
||||
public static final int toolStationID = 0;
|
||||
public static final int partBuilderID = 1;
|
||||
public static final int patternChestID = 2;
|
||||
public static final int stencilTableID = 3;
|
||||
public static final int frypanGuiID = 4;
|
||||
public static final int toolForgeID = 5;
|
||||
|
||||
public static final int smelteryGuiID = 7;
|
||||
public static final int furnaceID = 8;
|
||||
// public static int drawbridgeID = 9; // Moved to TMechworks
|
||||
public static final int landmineID = 10;
|
||||
public static final int craftingStationID = 11;
|
||||
// public static int advDrawbridgeID = 12; // Moved to TMechworks
|
||||
public static final int inventoryGui = 100;
|
||||
public static final int armorGuiID = 101;
|
||||
public static final int knapsackGuiID = 102;
|
||||
|
||||
// public static int manualGuiID = -1;// moved to Mantle
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (ID < 0)
|
||||
return null;
|
||||
|
||||
if (ID == landmineID)
|
||||
{
|
||||
return new ContainerLandmine(player, (TileEntityLandmine) world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
else if (ID < 100)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile != null && tile instanceof InventoryLogic)
|
||||
{
|
||||
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ID == inventoryGui)
|
||||
{
|
||||
// GuiInventory inv = new GuiInventory(player);
|
||||
return player.inventoryContainer;
|
||||
}
|
||||
if (ID == armorGuiID)
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(player);
|
||||
return new ArmorExtendedContainer(player.inventory, stats.armor);
|
||||
}
|
||||
if (ID == knapsackGuiID)
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(player);
|
||||
return new KnapsackContainer(player.inventory, stats.knapsack);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void registerTickHandler ()
|
||||
{
|
||||
// TickRegistry.registerTickHandler(new TimeTicker(), Side.SERVER);
|
||||
}
|
||||
|
||||
/* Registers any rendering code. Does nothing server-side */
|
||||
public void registerRenderer ()
|
||||
{
|
||||
}
|
||||
|
||||
/* Ties an internal name to a visible one. */
|
||||
public void addNames ()
|
||||
{
|
||||
// As of 1.6.x, this is now handled by Minecraft itself for the most
|
||||
// part.
|
||||
|
||||
//LanguageRegistry.addName(TRepo.potionLauncher, "Potion Launcher");
|
||||
//LanguageRegistry.addName(TRepo.knapsack, "Knapsack");
|
||||
|
||||
}
|
||||
|
||||
public void readManuals ()
|
||||
{
|
||||
}
|
||||
|
||||
public void registerKeys ()
|
||||
{
|
||||
}
|
||||
|
||||
public void spawnParticle (String slimeParticle, double xPos, double yPos, double zPos, double velX, double velY, double velZ)
|
||||
{
|
||||
}
|
||||
|
||||
public static final String[] patterns = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign",
|
||||
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "bowstring", "fletching", "arrowhead" };
|
||||
|
||||
public void postInit ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void recalculateHealth ()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package tconstruct.mechworks;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.client.gui.AdaptiveSmelteryGui;
|
||||
import tconstruct.client.gui.ArmorExtendedGui;
|
||||
import tconstruct.client.gui.CraftingStationGui;
|
||||
import tconstruct.client.gui.FrypanGui;
|
||||
import tconstruct.client.gui.FurnaceGui;
|
||||
import tconstruct.client.gui.GuiLandmine;
|
||||
import tconstruct.client.gui.KnapsackGui;
|
||||
import tconstruct.client.gui.PartCrafterGui;
|
||||
import tconstruct.client.gui.PatternChestGui;
|
||||
import tconstruct.client.gui.SmelteryGui;
|
||||
import tconstruct.client.gui.StencilTableGui;
|
||||
import tconstruct.client.gui.ToolForgeGui;
|
||||
import tconstruct.client.gui.ToolStationGui;
|
||||
import tconstruct.client.tabs.TabRegistry;
|
||||
import tconstruct.mechworks.inventory.ContainerLandmine;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import tconstruct.smeltery.SmelteryProxyCommon;
|
||||
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;
|
||||
import tconstruct.smeltery.logic.SmelteryLogic;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.CraftingStationLogic;
|
||||
import tconstruct.tools.logic.FrypanLogic;
|
||||
import tconstruct.tools.logic.FurnaceLogic;
|
||||
import tconstruct.tools.logic.PartBuilderLogic;
|
||||
import tconstruct.tools.logic.PatternChestLogic;
|
||||
import tconstruct.tools.logic.StencilTableLogic;
|
||||
import tconstruct.tools.logic.ToolForgeLogic;
|
||||
import tconstruct.tools.logic.ToolStationLogic;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class MechworksProxyClient extends MechworksProxyCommon
|
||||
{
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (ID == MechworksProxyCommon.landmineID)
|
||||
return new GuiLandmine(new ContainerLandmine(player, (TileEntityLandmine) world.getTileEntity(x, y, z)));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package tconstruct.mechworks;
|
||||
|
||||
import tconstruct.mechworks.inventory.ContainerLandmine;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
public class MechworksProxyCommon implements IGuiHandler
|
||||
{
|
||||
|
||||
// public static int drawbridgeID = 9; // Moved to TMechworks
|
||||
public static final int landmineID = 10;
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (ID == MechworksProxyCommon.landmineID)
|
||||
{
|
||||
return new ContainerLandmine(player, (TileEntityLandmine) world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,7 +35,6 @@ import tconstruct.tools.blocks.MultiBrick;
|
||||
import tconstruct.tools.blocks.MultiBrickFancy;
|
||||
import tconstruct.tools.itemblocks.MultiBrickFancyItem;
|
||||
import tconstruct.tools.itemblocks.MultiBrickItem;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.blocks.ConveyorBase;
|
||||
import tconstruct.world.blocks.GravelOre;
|
||||
import tconstruct.world.blocks.MeatBlock;
|
||||
@@ -72,11 +71,15 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
public class TinkerMechworks
|
||||
{
|
||||
|
||||
// Traps
|
||||
public static Block landmine;
|
||||
|
||||
@EventHandler
|
||||
public void preInit (FMLPreInitializationEvent event)
|
||||
{
|
||||
// Traps
|
||||
GameRegistry.registerBlock(TinkerWorld.landmine, ItemBlockLandmine.class, "Redstone.Landmine");
|
||||
TinkerMechworks.landmine = new BlockLandmine().setHardness(0.5F).setResistance(0F).setStepSound(Block.soundTypeMetal).setCreativeTab(CreativeTabs.tabRedstone).setBlockName("landmine");
|
||||
GameRegistry.registerBlock(TinkerMechworks.landmine, ItemBlockLandmine.class, "Redstone.Landmine");
|
||||
GameRegistry.registerTileEntity(TileEntityLandmine.class, "Landmine");
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.mechworks.MechworksProxyCommon;
|
||||
import tconstruct.mechworks.landmine.Helper;
|
||||
import tconstruct.mechworks.logic.LandmineExplodeLogic;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
@@ -143,7 +143,7 @@ public class BlockLandmine extends BlockContainer
|
||||
@Override
|
||||
public boolean onBlockActivated (World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
par5EntityPlayer.openGui(TConstruct.instance, TProxyCommon.landmineID, par1World, par2, par3, par4);
|
||||
par5EntityPlayer.openGui(TConstruct.instance, MechworksProxyCommon.landmineID, par1World, par2, par3, par4);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.util.MiningExplosion;
|
||||
import tconstruct.world.MiningExplosion;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import tconstruct.armor.inventory.SlotBehavedOnly;
|
||||
import tconstruct.armor.inventory.SlotOpaqueBlocksOnly;
|
||||
import tconstruct.mechworks.TinkerMechworks;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -65,7 +65,7 @@ public class ContainerLandmine extends Container
|
||||
public boolean canInteractWith (EntityPlayer entityplayer)
|
||||
{
|
||||
Block block = te.getWorldObj().getBlock(te.xCoord, te.yCoord, te.zCoord);
|
||||
if (block != TinkerWorld.landmine)
|
||||
if (block != TinkerMechworks.landmine)
|
||||
return false;
|
||||
return te.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.mechworks.TinkerMechworks;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -59,25 +59,25 @@ public class ItemBlockLandmine extends ItemBlock
|
||||
@Override
|
||||
public boolean placeBlockAt (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
|
||||
{
|
||||
if (!world.setBlock(x, y, z, TinkerWorld.landmine, metadata, 3))
|
||||
if (!world.setBlock(x, y, z, TinkerMechworks.landmine, metadata, 3))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world.getBlock(x, y, z) == TinkerWorld.landmine)
|
||||
if (world.getBlock(x, y, z) == TinkerMechworks.landmine)
|
||||
{
|
||||
TinkerWorld.landmine.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
TinkerMechworks.landmine.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
|
||||
TileEntityLandmine te = (TileEntityLandmine) world.getTileEntity(x, y, z);
|
||||
if (te == null)
|
||||
{
|
||||
te = (TileEntityLandmine) TinkerWorld.landmine.createTileEntity(world, metadata);
|
||||
te = (TileEntityLandmine) TinkerMechworks.landmine.createTileEntity(world, metadata);
|
||||
}
|
||||
|
||||
te.triggerType = stack.getItemDamage();
|
||||
world.setTileEntity(x, y, z, te);
|
||||
|
||||
TinkerWorld.landmine.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
TinkerMechworks.landmine.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.util;
|
||||
package tconstruct.smeltery;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
@@ -0,0 +1,64 @@
|
||||
package tconstruct.smeltery;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import tconstruct.client.gui.AdaptiveSmelteryGui;
|
||||
import tconstruct.client.gui.SmelteryGui;
|
||||
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;
|
||||
import tconstruct.smeltery.logic.SmelteryLogic;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class SmelteryProxyClient extends SmelteryProxyCommon
|
||||
{
|
||||
public SmelteryProxyClient()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (ID == SmelteryProxyCommon.smelteryGuiID)
|
||||
{
|
||||
if (PHConstruct.newSmeltery)
|
||||
return new AdaptiveSmelteryGui(player.inventory, (AdaptiveSmelteryLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
else
|
||||
return new SmelteryGui(player.inventory, (SmelteryLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* Liquids */
|
||||
|
||||
IIcon[] stillIcons = new IIcon[2];
|
||||
IIcon[] flowIcons = new IIcon[2];
|
||||
|
||||
@SubscribeEvent
|
||||
public void preStitch (TextureStitchEvent.Pre event)
|
||||
{
|
||||
TextureMap register = event.map;
|
||||
if (register.getTextureType() == 0)
|
||||
{
|
||||
stillIcons[0] = register.registerIcon("tinker:liquid_pigiron");
|
||||
flowIcons[0] = register.registerIcon("tinker:liquid_pigiron");
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void postStitch (TextureStitchEvent.Post event)
|
||||
{
|
||||
if (event.map.getTextureType() == 0)
|
||||
{
|
||||
for (int i = 0; i < TinkerSmeltery.fluidBlocks.length; i++)
|
||||
{
|
||||
TinkerSmeltery.fluids[i].setIcons(TinkerSmeltery.fluidBlocks[i].getIcon(0, 0), TinkerSmeltery.fluidBlocks[i].getIcon(2, 0));
|
||||
}
|
||||
TinkerSmeltery.pigIronFluid.setIcons(stillIcons[0], flowIcons[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package tconstruct.smeltery;
|
||||
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
public class SmelteryProxyCommon implements IGuiHandler
|
||||
{
|
||||
public static final int smelteryGuiID = 7;
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile != null && tile instanceof InventoryLogic)
|
||||
{
|
||||
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,11 +15,12 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
@@ -73,14 +74,22 @@ import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.blocks.CastingChannelBlock;
|
||||
import tconstruct.world.blocks.TMetalBlock;
|
||||
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.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@Mod(modid = "TinkerSmeltery", name = "TinkerSmeltery", version = "${tinkersmelteryversion}")
|
||||
public class TinkerSmeltery
|
||||
{
|
||||
@Instance("TinkerSmeltery")
|
||||
public static TinkerSmeltery instance;
|
||||
@SidedProxy(clientSide = "tconstruct.smeltery.SmelteryProxyClient", serverSide = "tconstruct.smeltery.SmelteryProxyCommon")
|
||||
public static SmelteryProxyCommon proxy;
|
||||
|
||||
public static Item metalPattern;
|
||||
// public static Item armorPattern;
|
||||
@@ -166,7 +175,10 @@ public class TinkerSmeltery
|
||||
public static Fluid bloodFluid;
|
||||
public static Block blood;
|
||||
|
||||
|
||||
public TinkerSmeltery()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(new TinkerSmelteryEvents());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preInit (FMLPreInitializationEvent event)
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package tconstruct.smeltery;
|
||||
|
||||
import mantle.world.WorldHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.smeltery.blocks.LiquidMetalFinite;
|
||||
import tconstruct.smeltery.blocks.TankAirBlock;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
|
||||
public class TinkerSmelteryEvents
|
||||
{
|
||||
@SubscribeEvent
|
||||
public void onCrafting (ItemCraftedEvent event)
|
||||
{
|
||||
Item item = event.crafting.getItem();
|
||||
if (!event.player.worldObj.isRemote)
|
||||
{
|
||||
if (item == Item.getItemFromBlock(TinkerSmeltery.smeltery) || item == Item.getItemFromBlock(TinkerSmeltery.lavaTank))
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(event.player);
|
||||
if (!stats.smelteryManual)
|
||||
{
|
||||
stats.smelteryManual = true;
|
||||
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TinkerTools.manualBook, 1, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void bucketFill (FillBucketEvent evt)
|
||||
{
|
||||
if (evt.current.getItem() == Items.bucket && evt.target.typeOfHit == MovingObjectType.ENTITY)
|
||||
{
|
||||
int hitX = evt.target.blockX;
|
||||
int hitY = evt.target.blockY;
|
||||
int hitZ = evt.target.blockZ;
|
||||
|
||||
if (evt.entityPlayer != null && !evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Block bID = evt.world.getBlock(hitX, hitY, hitZ);
|
||||
for (int id = 0; id < TinkerSmeltery.fluidBlocks.length; id++)
|
||||
{
|
||||
if (bID == TinkerSmeltery.fluidBlocks[id])
|
||||
{
|
||||
if (evt.entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TinkerSmeltery.fluidBlocks[id] instanceof LiquidMetalFinite)
|
||||
{
|
||||
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
evt.setResult(Result.ALLOW);
|
||||
evt.result = new ItemStack(TinkerSmeltery.buckets, 1, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Player interact event - prevent breaking of tank air blocks in creative
|
||||
@SubscribeEvent
|
||||
public void playerInteract (PlayerInteractEvent event)
|
||||
{
|
||||
if (event.action == Action.LEFT_CLICK_BLOCK)
|
||||
{
|
||||
Block block = event.entity.worldObj.getBlock(event.x, event.y, event.z);
|
||||
if (block instanceof TankAirBlock)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.smeltery.SmelteryProxyCommon;
|
||||
import tconstruct.smeltery.logic.AdaptiveDrainLogic;
|
||||
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;
|
||||
import tconstruct.smeltery.logic.SmelteryDrainLogic;
|
||||
@@ -168,7 +169,7 @@ public class SmelteryBlock extends InventoryBlock
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
// return -1;
|
||||
return TConstruct.proxy.smelteryGuiID;
|
||||
return SmelteryProxyCommon.smelteryGuiID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,9 +39,9 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.smeltery.SmelteryDamageSource;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.smeltery.inventory.SmelteryContainer;
|
||||
import tconstruct.util.SmelteryDamageSource;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
/* Simple class for storing items in the block
|
||||
|
||||
@@ -8,8 +8,8 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.smeltery.blocks.PaneBase;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PaneRender implements ISimpleBlockRenderingHandler
|
||||
if (modelID == model)
|
||||
{
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.client.BlockSkinRenderHelper;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.smeltery.logic.CastingBasinLogic;
|
||||
import tconstruct.smeltery.logic.CastingTableLogic;
|
||||
import tconstruct.smeltery.logic.FaucetLogic;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@@ -29,104 +29,104 @@ public class SearedRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
// Top
|
||||
renderer.setRenderBounds(0.0F, 0.625F, 0.0F, 1.0F, 0.9375F, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
|
||||
// Lip
|
||||
renderer.setRenderBounds(0.0F, 0.9375, 0.0F, 0.0625, 1.0, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0625, 0.9375, 0.9375, 0.9375, 1.0, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.9375, 0.9375, 0.0F, 1.0F, 1.0, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0625, 0.9375, 0.0F, 0.9375, 1.0, 0.0625);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
|
||||
// Legs
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.625F, 0.3125F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.6875, 0.0F, 0.0F, 1.0F, 0.625F, 0.25F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.6875, 0.3125F, 0.625F, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
else if (metadata == 1)
|
||||
{
|
||||
renderer.setRenderBounds(0.25, 0.25, 0.625, 0.75, 0.375, 1);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.25, 0.25, 0.625, 0.375, 0.625, 1);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.625, 0.25, 0.625, 0.75, 0.625, 1);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.375, 0.375, 0.625, 0.625, 0.625, 1);
|
||||
}
|
||||
else if (metadata == 2)
|
||||
{
|
||||
renderer.setRenderBounds(0.125F, 0.125f, 0.125F, 0.875F, 0.25F, 0.875F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
|
||||
// Details
|
||||
renderer.setRenderBounds(0.001f, 0.1245f, 0.001f, 0.1245f, 0.999f, 0.4375f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.001f, 0.1245f, 0.5625f, 0.1245f, 0.999f, 0.999f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.001f, 0.8755f, 0.4375f, 0.1245f, 0.999f, 0.5625f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.001f, 0.1245f, 0.4375f, 0.1245f, 0.25F, 0.5625f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
|
||||
renderer.setRenderBounds(0.8755f, 0.1245f, 0f, 0.999f, 0.999f, 0.4375f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.8755f, 0.1245f, 0.5625f, 0.999f, 0.999f, 0.999f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.8755f, 0.8755f, 0.4375f, 0.999f, 0.999f, 0.5625f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.8755f, 0.1245f, 0.4375f, 0.999f, 0.25F, 0.5625f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
|
||||
renderer.setRenderBounds(0.1245f, 0.1245f, 0.8755f, 0.4375f, 0.999f, 0.999f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.5625f, 0.1245f, 0.8755f, 0.8755f, 0.999f, 0.999f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.4375f, 0.8755f, 0.8755f, 0.5625f, 0.999f, 0.999f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.4375f, 0.1245f, 0.8755f, 0.5625f, 0.2495F, 0.999f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
|
||||
renderer.setRenderBounds(0.1245f, 0.1245f, 0.001f, 0.4375f, 0.999f, 0.1245f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.5625f, 0.1245f, 0.001f, 0.8755f, 0.999f, 0.1245f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.4375f, 0.8755f, 0.001f, 0.5625f, 0.999f, 0.1245f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.4375f, 0.1245f, 0.001f, 0.5625f, 0.25F, 0.1245f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
|
||||
// Legs
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.125, 0.3125F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.6875F, 0.0F, 0.0F, 1.0F, 0.125, 0.3125F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.6875F, 0.3125F, 0.125, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.6875F, 0.0F, 0.6875F, 1.0F, 0.125, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
|
||||
// Outside
|
||||
renderer.setRenderBounds(0.0f, 0.125, 0f, 0.125, 1.0F, 1);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.875f, 0.125, 0f, 1, 1.0F, 1);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.125f, 0.125, 0f, 0.875f, 1.0F, 0.125f);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.125f, 0.125, 0.875f, 0.875f, 1.0F, 1);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import tconstruct.client.BlockSkinRenderHelper;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import tconstruct.smeltery.logic.SmelteryLogic;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
if (modelID == smelteryModel)
|
||||
{
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import tconstruct.client.BlockSkinRenderHelper;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.smeltery.logic.LavaTankLogic;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TankRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
if (modelID == tankModelID)
|
||||
{
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
if (metadata == 0)
|
||||
{
|
||||
renderer.setRenderBounds(0.1875, 0, 0.1875, 0.8125, 0.125, 0.8125);
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.util;
|
||||
package tconstruct.tools;
|
||||
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
+40
-362
@@ -1,86 +1,70 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import java.util.Random;
|
||||
package tconstruct.tools;
|
||||
|
||||
import mantle.blocks.BlockUtils;
|
||||
import mantle.world.WorldHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.EntitySpider;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.passive.EntityChicken;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSourceIndirect;
|
||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.GameRules;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.armor.TinkerArmor;
|
||||
import tconstruct.items.tools.FryingPan;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.event.PartBuilderEvent;
|
||||
import tconstruct.library.event.ToolCraftEvent;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.ArrowMaterial;
|
||||
import tconstruct.library.tools.BowMaterial;
|
||||
import tconstruct.library.tools.BowstringMaterial;
|
||||
import tconstruct.library.tools.FletchingMaterial;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.smeltery.blocks.LiquidMetalFinite;
|
||||
import tconstruct.smeltery.blocks.TankAirBlock;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.util.player.ArmorExtended;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.entity.BlueSlime;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
|
||||
public class TEventHandler
|
||||
public class TinkerToolEvents
|
||||
{
|
||||
Random random = new Random();
|
||||
|
||||
/* Crafting */
|
||||
@SubscribeEvent
|
||||
public void onCrafting (ItemCraftedEvent event)
|
||||
{
|
||||
Item item = event.crafting.getItem();
|
||||
if (!event.player.worldObj.isRemote)
|
||||
{
|
||||
if (item == Item.getItemFromBlock(TinkerTools.toolStationWood))
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(event.player);
|
||||
if (!stats.materialManual)
|
||||
{
|
||||
stats.materialManual = true;
|
||||
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TinkerTools.manualBook, 1, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void craftTool (ToolCraftEvent.NormalTool event)
|
||||
{
|
||||
@@ -251,48 +235,8 @@ public class TEventHandler
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Damage */
|
||||
@SubscribeEvent
|
||||
public void onHurt (LivingHurtEvent event)
|
||||
{
|
||||
EntityLivingBase reciever = event.entityLiving;
|
||||
if (reciever instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
// Cutlass
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack != null && player.isUsingItem())
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
if (item == TinkerTools.cutlass)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 3 * 20, 1));
|
||||
}
|
||||
else if (item == TinkerTools.battlesign)
|
||||
{
|
||||
event.ammount *= 1.5; //Puts battlesign blocking at 3/4 instead of 1/2
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (reciever instanceof EntityCreeper)
|
||||
{
|
||||
Entity attacker = event.source.getEntity();
|
||||
if (attacker instanceof EntityLivingBase)
|
||||
{
|
||||
Entity target = ((EntityCreeper) reciever).getAttackTarget();
|
||||
if (target != null)
|
||||
{
|
||||
float d1 = reciever.getDistanceToEntity(((EntityCreeper) reciever).getAttackTarget());
|
||||
float d2 = reciever.getDistanceToEntity(attacker);
|
||||
if (d2 < d1)
|
||||
{
|
||||
((EntityCreeper) event.entityLiving).setAttackTarget((EntityLivingBase) event.source.getEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onAttack (LivingAttackEvent event)
|
||||
@@ -310,7 +254,7 @@ public class TEventHandler
|
||||
{
|
||||
if (source instanceof EntityDamageSourceIndirect)
|
||||
{
|
||||
if (random.nextInt(3) == 0)
|
||||
if (TConstruct.random.nextInt(3) == 0)
|
||||
{
|
||||
Entity attacker = source.getEntity();
|
||||
Entity projectile = ((EntityDamageSourceIndirect) source).getSourceOfDamage();
|
||||
@@ -351,86 +295,13 @@ public class TEventHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Drops */
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingDrop (LivingDropsEvent event)
|
||||
{
|
||||
if (event.entityLiving == null)
|
||||
return;
|
||||
|
||||
if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.source.getEntity();
|
||||
if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof FryingPan)
|
||||
{
|
||||
for (int i = 0; i < event.drops.size(); i++)
|
||||
{
|
||||
ItemStack is = event.drops.get(i).getEntityItem();
|
||||
if (FurnaceRecipes.smelting().getSmeltingResult(is) != null && FurnaceRecipes.smelting().getSmeltingResult(is).getItem() instanceof ItemFood)
|
||||
{
|
||||
NBTTagCompound stackCompound = is.getTagCompound();
|
||||
if (stackCompound == null)
|
||||
{
|
||||
stackCompound = new NBTTagCompound();
|
||||
}
|
||||
stackCompound.setBoolean("frypanKill", true);
|
||||
is.setTagCompound(stackCompound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (random.nextInt(200) == 0 && event.entityLiving instanceof IMob && event.source.damageType.equals("player"))
|
||||
{
|
||||
if (event.entityLiving instanceof BlueSlime)
|
||||
{
|
||||
BlueSlime slime = (BlueSlime) event.entityLiving;
|
||||
if (slime.getSlimeSize() < 8)
|
||||
return;
|
||||
}
|
||||
int count = event.entityLiving instanceof EntityDragon ? 5 : 1;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 1);
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving instanceof IBossDisplayData)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 3);
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
|
||||
if (!event.entityLiving.isChild() && event.entityLiving.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot"))
|
||||
{
|
||||
|
||||
if (event.entityLiving.getClass() == EntityCow.class)
|
||||
{
|
||||
int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1;
|
||||
|
||||
for (int iter = 0; iter < amount; ++iter)
|
||||
{
|
||||
addDrops(event, new ItemStack(Items.leather, 1));
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving.getClass() == EntityChicken.class)
|
||||
{
|
||||
int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1;
|
||||
|
||||
for (int iter = 0; iter < amount; ++iter)
|
||||
{
|
||||
addDrops(event, new ItemStack(Items.feather, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.recentlyHit)
|
||||
{
|
||||
if (event.entityLiving.getClass() == EntitySkeleton.class)
|
||||
@@ -446,15 +317,15 @@ public class TEventHandler
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if (stack.getItem() == TinkerTools.cleaver)
|
||||
beheading += 2;
|
||||
if (beheading > 0 && random.nextInt(100) < beheading * 10)
|
||||
if (beheading > 0 && TConstruct.random.nextInt(100) < beheading * 10)
|
||||
{
|
||||
addDrops(event, new ItemStack(Items.skull, 1, enemy.getSkeletonType()));
|
||||
ItemHelper.addDrops(event, new ItemStack(Items.skull, 1, enemy.getSkeletonType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (enemy.getSkeletonType() == 1 && random.nextInt(Math.max(1, 5 - event.lootingLevel)) == 0)
|
||||
if (enemy.getSkeletonType() == 1 && TConstruct.random.nextInt(Math.max(1, 5 - event.lootingLevel)) == 0)
|
||||
{
|
||||
addDrops(event, new ItemStack(TinkerTools.materials, 1, 8));
|
||||
ItemHelper.addDrops(event, new ItemStack(TinkerTools.materials, 1, 8));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,15 +343,15 @@ public class TEventHandler
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if (stack != null && stack.hasTagCompound() && stack.getItem() == TinkerTools.cleaver)
|
||||
beheading += 2;
|
||||
if (beheading > 0 && random.nextInt(100) < beheading * 10)
|
||||
if (beheading > 0 && TConstruct.random.nextInt(100) < beheading * 10)
|
||||
{
|
||||
addDrops(event, new ItemStack(Items.skull, 1, 2));
|
||||
ItemHelper.addDrops(event, new ItemStack(Items.skull, 1, 2));
|
||||
}
|
||||
}
|
||||
|
||||
if (stack != null && stack.hasTagCompound() && stack.getItem() == TinkerTools.cleaver && random.nextInt(100) < 10) //Swap out for real beheading
|
||||
if (stack != null && stack.hasTagCompound() && stack.getItem() == TinkerTools.cleaver && TConstruct.random.nextInt(100) < 10)
|
||||
{
|
||||
addDrops(event, new ItemStack(Items.skull, 1, 2));
|
||||
ItemHelper.addDrops(event, new ItemStack(Items.skull, 1, 2));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -499,34 +370,15 @@ public class TEventHandler
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if (stack.getItem() == TinkerTools.cleaver)
|
||||
beheading += 2;
|
||||
if (beheading > 0 && random.nextInt(100) < beheading * 5)
|
||||
if (beheading > 0 && TConstruct.random.nextInt(100) < beheading * 5)
|
||||
{
|
||||
addDrops(event, new ItemStack(Items.skull, 1, 4));
|
||||
ItemHelper.addDrops(event, new ItemStack(Items.skull, 1, 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving.getClass() == EntityGhast.class)
|
||||
{
|
||||
if (PHConstruct.uhcGhastDrops)
|
||||
{
|
||||
for (EntityItem o : event.drops)
|
||||
{
|
||||
if (o.getEntityItem().getItem() == Items.ghast_tear)
|
||||
{
|
||||
o.setEntityItemStack(new ItemStack(Items.gold_ingot, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
addDrops(event, new ItemStack(Items.ghast_tear, 1));
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
@@ -537,7 +389,7 @@ public class TEventHandler
|
||||
NBTTagCompound nametag = new NBTTagCompound();
|
||||
nametag.setString("SkullOwner", player.getDisplayName());
|
||||
dropStack.setTagCompound(nametag);
|
||||
addDrops(event, dropStack);
|
||||
ItemHelper.addDrops(event, dropStack);
|
||||
}
|
||||
|
||||
else if (event.source.damageType.equals("player"))
|
||||
@@ -549,91 +401,19 @@ public class TEventHandler
|
||||
int beheading = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Beheading");
|
||||
if (stack.getItem() == TinkerTools.cleaver)
|
||||
beheading += 2;
|
||||
if (beheading > 0 && random.nextInt(100) < beheading * 50)
|
||||
if (beheading > 0 && TConstruct.random.nextInt(100) < beheading * 50)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(Items.skull, 1, 3);
|
||||
NBTTagCompound nametag = new NBTTagCompound();
|
||||
nametag.setString("SkullOwner", player.getDisplayName());
|
||||
dropStack.setTagCompound(nametag);
|
||||
addDrops(event, dropStack);
|
||||
ItemHelper.addDrops(event, dropStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingDeath (LivingDeathEvent event)
|
||||
{
|
||||
Entity cause = event.source.getSourceOfDamage();
|
||||
if (cause != null && cause instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer murderer = (EntityPlayer) cause;
|
||||
ItemStack stack = murderer.getHeldItem();
|
||||
if (stack != null && stack.getItem() instanceof Weapon)
|
||||
{
|
||||
murderer.addStat(TAchievements.achievements.get("tconstruct:enemySlayer"), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void addDrops (LivingDropsEvent event, ItemStack dropStack)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
|
||||
/*
|
||||
* @ForgeSubscribe public void onLivingSpawn (EntityJoinWorldEvent event) {
|
||||
* if (event.entity instanceof EntityXPOrb) {
|
||||
* TConstruct.logger.info("Entity: " + event.entity); } }
|
||||
*/
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingSpawn (LivingSpawnEvent.SpecialSpawn event)
|
||||
{
|
||||
EntityLivingBase living = event.entityLiving;
|
||||
if (living.getClass() == EntitySpider.class && random.nextInt(100) == 0)
|
||||
{
|
||||
EntityCreeper creeper = new EntityCreeper(living.worldObj);
|
||||
spawnEntityLiving(living.posX, living.posY + 1, living.posZ, creeper, living.worldObj);
|
||||
if (living.riddenByEntity != null)
|
||||
creeper.mountEntity(living.riddenByEntity);
|
||||
else
|
||||
creeper.mountEntity(living);
|
||||
|
||||
EntityXPOrb orb = new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, random.nextInt(20) + 20);
|
||||
orb.mountEntity(creeper);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnEntityLiving (double x, double y, double z, EntityLiving entity, World world)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.setPosition(x, y, z);
|
||||
entity.onSpawnWithEgg((IEntityLivingData) null);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/* Bonemeal */
|
||||
|
||||
@SubscribeEvent
|
||||
public void bonemealEvent (BonemealEvent event)
|
||||
{
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if (event.block == TinkerWorld.slimeSapling)
|
||||
{
|
||||
if (TinkerWorld.slimeSapling.boneFertilize(event.world, event.x, event.y, event.z, event.world.rand, event.entityPlayer))
|
||||
event.setResult(Event.Result.ALLOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Ore Dictionary */
|
||||
|
||||
@SubscribeEvent
|
||||
public void registerOre (OreRegisterEvent evt)
|
||||
{
|
||||
@@ -648,106 +428,4 @@ public class TEventHandler
|
||||
TinkerTools.modAttack.addStackToMatchList(evt.Ore, 24);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void bucketFill (FillBucketEvent evt)
|
||||
{
|
||||
if (evt.current.getItem() == Items.bucket && evt.target.typeOfHit == MovingObjectType.ENTITY)
|
||||
{
|
||||
int hitX = evt.target.blockX;
|
||||
int hitY = evt.target.blockY;
|
||||
int hitZ = evt.target.blockZ;
|
||||
|
||||
if (evt.entityPlayer != null && !evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Block bID = evt.world.getBlock(hitX, hitY, hitZ);
|
||||
for (int id = 0; id < TinkerSmeltery.fluidBlocks.length; id++)
|
||||
{
|
||||
if (bID == TinkerSmeltery.fluidBlocks[id])
|
||||
{
|
||||
if (evt.entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TinkerSmeltery.fluidBlocks[id] instanceof LiquidMetalFinite)
|
||||
{
|
||||
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
|
||||
/*
|
||||
* int quanta = 0; for (int posX = -1; posX <= 1;
|
||||
* posX++) { for (int posZ = -1; posZ <= 1; posZ++)
|
||||
* { int localID = evt.world.getBlockId(hitX + posX,
|
||||
* hitY, hitZ + posZ); if (localID == bID) { quanta
|
||||
* += evt.world.getBlockMetadata(hitX + posX, hitY,
|
||||
* hitZ + posZ) + 1; } } }
|
||||
*
|
||||
* if (quanta >= 8) { while (quanta > 0) { for (int
|
||||
* posX = -1; posX <= 1; posX++) { for (int posZ =
|
||||
* -1; posZ <= 1; posZ++) { int localID =
|
||||
* evt.world.getBlockId(hitX + posX, hitY, hitZ +
|
||||
* posZ); if (localID == bID) { quanta -= 1; int
|
||||
* meta = evt.world.getBlockMetadata(hitX + posX,
|
||||
* hitY, hitZ + posZ); if (meta > 0)
|
||||
* evt.world.setBlockMetadataWithNotify(hitX + posX,
|
||||
* hitY, hitZ + posZ, meta - 1, 3); else
|
||||
* evt.world.setBlockToAir(hitX + posX, hitY, hitZ +
|
||||
* posZ); } } } } }
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
evt.setResult(Result.ALLOW);
|
||||
evt.result = new ItemStack(TinkerSmeltery.buckets, 1, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO 1.7 Fix this -- for ticking stuffs in extra armor slots
|
||||
|
||||
@SubscribeEvent
|
||||
public void livingUpdate (LivingUpdateEvent event)
|
||||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
TPlayerStats stats = TPlayerStats.get(player);
|
||||
|
||||
if (stats != null && stats.armor != null)
|
||||
{
|
||||
ArmorExtended armor = stats.armor;
|
||||
for (int i = 0; i < armor.getSizeInventory(); i++)
|
||||
{
|
||||
if (armor.getStackInSlot(i) != null)
|
||||
{
|
||||
armor.getStackInSlot(i).getItem().onUpdate(armor.getStackInSlot(i), player.worldObj, player, i, false);
|
||||
armor.getStackInSlot(i).getItem().onArmorTick(player.worldObj, player, armor.getStackInSlot(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Player interact event - prevent breaking of tank air blocks in creative
|
||||
@SubscribeEvent
|
||||
public void playerInteract (PlayerInteractEvent event)
|
||||
{
|
||||
if (event.action == Action.LEFT_CLICK_BLOCK)
|
||||
{
|
||||
Block block = event.entity.worldObj.getBlock(event.x, event.y, event.z);
|
||||
if (block instanceof TankAirBlock)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
@@ -102,7 +103,6 @@ import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.blocks.SoilBlock;
|
||||
import tconstruct.world.itemblocks.CraftedSoilItemBlock;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
@@ -206,6 +206,11 @@ public class TinkerTools
|
||||
|
||||
// recipe stuff
|
||||
public static boolean thaumcraftAvailable;
|
||||
|
||||
public TinkerTools()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(new TinkerToolEvents());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preInit (FMLPreInitializationEvent event)
|
||||
|
||||
@@ -1,10 +1,99 @@
|
||||
package tconstruct.tools;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.client.gui.AdaptiveSmelteryGui;
|
||||
import tconstruct.client.gui.ArmorExtendedGui;
|
||||
import tconstruct.client.gui.CraftingStationGui;
|
||||
import tconstruct.client.gui.FrypanGui;
|
||||
import tconstruct.client.gui.FurnaceGui;
|
||||
import tconstruct.client.gui.GuiLandmine;
|
||||
import tconstruct.client.gui.KnapsackGui;
|
||||
import tconstruct.client.gui.PartCrafterGui;
|
||||
import tconstruct.client.gui.PatternChestGui;
|
||||
import tconstruct.client.gui.SmelteryGui;
|
||||
import tconstruct.client.gui.StencilTableGui;
|
||||
import tconstruct.client.gui.ToolForgeGui;
|
||||
import tconstruct.client.gui.ToolStationGui;
|
||||
import tconstruct.client.tabs.TabRegistry;
|
||||
import tconstruct.mechworks.MechworksProxyCommon;
|
||||
import tconstruct.mechworks.inventory.ContainerLandmine;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import tconstruct.smeltery.SmelteryProxyCommon;
|
||||
import tconstruct.smeltery.logic.AdaptiveSmelteryLogic;
|
||||
import tconstruct.smeltery.logic.SmelteryLogic;
|
||||
import tconstruct.tools.logic.CraftingStationLogic;
|
||||
import tconstruct.tools.logic.FrypanLogic;
|
||||
import tconstruct.tools.logic.FurnaceLogic;
|
||||
import tconstruct.tools.logic.PartBuilderLogic;
|
||||
import tconstruct.tools.logic.PatternChestLogic;
|
||||
import tconstruct.tools.logic.StencilTableLogic;
|
||||
import tconstruct.tools.logic.ToolForgeLogic;
|
||||
import tconstruct.tools.logic.ToolStationLogic;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ToolProxyClient extends ToolProxyCommon
|
||||
{
|
||||
public ToolProxyClient()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
if (ID == ToolProxyCommon.toolStationID)
|
||||
return new ToolStationGui(player.inventory, (ToolStationLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == ToolProxyCommon.partBuilderID)
|
||||
return new PartCrafterGui(player.inventory, (PartBuilderLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == ToolProxyCommon.patternChestID)
|
||||
return new PatternChestGui(player.inventory, (PatternChestLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == ToolProxyCommon.frypanGuiID)
|
||||
return new FrypanGui(player.inventory, (FrypanLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
|
||||
if (ID == ToolProxyCommon.stencilTableID)
|
||||
return new StencilTableGui(player.inventory, (StencilTableLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == ToolProxyCommon.toolForgeID)
|
||||
return new ToolForgeGui(player.inventory, (ToolForgeLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
if (ID == ToolProxyCommon.craftingStationID)
|
||||
return new CraftingStationGui(player.inventory, (CraftingStationLogic) world.getTileEntity(x, y, z), world, x, y, z);
|
||||
|
||||
if (ID == ToolProxyCommon.furnaceID)
|
||||
return new FurnaceGui(player.inventory, (FurnaceLogic) world.getTileEntity(x, y, z));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSound (SoundLoadEvent event)
|
||||
{
|
||||
try
|
||||
{
|
||||
/*
|
||||
* SoundManager soundmanager = event.manager;
|
||||
* soundmanager.addSound("tinker:frypan_hit.ogg");
|
||||
* soundmanager.addSound("tinker:little_saw.ogg");
|
||||
* soundmanager.addSound("tinker:launcher_clank.ogg");
|
||||
* TConstruct.logger.info("Successfully loaded sounds.");
|
||||
*/
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
TConstruct.logger.error("Failed to register one or more sounds");
|
||||
}
|
||||
|
||||
MinecraftForge.EVENT_BUS.unregister(this);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,42 @@
|
||||
package tconstruct.tools;
|
||||
|
||||
public class ToolProxyCommon
|
||||
{
|
||||
import mantle.blocks.abstracts.InventoryLogic;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
public class ToolProxyCommon implements IGuiHandler
|
||||
{
|
||||
public static final int toolStationID = 0;
|
||||
public static final int partBuilderID = 1;
|
||||
public static final int patternChestID = 2;
|
||||
public static final int stencilTableID = 3;
|
||||
public static final int frypanGuiID = 4;
|
||||
public static final int toolForgeID = 5;
|
||||
public static final int furnaceID = 8;
|
||||
public static final int craftingStationID = 11;
|
||||
public void preInit()
|
||||
{
|
||||
|
||||
}
|
||||
public void postInit()
|
||||
{
|
||||
|
||||
}
|
||||
@Override
|
||||
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile != null && tile instanceof InventoryLogic)
|
||||
{
|
||||
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public Object getClientGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,9 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.CraftingStationLogic;
|
||||
import tconstruct.tools.logic.PartBuilderLogic;
|
||||
import tconstruct.tools.logic.PatternChestLogic;
|
||||
@@ -111,17 +111,17 @@ public class CraftingSlab extends InventorySlab
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
return TProxyCommon.craftingStationID;
|
||||
return ToolProxyCommon.craftingStationID;
|
||||
case 1:
|
||||
return TProxyCommon.toolStationID;
|
||||
return ToolProxyCommon.toolStationID;
|
||||
case 2:
|
||||
return TProxyCommon.partBuilderID;
|
||||
return ToolProxyCommon.partBuilderID;
|
||||
case 3:
|
||||
return TProxyCommon.stencilTableID;
|
||||
return ToolProxyCommon.stencilTableID;
|
||||
case 4:
|
||||
return TProxyCommon.patternChestID;
|
||||
return ToolProxyCommon.patternChestID;
|
||||
case 5:
|
||||
return TProxyCommon.toolForgeID;
|
||||
return ToolProxyCommon.toolForgeID;
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
@@ -14,8 +14,8 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.CraftingStationLogic;
|
||||
import tconstruct.tools.model.TableRender;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -80,7 +80,7 @@ public class CraftingStationBlock extends InventoryBlock
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
return TableRender.tabelModelID;
|
||||
return TableRender.model;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -92,7 +92,7 @@ public class CraftingStationBlock extends InventoryBlock
|
||||
@Override
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
return TProxyCommon.craftingStationID;
|
||||
return ToolProxyCommon.craftingStationID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.EquipLogic;
|
||||
import tconstruct.tools.logic.FrypanLogic;
|
||||
import tconstruct.tools.model.FrypanRender;
|
||||
@@ -191,7 +192,7 @@ public class EquipBlock extends InventoryBlock
|
||||
@Override
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
return TConstruct.proxy.frypanGuiID;
|
||||
return ToolProxyCommon.frypanGuiID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,8 +11,8 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.FurnaceLogic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -41,7 +41,7 @@ public class FurnaceSlab extends InventorySlab
|
||||
@Override
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
return TProxyCommon.furnaceID;
|
||||
return ToolProxyCommon.furnaceID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,11 +17,11 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.ToolProxyCommon;
|
||||
import tconstruct.tools.logic.ToolForgeLogic;
|
||||
import tconstruct.tools.model.TableForgeRender;
|
||||
import tconstruct.tools.model.TableRender;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -110,7 +110,7 @@ public class ToolForgeBlock extends InventoryBlock
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
return TableForgeRender.model;
|
||||
return TableRender.model;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,7 +129,7 @@ public class ToolForgeBlock extends InventoryBlock
|
||||
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
|
||||
{
|
||||
int md = world.getBlockMetadata(x, y, z);
|
||||
return TProxyCommon.toolForgeID;
|
||||
return ToolProxyCommon.toolForgeID;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -102,7 +102,7 @@ public class ToolStationBlock extends InventoryBlock
|
||||
@Override
|
||||
public int getRenderType ()
|
||||
{
|
||||
return TableRender.tabelModelID;
|
||||
return TableRender.model;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,10 +3,6 @@ package tconstruct.tools.inventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
|
||||
public class SlotFrypan extends Slot
|
||||
{
|
||||
@@ -19,7 +15,7 @@ public class SlotFrypan extends Slot
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
public void putStack (ItemStack par1ItemStack)
|
||||
{
|
||||
super.putStack(par1ItemStack);
|
||||
@@ -32,6 +28,6 @@ public class SlotFrypan extends Slot
|
||||
}
|
||||
player.addStat(TAchievements.achievements.get("tconstruct:dualConvenience"), 1);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
@@ -34,7 +33,6 @@ public class Manual extends CraftingItem
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
player.addStat(TAchievements.achievements.get("tconstruct:beginner"), 1);
|
||||
Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
player.openGui(TConstruct.instance, mantle.client.MProxyClient.manualGuiID, world, 0, 0, 0);
|
||||
FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(stack, getData(stack)));
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
package tconstruct.tools.model;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class TableForgeRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory (int modelID)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
}
|
||||
@@ -12,58 +12,41 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class TableRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public static int tabelModelID = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static int model = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == tabelModelID)
|
||||
if (modelID == model)
|
||||
{
|
||||
if (metadata == 5)
|
||||
{
|
||||
renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
|
||||
renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
|
||||
{
|
||||
if (modelID == tabelModelID)
|
||||
if (modelID == model)
|
||||
{
|
||||
int metadata = world.getBlockMetadata(x, y, z);
|
||||
if (metadata == 5)
|
||||
{
|
||||
renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -77,7 +60,7 @@ public class TableRender implements ISimpleBlockRenderingHandler
|
||||
@Override
|
||||
public int getRenderId ()
|
||||
{
|
||||
return tabelModelID;
|
||||
return model;
|
||||
}
|
||||
|
||||
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
|
||||
|
||||
@@ -4,10 +4,19 @@ import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import tconstruct.TConstruct;
|
||||
|
||||
public class ItemHelper
|
||||
@@ -30,4 +39,82 @@ public class ItemHelper
|
||||
}
|
||||
}
|
||||
|
||||
public static void addDrops (LivingDropsEvent event, ItemStack dropStack)
|
||||
{
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
|
||||
public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(0, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(1, meta)));// block.getIcon(1, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(2, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(3, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(4, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(5, meta)));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public static void renderInvBlockFace (RenderBlocks renderblocks, Block block, int meta)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
GL11.glRotatef(45, 0, 1, 0);
|
||||
GL11.glRotatef(60, 1, 0, 0);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(0, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(1, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1F);
|
||||
renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(2, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(3, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(4, meta)));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, ItemHelper.getIconSafe(block.getIcon(5, meta)));
|
||||
tessellator.draw();
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public static IIcon getIconSafe (IIcon icon)
|
||||
{
|
||||
if (icon != null)
|
||||
return icon;
|
||||
return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.player.TPlayerStats;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
|
||||
public class TCraftingHandler // implements ICraftingHandler
|
||||
{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onCrafting (ItemCraftedEvent event)// EntityPlayer player,
|
||||
// ItemStack itemstack,
|
||||
// IInventory craftMatrix)
|
||||
{
|
||||
Item item = event.crafting.getItem();
|
||||
if (!event.player.worldObj.isRemote)
|
||||
{
|
||||
if (item == Item.getItemFromBlock(TinkerTools.toolStationWood))
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(event.player);
|
||||
if (!stats.materialManual)
|
||||
{
|
||||
stats.materialManual = true;
|
||||
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TinkerTools.manualBook, 1, 1));
|
||||
}
|
||||
}
|
||||
if (item == Item.getItemFromBlock(TinkerSmeltery.smeltery) || item == Item.getItemFromBlock(TinkerSmeltery.lavaTank))
|
||||
{
|
||||
TPlayerStats stats = TPlayerStats.get(event.player);
|
||||
if (!stats.smelteryManual)
|
||||
{
|
||||
stats.smelteryManual = true;
|
||||
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TinkerTools.manualBook, 1, 2));
|
||||
}
|
||||
event.player.addStat(TAchievements.achievements.get("tconstruct:smelteryMaker"), 1);
|
||||
}
|
||||
|
||||
if (item == Item.getItemFromBlock(TinkerTools.craftingStationWood))
|
||||
{
|
||||
event.player.addStat(TAchievements.achievements.get("tconstruct:betterCrafting"), 1);
|
||||
}
|
||||
else if (item == TinkerTools.blankPattern)
|
||||
{
|
||||
event.player.addStat(TAchievements.achievements.get("tconstruct:pattern"), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.library.event.SmelteryEvent;
|
||||
import tconstruct.library.event.ToolCraftedEvent;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.tools.Weapon;
|
||||
import tconstruct.tools.logic.ToolForgeLogic;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class TEventHandlerAchievement
|
||||
{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onToolCrafted (ToolCraftedEvent event)
|
||||
{
|
||||
if (event.player != null && !(event.player instanceof FakePlayer))
|
||||
{
|
||||
event.player.addStat(TAchievements.achievements.get("tconstruct:tinkerer"), 1);
|
||||
|
||||
if (event.tool != null && event.tool.getItem() instanceof Weapon)
|
||||
{
|
||||
event.player.addStat(TAchievements.achievements.get("tconstruct:preparedFight"), 1);
|
||||
}
|
||||
|
||||
if (event.inventory != null && event.inventory instanceof ToolForgeLogic && event.tool.getItem() instanceof ToolCore && ((ToolCore) event.tool.getItem()).durabilityTypeExtra() != 0)
|
||||
{
|
||||
event.player.addStat(TAchievements.achievements.get("tconstruct:proTinkerer"), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemPlacedIntoCasting (SmelteryEvent.ItemInsertedIntoCasting event)
|
||||
{
|
||||
if (event.player != null && event.item != null)
|
||||
{
|
||||
if (event.item.getItem() instanceof ToolCore)
|
||||
{
|
||||
event.player.addStat(TAchievements.achievements.get("tconstruct:doingItWrong"), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -168,9 +168,6 @@ public class PHConstruct
|
||||
isCleaverTwoHanded = config.get("Battlegear", "Can Cleavers have shields", true).getBoolean(true);
|
||||
isHatchetWeapon = config.get("Battlegear", "Are Hatches also weapons", true).getBoolean(true);
|
||||
|
||||
// Achievement Properties
|
||||
achievementsEnabled = config.get("Achievement Properties", "AchievementsEnabled", true).getBoolean(true);
|
||||
|
||||
/* Save the configuration file */
|
||||
config.save();
|
||||
|
||||
@@ -329,7 +326,4 @@ public class PHConstruct
|
||||
// Addon stuff
|
||||
public static boolean isCleaverTwoHanded;
|
||||
public static boolean isHatchetWeapon;
|
||||
|
||||
// Achievement options
|
||||
public static boolean achievementsEnabled;
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import mantle.common.network.AbstractPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.common.TProxyCommon;
|
||||
import tconstruct.armor.ArmorProxyCommon;
|
||||
|
||||
public class PacketExtendedInventory extends AbstractPacket
|
||||
{
|
||||
@@ -45,14 +45,14 @@ public class PacketExtendedInventory extends AbstractPacket
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TProxyCommon.inventoryGui:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
case ArmorProxyCommon.inventoryGui:
|
||||
player.openGui(TConstruct.instance, ArmorProxyCommon.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
case TProxyCommon.armorGuiID:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
case ArmorProxyCommon.armorGuiID:
|
||||
player.openGui(TConstruct.instance, ArmorProxyCommon.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
case TProxyCommon.knapsackGuiID:
|
||||
player.openGui(TConstruct.instance, TConstruct.proxy.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
case ArmorProxyCommon.knapsackGuiID:
|
||||
player.openGui(TConstruct.instance, ArmorProxyCommon.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.util;
|
||||
package tconstruct.world;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tconstruct.util;
|
||||
package tconstruct.world;
|
||||
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
@@ -1,11 +1,9 @@
|
||||
package tconstruct.world;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import mantle.utils.RecipeRemover;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.block.Block.SoundType;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -13,19 +11,18 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.achievements.TAchievements;
|
||||
import tconstruct.armor.TinkerArmor;
|
||||
import tconstruct.blocks.SlabBase;
|
||||
import tconstruct.blocks.logic.DryingRackLogic;
|
||||
@@ -40,13 +37,14 @@ import tconstruct.blocks.traps.Punji;
|
||||
import tconstruct.client.StepSoundSlime;
|
||||
import tconstruct.common.itemblocks.MetadataItemBlock;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.mechworks.blocks.BlockLandmine;
|
||||
import tconstruct.mechworks.TinkerMechworks;
|
||||
import tconstruct.mechworks.entity.item.EntityLandmineFirework;
|
||||
import tconstruct.mechworks.entity.item.ExplosivePrimed;
|
||||
import tconstruct.mechworks.itemblocks.ItemBlockLandmine;
|
||||
import tconstruct.mechworks.logic.TileEntityLandmine;
|
||||
import tconstruct.smeltery.TinkerSmeltery;
|
||||
import tconstruct.smeltery.blocks.MetalOre;
|
||||
import tconstruct.tools.TDispenserBehaviorArrow;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.tools.blocks.MultiBrick;
|
||||
import tconstruct.tools.blocks.MultiBrickFancy;
|
||||
@@ -56,8 +54,6 @@ import tconstruct.tools.entity.FancyEntityItem;
|
||||
import tconstruct.tools.entity.LaunchedPotion;
|
||||
import tconstruct.tools.itemblocks.MultiBrickFancyItem;
|
||||
import tconstruct.tools.itemblocks.MultiBrickItem;
|
||||
import tconstruct.util.TDispenserBehaviorArrow;
|
||||
import tconstruct.util.TDispenserBehaviorSpawnEgg;
|
||||
import tconstruct.world.blocks.ConveyorBase;
|
||||
import tconstruct.world.blocks.GravelOre;
|
||||
import tconstruct.world.blocks.MeatBlock;
|
||||
@@ -88,6 +84,7 @@ import tconstruct.world.items.StrangeFood;
|
||||
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.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
@@ -97,8 +94,11 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@Mod(modid = "TinkerWorld", name = "TinkerWorld", version = "${tinkerworldversion}")
|
||||
public class TinkerWorld
|
||||
{
|
||||
@Instance("TinkerArmor")
|
||||
@Instance("TinkerWorld")
|
||||
public static TinkerWorld instance;
|
||||
@SidedProxy(clientSide = "tconstruct.world.TinkerWorldProxyClient", serverSide = "tconstruct.world.TinkerWorldProxyCommon")
|
||||
public static TinkerWorldProxyCommon proxy;
|
||||
|
||||
public static Item strangeFood;
|
||||
// Decoration
|
||||
public static Block stoneTorch;
|
||||
@@ -134,9 +134,12 @@ public class TinkerWorld
|
||||
// Chest hooks
|
||||
public static ChestGenHooks tinkerHouseChest;
|
||||
public static ChestGenHooks tinkerHousePatterns;
|
||||
// Traps
|
||||
public static Block landmine;
|
||||
public static Block punji;
|
||||
|
||||
public TinkerWorld()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(new TinkerWorldEvents());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preInit (FMLPreInitializationEvent event)
|
||||
@@ -148,7 +151,6 @@ public class TinkerWorld
|
||||
TinkerWorld.woolSlab2 = new SlabBase(Material.cloth, Blocks.wool, 8, 8).setBlockName("cloth");
|
||||
TinkerWorld.woolSlab2.setStepSound(Block.soundTypeCloth).setCreativeTab(CreativeTabs.tabDecorations);
|
||||
// Traps
|
||||
TinkerWorld.landmine = new BlockLandmine().setHardness(0.5F).setResistance(0F).setStepSound(Block.soundTypeMetal).setCreativeTab(CreativeTabs.tabRedstone).setBlockName("landmine");
|
||||
TinkerWorld.punji = new Punji().setBlockName("trap.punji");
|
||||
TinkerWorld.barricadeOak = new BarricadeBlock(Blocks.log, 0).setBlockName("trap.barricade.oak");
|
||||
TinkerWorld.barricadeSpruce = new BarricadeBlock(Blocks.log, 1).setBlockName("trap.barricade.spruce");
|
||||
@@ -212,7 +214,7 @@ public class TinkerWorld
|
||||
GameRegistry.registerBlock(TinkerWorld.woolSlab2, WoolSlab2Item.class, "WoolSlab2");
|
||||
|
||||
// Traps
|
||||
GameRegistry.registerBlock(TinkerWorld.landmine, ItemBlockLandmine.class, "Redstone.Landmine");
|
||||
GameRegistry.registerBlock(TinkerMechworks.landmine, ItemBlockLandmine.class, "Redstone.Landmine");
|
||||
GameRegistry.registerTileEntity(TileEntityLandmine.class, "Landmine");
|
||||
GameRegistry.registerBlock(TinkerWorld.punji, "trap.punji");
|
||||
GameRegistry.registerBlock(TinkerWorld.barricadeOak, BarricadeItem.class, "trap.barricade.oak");
|
||||
@@ -405,13 +407,13 @@ public class TinkerWorld
|
||||
|
||||
|
||||
// Landmine Recipes
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerWorld.landmine, 1, 0), "mcm", "rpr", 'm', "plankWood", 'c', new ItemStack(TinkerTools.blankPattern, 1, 1), 'r', Items.redstone,
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerMechworks.landmine, 1, 0), "mcm", "rpr", 'm', "plankWood", 'c', new ItemStack(TinkerTools.blankPattern, 1, 1), 'r', Items.redstone,
|
||||
'p', Blocks.stone_pressure_plate));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerWorld.landmine, 1, 1), "mcm", "rpr", 'm', Blocks.stone, 'c', new ItemStack(TinkerTools.blankPattern, 1, 1), 'r', Items.redstone,
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerMechworks.landmine, 1, 1), "mcm", "rpr", 'm', Blocks.stone, 'c', new ItemStack(TinkerTools.blankPattern, 1, 1), 'r', Items.redstone,
|
||||
'p', Blocks.stone_pressure_plate));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerWorld.landmine, 1, 2), "mcm", "rpr", 'm', Blocks.obsidian, 'c', new ItemStack(TinkerTools.blankPattern, 1, 1), 'r',
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerMechworks.landmine, 1, 2), "mcm", "rpr", 'm', Blocks.obsidian, 'c', new ItemStack(TinkerTools.blankPattern, 1, 1), 'r',
|
||||
Items.redstone, 'p', Blocks.stone_pressure_plate));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerWorld.landmine, 1, 3), "mcm", "rpr", 'm', Items.repeater, 'c', new ItemStack(TinkerTools.blankPattern, 1, 1), 'r',
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkerMechworks.landmine, 1, 3), "mcm", "rpr", 'm', Items.repeater, 'c', new ItemStack(TinkerTools.blankPattern, 1, 1), 'r',
|
||||
Items.redstone, 'p', Blocks.stone_pressure_plate));
|
||||
|
||||
// Ultra hardcore recipes
|
||||
@@ -635,29 +637,6 @@ public class TinkerWorld
|
||||
OreDictionary.registerOre(oreName, is);
|
||||
}
|
||||
}
|
||||
|
||||
public void addAchievements ()
|
||||
{
|
||||
HashMap<String, Achievement> achievements = TAchievements.achievements;
|
||||
|
||||
achievements.put("tconstruct:beginner", new Achievement("tconstruct:beginner", "tconstruct.beginner", 0, 0, TinkerTools.manualBook, null));// .setIndependent());
|
||||
achievements.put("tconstruct:pattern", new Achievement("tconstruct:pattern", "tconstruct.pattern", 2, 1, TinkerTools.blankPattern, achievements.get("tconstruct:beginner")));
|
||||
achievements.put("tconstruct:tinkerer", new Achievement("tconstruct:tinkerer", "tconstruct.tinkerer", 2, 2, new ItemStack(TinkerTools.titleIcon, 1, 4096), achievements.get("tconstruct:pattern")));
|
||||
achievements.put("tconstruct:preparedFight",
|
||||
new Achievement("tconstruct:preparedFight", "tconstruct.preparedFight", 1, 3, new ItemStack(TinkerTools.titleIcon, 1, 4097), achievements.get("tconstruct:tinkerer")));
|
||||
achievements.put("tconstruct:proTinkerer",
|
||||
new Achievement("tconstruct:proTinkerer", "tconstruct.proTinkerer", 4, 4, new ItemStack(TinkerTools.titleIcon, 1, 4098), achievements.get("tconstruct:tinkerer")).setSpecial());
|
||||
achievements.put("tconstruct:smelteryMaker", new Achievement("tconstruct:smelteryMaker", "tconstruct.smelteryMaker", -2, -1, TinkerSmeltery.smeltery, achievements.get("tconstruct:beginner")));
|
||||
achievements.put("tconstruct:enemySlayer",
|
||||
new Achievement("tconstruct:enemySlayer", "tconstruct.enemySlayer", 0, 5, new ItemStack(TinkerTools.titleIcon, 1, 4099), achievements.get("tconstruct:preparedFight")));
|
||||
achievements.put("tconstruct:dualConvenience",
|
||||
new Achievement("tconstruct:dualConvenience", "tconstruct.dualConvenience", 0, 7, new ItemStack(TinkerTools.titleIcon, 1, 4100), achievements.get("tconstruct:enemySlayer")).setSpecial());
|
||||
achievements.put("tconstruct:doingItWrong",
|
||||
new Achievement("tconstruct:doingItWrong", "tconstruct.doingItWrong", -2, -3, new ItemStack(TinkerTools.manualBook, 1, 2), achievements.get("tconstruct:smelteryMaker")));
|
||||
achievements.put("tconstruct:betterCrafting",
|
||||
new Achievement("tconstruct:betterCrafting", "tconstruct.betterCrafting", -2, 2, TinkerTools.craftingStationWood, achievements.get("tconstruct:beginner")));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void addLoot ()
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
package tconstruct.world;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.EntitySpider;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.armor.TinkerArmor;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.world.entity.BlueSlime;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class TinkerWorldEvents
|
||||
{
|
||||
@SubscribeEvent
|
||||
public void onLivingSpawn (LivingSpawnEvent.SpecialSpawn event)
|
||||
{
|
||||
EntityLivingBase living = event.entityLiving;
|
||||
if (living.getClass() == EntitySpider.class && TConstruct.random.nextInt(100) == 0)
|
||||
{
|
||||
EntityCreeper creeper = new EntityCreeper(living.worldObj);
|
||||
spawnEntityLiving(living.posX, living.posY + 1, living.posZ, creeper, living.worldObj);
|
||||
if (living.riddenByEntity != null)
|
||||
creeper.mountEntity(living.riddenByEntity);
|
||||
else
|
||||
creeper.mountEntity(living);
|
||||
|
||||
EntityXPOrb orb = new EntityXPOrb(living.worldObj, living.posX, living.posY, living.posZ, TConstruct.random.nextInt(20) + 20);
|
||||
orb.mountEntity(creeper);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnEntityLiving (double x, double y, double z, EntityLiving entity, World world)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.setPosition(x, y, z);
|
||||
entity.onSpawnWithEgg((IEntityLivingData) null);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/* Bonemeal */
|
||||
@SubscribeEvent
|
||||
public void bonemealEvent (BonemealEvent event)
|
||||
{
|
||||
if (!event.world.isRemote)
|
||||
{
|
||||
if (event.block == TinkerWorld.slimeSapling)
|
||||
{
|
||||
if (TinkerWorld.slimeSapling.boneFertilize(event.world, event.x, event.y, event.z, event.world.rand, event.entityPlayer))
|
||||
event.setResult(Event.Result.ALLOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Damage */
|
||||
@SubscribeEvent
|
||||
public void onHurt (LivingHurtEvent event)
|
||||
{
|
||||
EntityLivingBase reciever = event.entityLiving;
|
||||
if (reciever instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
// Cutlass
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if (stack != null && player.isUsingItem())
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
if (item == TinkerTools.cutlass)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 3 * 20, 1));
|
||||
}
|
||||
else if (item == TinkerTools.battlesign)
|
||||
{
|
||||
event.ammount *= 1.5; //Puts battlesign blocking at 3/4 instead of 1/2
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (reciever instanceof EntityCreeper)
|
||||
{
|
||||
Entity attacker = event.source.getEntity();
|
||||
if (attacker instanceof EntityLivingBase)
|
||||
{
|
||||
Entity target = ((EntityCreeper) reciever).getAttackTarget();
|
||||
if (target != null)
|
||||
{
|
||||
float d1 = reciever.getDistanceToEntity(((EntityCreeper) reciever).getAttackTarget());
|
||||
float d2 = reciever.getDistanceToEntity(attacker);
|
||||
if (d2 < d1)
|
||||
{
|
||||
((EntityCreeper) event.entityLiving).setAttackTarget((EntityLivingBase) event.source.getEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingDrop (LivingDropsEvent event)
|
||||
{
|
||||
if (event.entityLiving == null)
|
||||
return;
|
||||
|
||||
if (event.entityLiving.getClass() == EntityGhast.class)
|
||||
{
|
||||
if (PHConstruct.uhcGhastDrops)
|
||||
{
|
||||
for (EntityItem o : event.drops)
|
||||
{
|
||||
if (o.getEntityItem().getItem() == Items.ghast_tear)
|
||||
{
|
||||
o.setEntityItemStack(new ItemStack(Items.gold_ingot, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemHelper.addDrops(event, new ItemStack(Items.ghast_tear, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
package tconstruct.world;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityAuraFX;
|
||||
import net.minecraft.client.particle.EntityBreakingFX;
|
||||
import net.minecraft.client.particle.EntityBubbleFX;
|
||||
import net.minecraft.client.particle.EntityCloudFX;
|
||||
import net.minecraft.client.particle.EntityCritFX;
|
||||
import net.minecraft.client.particle.EntityDropParticleFX;
|
||||
import net.minecraft.client.particle.EntityEnchantmentTableParticleFX;
|
||||
import net.minecraft.client.particle.EntityExplodeFX;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.particle.EntityFireworkSparkFX;
|
||||
import net.minecraft.client.particle.EntityFlameFX;
|
||||
import net.minecraft.client.particle.EntityFootStepFX;
|
||||
import net.minecraft.client.particle.EntityHeartFX;
|
||||
import net.minecraft.client.particle.EntityHugeExplodeFX;
|
||||
import net.minecraft.client.particle.EntityLargeExplodeFX;
|
||||
import net.minecraft.client.particle.EntityLavaFX;
|
||||
import net.minecraft.client.particle.EntityNoteFX;
|
||||
import net.minecraft.client.particle.EntityPortalFX;
|
||||
import net.minecraft.client.particle.EntityReddustFX;
|
||||
import net.minecraft.client.particle.EntitySmokeFX;
|
||||
import net.minecraft.client.particle.EntitySnowShovelFX;
|
||||
import net.minecraft.client.particle.EntitySpellParticleFX;
|
||||
import net.minecraft.client.particle.EntitySplashFX;
|
||||
import net.minecraft.client.particle.EntitySuspendFX;
|
||||
import net.minecraft.init.Items;
|
||||
|
||||
public class TinkerWorldProxyClient extends TinkerWorldProxyCommon
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
@Override
|
||||
public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ)
|
||||
{
|
||||
this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ);
|
||||
}
|
||||
|
||||
public EntityFX doSpawnParticle (String par1Str, double par2, double par4, double par6, double par8, double par10, double par12)
|
||||
{
|
||||
if (this.mc == null)
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
|
||||
if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null)
|
||||
{
|
||||
int i = this.mc.gameSettings.particleSetting;
|
||||
|
||||
if (i == 1 && mc.theWorld.rand.nextInt(3) == 0)
|
||||
{
|
||||
i = 2;
|
||||
}
|
||||
|
||||
double d6 = this.mc.renderViewEntity.posX - par2;
|
||||
double d7 = this.mc.renderViewEntity.posY - par4;
|
||||
double d8 = this.mc.renderViewEntity.posZ - par6;
|
||||
EntityFX entityfx = null;
|
||||
|
||||
if (par1Str.equals("hugeexplosion"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityHugeExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12));
|
||||
}
|
||||
else if (par1Str.equals("largeexplode"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityLargeExplodeFX(mc.renderEngine, mc.theWorld, par2, par4, par6, par8, par10, par12));
|
||||
}
|
||||
else if (par1Str.equals("fireworksSpark"))
|
||||
{
|
||||
this.mc.effectRenderer.addEffect(entityfx = new EntityFireworkSparkFX(mc.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer));
|
||||
}
|
||||
|
||||
if (entityfx != null)
|
||||
{
|
||||
return (EntityFX) entityfx;
|
||||
}
|
||||
else
|
||||
{
|
||||
double d9 = 16.0D;
|
||||
|
||||
if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par1Str.equals("bubble"))
|
||||
{
|
||||
entityfx = new EntityBubbleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("suspended"))
|
||||
{
|
||||
entityfx = new EntitySuspendFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("depthsuspend"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("townaura"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("crit"))
|
||||
{
|
||||
entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("smoke"))
|
||||
{
|
||||
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("mobSpell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
||||
((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12);
|
||||
}
|
||||
else if (par1Str.equals("mobSpellAmbient"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
||||
((EntityFX) entityfx).setAlphaF(0.15F);
|
||||
((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12);
|
||||
}
|
||||
else if (par1Str.equals("spell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("instantSpell"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
|
||||
}
|
||||
else if (par1Str.equals("witchMagic"))
|
||||
{
|
||||
entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
|
||||
float f = mc.theWorld.rand.nextFloat() * 0.5F + 0.35F;
|
||||
((EntityFX) entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f);
|
||||
}
|
||||
else if (par1Str.equals("note"))
|
||||
{
|
||||
entityfx = new EntityNoteFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("portal"))
|
||||
{
|
||||
entityfx = new EntityPortalFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("enchantmenttable"))
|
||||
{
|
||||
entityfx = new EntityEnchantmentTableParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("explode"))
|
||||
{
|
||||
entityfx = new EntityExplodeFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("flame"))
|
||||
{
|
||||
entityfx = new EntityFlameFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("lava"))
|
||||
{
|
||||
entityfx = new EntityLavaFX(mc.theWorld, par2, par4, par6);
|
||||
}
|
||||
else if (par1Str.equals("footstep"))
|
||||
{
|
||||
entityfx = new EntityFootStepFX(mc.renderEngine, mc.theWorld, par2, par4, par6);
|
||||
}
|
||||
else if (par1Str.equals("splash"))
|
||||
{
|
||||
entityfx = new EntitySplashFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("largesmoke"))
|
||||
{
|
||||
entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12, 2.5F);
|
||||
}
|
||||
else if (par1Str.equals("cloud"))
|
||||
{
|
||||
entityfx = new EntityCloudFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("reddust"))
|
||||
{
|
||||
entityfx = new EntityReddustFX(mc.theWorld, par2, par4, par6, (float) par8, (float) par10, (float) par12);
|
||||
}
|
||||
else if (par1Str.equals("snowballpoof"))
|
||||
{
|
||||
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Items.snowball);
|
||||
}
|
||||
else if (par1Str.equals("dripWater"))
|
||||
{
|
||||
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.water);
|
||||
}
|
||||
else if (par1Str.equals("dripLava"))
|
||||
{
|
||||
entityfx = new EntityDropParticleFX(mc.theWorld, par2, par4, par6, Material.lava);
|
||||
}
|
||||
else if (par1Str.equals("snowshovel"))
|
||||
{
|
||||
entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("blueslime"))
|
||||
{
|
||||
entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TinkerWorld.strangeFood);
|
||||
}
|
||||
else if (par1Str.equals("heart"))
|
||||
{
|
||||
entityfx = new EntityHeartFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
}
|
||||
else if (par1Str.equals("angryVillager"))
|
||||
{
|
||||
entityfx = new EntityHeartFX(mc.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12);
|
||||
((EntityFX) entityfx).setParticleTextureIndex(81);
|
||||
((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
else if (par1Str.equals("happyVillager"))
|
||||
{
|
||||
entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12);
|
||||
((EntityFX) entityfx).setParticleTextureIndex(82);
|
||||
((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if (entityfx != null)
|
||||
{
|
||||
this.mc.effectRenderer.addEffect((EntityFX) entityfx);
|
||||
}
|
||||
|
||||
return (EntityFX) entityfx;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package tconstruct.world;
|
||||
|
||||
public class TinkerWorldProxyCommon
|
||||
{
|
||||
|
||||
public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package tconstruct.world.model;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@@ -136,9 +136,9 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler
|
||||
if (modelID == model)
|
||||
{
|
||||
renderer.setRenderBounds(0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
renderer.setRenderBounds(0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package tconstruct.world.model;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class OreberryRender implements ISimpleBlockRenderingHandler
|
||||
if (modelID == model)
|
||||
{
|
||||
renderer.setRenderBounds(0.125F, 0.0F, 0.125F, 0.875F, 0.75F, 0.875F);
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class SlimeChannelRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
TProxyClient.renderStandardInvBlock(renderer, block, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, block, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import tconstruct.client.BlockSkinRenderHelper;
|
||||
import tconstruct.client.TProxyClient;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import tconstruct.world.blocks.SlimePad;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
@@ -19,7 +19,7 @@ public class SlimePadRender implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
if (modelID == model)
|
||||
{
|
||||
TProxyClient.renderStandardInvBlock(renderer, TinkerWorld.slimeGel, metadata);
|
||||
ItemHelper.renderStandardInvBlock(renderer, TinkerWorld.slimeGel, metadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.village.MerchantRecipe;
|
||||
import net.minecraft.village.MerchantRecipeList;
|
||||
import tconstruct.mechworks.TinkerMechworks;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.world.TinkerWorld;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
|
||||
@@ -40,7 +41,7 @@ public class TVillageTrades implements IVillageTradeHandler
|
||||
allowedIngredients.add(new ItemStack(TinkerTools.toolStationWood, 3, 10));
|
||||
for (int sc = 0; sc < 4; sc++)
|
||||
{
|
||||
allowedIngredients.add(new ItemStack(TinkerWorld.landmine, 64, sc));
|
||||
allowedIngredients.add(new ItemStack(TinkerMechworks.landmine, 64, sc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user