Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47f4ab43f5 | ||
|
|
d84f4c5fda | ||
|
|
00800e8611 | ||
|
|
2cc006f911 | ||
|
|
ee68f7828d | ||
|
|
971203650e | ||
|
|
b6cf110de9 | ||
|
|
815f838cc1 | ||
|
|
61b1dd17ab | ||
|
|
926444293d | ||
|
|
b604fe65fa | ||
|
|
3f4ec95e51 | ||
|
|
25a4df53e4 | ||
|
|
3cf59925bc | ||
|
|
071b1aab03 | ||
|
|
c94c33fdac | ||
|
|
d881b73ec4 | ||
|
|
fa31630cfa | ||
|
|
c01202d355 | ||
|
|
1f43d9cd50 | ||
|
|
00ddb35273 |
No files matched your search
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright (c) SpaceToad, 2011
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package buildcraft.api.core;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SafeTimeTracker {
|
||||
|
||||
private long lastMark = 0;
|
||||
|
||||
/**
|
||||
* Return true if a given delay has passed since last time marked was called successfully.
|
||||
*/
|
||||
public boolean markTimeIfDelay(World world, long delay) {
|
||||
if (world == null)
|
||||
return false;
|
||||
|
||||
long currentTime = world.getWorldTime();
|
||||
|
||||
if (currentTime < lastMark) {
|
||||
lastMark = currentTime;
|
||||
return false;
|
||||
} else if (lastMark + delay <= currentTime) {
|
||||
lastMark = world.getWorldTime();
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public void markTime(World world) {
|
||||
lastMark = world.getWorldTime();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package buildcraft.api.power;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.core.SafeTimeTracker;
|
||||
|
||||
public interface IPowerProvider {
|
||||
|
||||
int getLatency();
|
||||
|
||||
int getMinEnergyReceived();
|
||||
|
||||
int getMaxEnergyReceived();
|
||||
|
||||
int getMaxEnergyStored();
|
||||
|
||||
int getActivationEnergy();
|
||||
|
||||
float getEnergyStored();
|
||||
|
||||
void configure(int latency, int minEnergyReceived, int maxEnergyReceived, int minActivationEnergy, int maxStoredEnergy);
|
||||
|
||||
void configurePowerPerdition(int powerLoss, int powerLossRegularity);
|
||||
|
||||
boolean update(IPowerReceptor receptor);
|
||||
|
||||
boolean preConditions(IPowerReceptor receptor);
|
||||
|
||||
float useEnergy(float min, float max, boolean doUse);
|
||||
|
||||
void readFromNBT(NBTTagCompound nbttagcompound);
|
||||
|
||||
void writeToNBT(NBTTagCompound nbttagcompound);
|
||||
|
||||
void receiveEnergy(float quantity, ForgeDirection from);
|
||||
|
||||
boolean isPowerSource(ForgeDirection from);
|
||||
|
||||
SafeTimeTracker getTimeTracker();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public License
|
||||
* 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.api.power;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public interface IPowerReceptor {
|
||||
|
||||
public void setPowerProvider(IPowerProvider provider);
|
||||
|
||||
public IPowerProvider getPowerProvider();
|
||||
|
||||
public void doWork();
|
||||
|
||||
/**
|
||||
* Used to request power from pipes. The return cannot be relied on to be
|
||||
* anything more than a approximate guide to the power needed. When
|
||||
* transferring power, you much check the return value of
|
||||
* PowerProvider.receiverEnergy().
|
||||
*
|
||||
* @param from
|
||||
* @return
|
||||
*/
|
||||
public int powerRequest(ForgeDirection from);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Copyright (c) SpaceToad, 2011
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package buildcraft.api.power;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public abstract class PowerFramework {
|
||||
|
||||
static private String baseNBTName = "net.minecraft.src.buildcarft.Power";
|
||||
|
||||
public static PowerFramework currentFramework;
|
||||
|
||||
public abstract IPowerProvider createPowerProvider();
|
||||
|
||||
public void loadPowerProvider(IPowerReceptor receptor, NBTTagCompound compound) {
|
||||
|
||||
IPowerProvider provider = createPowerProvider();
|
||||
|
||||
if (compound.hasKey(baseNBTName)) {
|
||||
NBTTagCompound cpt = compound.getCompoundTag(baseNBTName);
|
||||
if (cpt.getString("class").equals(this.getClass().getName())) {
|
||||
provider.readFromNBT(cpt.getCompoundTag("contents"));
|
||||
}
|
||||
}
|
||||
|
||||
receptor.setPowerProvider(provider);
|
||||
}
|
||||
|
||||
public void savePowerProvider(IPowerReceptor receptor, NBTTagCompound compound) {
|
||||
|
||||
IPowerProvider provider = receptor.getPowerProvider();
|
||||
|
||||
if (provider == null)
|
||||
return;
|
||||
|
||||
NBTTagCompound cpt = new NBTTagCompound();
|
||||
|
||||
cpt.setString("class", this.getClass().getName());
|
||||
|
||||
NBTTagCompound contents = new NBTTagCompound();
|
||||
|
||||
provider.writeToNBT(contents);
|
||||
|
||||
cpt.setTag("contents", contents);
|
||||
compound.setTag(baseNBTName, cpt);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,14 +2,14 @@
|
||||
{
|
||||
"modid": "ThaumicTinkerer",
|
||||
"name": "Thaumic Tinkerer",
|
||||
"description": "An addon to Thaumcraft 3, implementing new content. This mod is a spiritual successor to Elemental Tinkerer. Researches that come from this mod are prefixed by [TT]. Compiled for Thaumcraft 3.0.5.",
|
||||
"version": "1.0.7",
|
||||
"description": "An addon to Thaumcraft 3, implementing new content. This mod is a spiritual successor to Elemental Tinkerer. Researches that come from this mod are prefixed by [TT]. Compiled for Thaumcraft 3.0.5h1.",
|
||||
"version": "1.0.8",
|
||||
"mcversion": "1.5.2",
|
||||
"logoFile": "/mods/ThaumicTinkerer/logo.png",
|
||||
"url": "minecraftforum.net/topic/1813058-",
|
||||
"updateUrl": "",
|
||||
"authors": ["Vazkii"],
|
||||
"credits": "Azanor for creating Thaumcraft. TheAtlanticCraft, MartysGames, TheWhiteWolves.",
|
||||
"credits": "Azanor for creating Thaumcraft. TheAtlanticCraft, MartysGames, TheWhiteWolves, mDyio.",
|
||||
"parent": "",
|
||||
"screenshots": [],
|
||||
"dependencies": ["Thaumcraft"]
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [26 Jul 2013, 02:13:54 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.tile.TileEntityInterface;
|
||||
|
||||
public class BlockInterface extends BlockModContainer {
|
||||
|
||||
public BlockInterface(int par1) {
|
||||
super(par1, Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
return new TileEntityInterface();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [6 Jul 2013, 15:16:20 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.Config;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import vazkii.tinkerer.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.lib.LibGuiIDs;
|
||||
import vazkii.tinkerer.lib.LibRenderIDs;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMobMagnet extends BlockModContainer {
|
||||
|
||||
Random random;
|
||||
|
||||
public BlockMobMagnet(int par1) {
|
||||
super(par1, Material.iron);
|
||||
setBlockBounds(0.0625F, 0F, 0.0625F, 0.9375F, 1F / 16F * 2F, 0.9375F);
|
||||
setHardness(1.7F);
|
||||
setResistance(1F);
|
||||
setStepSound(soundWoodFootstep);
|
||||
|
||||
random = new Random();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
if(par5EntityPlayer.getCurrentEquippedItem() != null) {
|
||||
if(par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
|
||||
TileEntity tile = par1World.getBlockTileEntity(par2, par3, par4);
|
||||
if(tile != null) {
|
||||
par5EntityPlayer.openGui(ThaumicTinkerer.modInstance, LibGuiIDs.ID_MOB_MAGNET, par1World, par2, par3, par4);
|
||||
if(!par1World.isRemote) {
|
||||
par1World.playSoundEffect(par2, par3, par4, "thaumcraft.key", 1F, 0.5F);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int meta = par1World.getBlockMetadata(par2, par3, par4);
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta == 0 ? 1 : 0, 2);
|
||||
if(!par1World.isRemote) {
|
||||
par1World.playSoundEffect(par2, par3, par4, "random.click", 1F, 0.5F);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||
TileEntityMobMagnet mobMagnet = (TileEntityMobMagnet) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
|
||||
if (mobMagnet != null) {
|
||||
for (int j1 = 0; j1 < mobMagnet.getSizeInventory(); ++j1) {
|
||||
ItemStack itemstack = mobMagnet.getStackInSlot(j1);
|
||||
|
||||
if (itemstack != null) {
|
||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if (k1 > itemstack.stackSize)
|
||||
k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.itemID, k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)random.nextGaussian() * f3;
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
par1World.func_96440_m(par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
return Config.blockWooden.getIcon(par1, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idMobMagnet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
return new TileEntityMobMagnet();
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,8 @@ public final class ModBlocks {
|
||||
public static Block phantomStone;
|
||||
public static Block nitorGas;
|
||||
public static Block magnet;
|
||||
public static Block mobMagnet;
|
||||
public static Block interfase;
|
||||
|
||||
public static void initBlocks() {
|
||||
glowstoneGas = new BlockGlowstoneGas(LibBlockIDs.idGlowstoneGas).setUnlocalizedName(LibBlockNames.GLOWSTONE_GAS);
|
||||
@@ -55,6 +57,8 @@ public final class ModBlocks {
|
||||
phantomStone = new BlockPhantomStone(LibBlockIDs.idPhantomStone).setUnlocalizedName(LibBlockNames.PHANTOM_STONE);
|
||||
nitorGas = new BlockNitorGas(LibBlockIDs.idNitorGas).setUnlocalizedName(LibBlockNames.NITOR_GAS);
|
||||
magnet = new BlockMagnet(LibBlockIDs.idMagnet).setUnlocalizedName(LibBlockNames.MAGNET);
|
||||
mobMagnet = new BlockMobMagnet(LibBlockIDs.idMobMagnet).setUnlocalizedName(LibBlockNames.MOB_MAGNET);
|
||||
interfase = new BlockInterface(LibBlockIDs.idInterface).setUnlocalizedName(LibBlockNames.INTERFACE);
|
||||
|
||||
registerBlocks();
|
||||
nameBlocks();
|
||||
@@ -73,6 +77,8 @@ public final class ModBlocks {
|
||||
GameRegistry.registerBlock(phantomStone, ItemPhantomStoneBlock.class, LibBlockNames.PHANTOM_STONE);
|
||||
GameRegistry.registerBlock(nitorGas, LibBlockNames.NITOR_GAS);
|
||||
GameRegistry.registerBlock(magnet, LibBlockNames.MAGNET);
|
||||
GameRegistry.registerBlock(mobMagnet, LibBlockNames.MOB_MAGNET);
|
||||
GameRegistry.registerBlock(interfase, LibBlockNames.INTERFACE);
|
||||
}
|
||||
|
||||
private static void nameBlocks() {
|
||||
@@ -82,6 +88,8 @@ public final class ModBlocks {
|
||||
LanguageRegistry.addName(animationTablet, LibBlockNames.ANIMATION_TABLET_D);
|
||||
LanguageRegistry.addName(phantomStone, LibBlockNames.PHANTOM_STONE_D);
|
||||
LanguageRegistry.addName(magnet, LibBlockNames.MAGNET_D);
|
||||
LanguageRegistry.addName(mobMagnet, LibBlockNames.MOB_MAGNET_D);
|
||||
LanguageRegistry.addName(interfase, LibBlockNames.INTERFACE_D);
|
||||
}
|
||||
|
||||
public static void applyObjectTags() {
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [6 Jul 2013, 15:16:08 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.tinkerer.client.gui.button.GuiButtonMM;
|
||||
import vazkii.tinkerer.client.gui.button.GuiButtonMMRadio;
|
||||
import vazkii.tinkerer.client.gui.button.IRadioButton;
|
||||
import vazkii.tinkerer.inventory.container.ContainerMobMagnet;
|
||||
import vazkii.tinkerer.lib.LibResources;
|
||||
import vazkii.tinkerer.network.PacketManager;
|
||||
import vazkii.tinkerer.network.packet.PacketMobMagnetButton;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
import vazkii.tinkerer.util.helper.ItemNBTHelper;
|
||||
|
||||
public class GuiMobMagnet extends GuiContainer {
|
||||
|
||||
int x, y;
|
||||
ItemStack stack = null;
|
||||
TileEntityMobMagnet mobMagnet;
|
||||
private static final String TAG_PATTERN = "pattern";
|
||||
private static final String NON_ASSIGNED = "Blank";
|
||||
private String filter = "All";
|
||||
|
||||
List<GuiButtonMM> buttonListMM = new ArrayList();
|
||||
List<IRadioButton> radioButtons = new ArrayList();
|
||||
|
||||
public GuiMobMagnet(TileEntityMobMagnet tile, InventoryPlayer playerInv) {
|
||||
super(new ContainerMobMagnet(tile, playerInv));
|
||||
mobMagnet = tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
x = (width - xSize) / 2;
|
||||
y = (height - ySize) / 2;
|
||||
buttonListMM.clear();
|
||||
addButton(new GuiButtonMMRadio(0, x + 100, y + 28, mobMagnet.adult, radioButtons));
|
||||
addButton(new GuiButtonMMRadio(1, x + 100, y + 48, !mobMagnet.adult, radioButtons));
|
||||
buttonList = buttonListMM;
|
||||
}
|
||||
|
||||
private void addButton(GuiButtonMM button) {
|
||||
buttonListMM.add(button);
|
||||
if(button instanceof IRadioButton)
|
||||
radioButtons.add((IRadioButton) button);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if(par1GuiButton instanceof IRadioButton)
|
||||
((IRadioButton) par1GuiButton).enableFromClick();
|
||||
else buttonListMM.get(0).enabled = !buttonListMM.get(0).enabled;
|
||||
|
||||
mobMagnet.adult = buttonListMM.get(0).enabled;
|
||||
|
||||
PacketManager.sendPacketToServer(new PacketMobMagnetButton(mobMagnet));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.renderEngine.bindTexture(LibResources.GUI_MOB_MAGNET);
|
||||
drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
|
||||
filter = "All";
|
||||
String adult = "Adult";
|
||||
String child = "Child";
|
||||
stack = mobMagnet.getStackInSlot(0);
|
||||
if(stack != null) {
|
||||
filter = ItemNBTHelper.getString(stack, TAG_PATTERN, NON_ASSIGNED);
|
||||
}
|
||||
fontRenderer.drawString(filter, x + xSize/2 - fontRenderer.getStringWidth(filter)/2-26, y + 16, 0x999999);
|
||||
fontRenderer.drawString(adult, x + 120, y + 30, 0x999999);
|
||||
fontRenderer.drawString(child, x + 120, y + 50, 0x999999);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Jul 2013, 22:12:30 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.client.gui.button;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import vazkii.tinkerer.lib.LibResources;
|
||||
|
||||
public class GuiButtonMM extends GuiButton {
|
||||
|
||||
public boolean enabled = false;;
|
||||
|
||||
public GuiButtonMM(int par1, int par2, int par3, boolean enabled) {
|
||||
super(par1, par2, par3, 13, 13, "");
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if(drawButton) {
|
||||
par1Minecraft.renderEngine.bindTexture(LibResources.GUI_MOB_MAGNET);
|
||||
int y = enabled ? 13 : 0;
|
||||
drawTexturedModalRect(xPosition, yPosition, 176, y, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Jul 2013, 22:12:43 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.client.gui.button;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GuiButtonMMRadio extends GuiButtonMM implements IRadioButton {
|
||||
|
||||
List<IRadioButton> linkedButtons;
|
||||
|
||||
public GuiButtonMMRadio(int par1, int par2, int par3, boolean enabled, List<IRadioButton> linkedButtons) {
|
||||
super(par1, par2, par3, enabled);
|
||||
this.linkedButtons = linkedButtons;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableFromClick() {
|
||||
setEnabled(true);
|
||||
for(IRadioButton button : linkedButtons)
|
||||
if(button != this)
|
||||
button.updateStatus(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(IRadioButton otherButton) {
|
||||
if(otherButton.isEnabled())
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It can be integrated in any of your
|
||||
* minecraft projects at will. If your mod is open source, this header must
|
||||
* be present.
|
||||
*
|
||||
* This class is licensed under a CC-BY 3.0 license.
|
||||
* http://creativecommons.org/licenses/by/3.0/
|
||||
*/
|
||||
package vazkii.tinkerer.client.model;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;
|
||||
import static org.lwjgl.opengl.GL11.glColor3ub;
|
||||
import static org.lwjgl.opengl.GL11.glDisable;
|
||||
import static org.lwjgl.opengl.GL11.glEnable;
|
||||
import static org.lwjgl.opengl.GL11.glPopMatrix;
|
||||
import static org.lwjgl.opengl.GL11.glPushMatrix;
|
||||
import static org.lwjgl.opengl.GL11.glRotatef;
|
||||
import static org.lwjgl.opengl.GL11.glScalef;
|
||||
import static org.lwjgl.opengl.GL11.glTranslatef;
|
||||
import static org.lwjgl.opengl.GL12.GL_RESCALE_NORMAL;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public class ModelCubeWorld extends ModelBase {
|
||||
|
||||
byte[][][][] modelData;
|
||||
int[] pointers;
|
||||
|
||||
final ModelRenderer cube;
|
||||
|
||||
/**
|
||||
* @param stream An InputStream where the model can be loaded from. You can get one using
|
||||
* {@link Class#getResourceAsStream(String)}, for loading resources in the mod's package.
|
||||
* Input streams are diverse, so this constructor can be called from a URL connection, a file
|
||||
* in the local file system, or even an incoming packet.
|
||||
*/
|
||||
public ModelCubeWorld(InputStream stream) {
|
||||
cube = new ModelRenderer(this, 0, 0).addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
|
||||
int i;
|
||||
int it = 0;
|
||||
int area = 0;
|
||||
|
||||
byte[] sizesBuffer = new byte[12];
|
||||
|
||||
try {
|
||||
while ((i = stream.read()) != -1) {
|
||||
final byte val = (byte) (i & 0xFF);
|
||||
if (it < 12)
|
||||
sizesBuffer[it] = val;
|
||||
else {
|
||||
if (it == 12) {
|
||||
final int x = sizesBuffer[0] | sizesBuffer[1] << 8 | sizesBuffer[2] << 16 | sizesBuffer[3] << 24;
|
||||
final int y = sizesBuffer[4] | sizesBuffer[5] << 8 | sizesBuffer[6] << 16 | sizesBuffer[7] << 24;
|
||||
final int z = sizesBuffer[8] | sizesBuffer[9] << 8 | sizesBuffer[10] << 16 | sizesBuffer[11] << 24;
|
||||
|
||||
modelData = new byte[x][y][z][3];
|
||||
area = x * y;
|
||||
|
||||
sizesBuffer = null;
|
||||
}
|
||||
|
||||
final int it1 = it - 12;
|
||||
final int it1d = it1 / 3;
|
||||
|
||||
final int z = it1d / area;
|
||||
|
||||
final int it2d = it1d - area * z; // Exploiting the lack of rounding in integer values
|
||||
final int x = it2d % modelData.length;
|
||||
final int y = it2d / modelData.length;
|
||||
|
||||
if (x >= modelData.length || y >= modelData[0].length || z >= modelData[0][0].length) {
|
||||
it++;
|
||||
continue;
|
||||
}
|
||||
|
||||
modelData[x][y][z][it1 % 3] = val;
|
||||
}
|
||||
|
||||
it++;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
calculatePointers(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data of the model, in a four dimensional byte array.<br><br>
|
||||
* Dimension 0 - The X coordinates<br>
|
||||
* Dimension 1 - The Y coordinates<br>
|
||||
* Dimension 2 - The Z coordinates<br>
|
||||
* Dimension 3 - Always of length 3, contains, respectively, red, green and blue values.
|
||||
*
|
||||
*/
|
||||
public byte[][][][] getModelData() {
|
||||
return modelData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recalculates the pointers for the rendering. Must be done if you change the model data, otherwise it
|
||||
* won't make use of the new data.
|
||||
* @param renderHidden If true, the renderer will draw every single cube, even cubes that are obstructed
|
||||
* on all 6 sides. Not recommended!
|
||||
*/
|
||||
public void calculatePointers(final boolean renderHidden) {
|
||||
List<Integer> newPointers = new ArrayList();
|
||||
|
||||
for (int x = 0; x < modelData.length; x++)
|
||||
for (int y = 0; y < modelData[0].length; y++)
|
||||
for (int z = 0; z < modelData[0][0].length; z++) {
|
||||
if (cubeExists(x, y, z)) {
|
||||
if (!renderHidden) {
|
||||
int hiddenSides = 0;
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
if (cubeExists(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))
|
||||
++hiddenSides;
|
||||
|
||||
if (hiddenSides == 6)
|
||||
continue;
|
||||
}
|
||||
|
||||
newPointers.add(x & 1023 | (y & 1023) << 10 | (z & 1023) << 20);
|
||||
}
|
||||
}
|
||||
|
||||
pointers = new int[newPointers.size()];
|
||||
int it = 0;
|
||||
for (int i : newPointers) {
|
||||
pointers[it] = i;
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if a cube exists at the coordinates passed in.
|
||||
*/
|
||||
public boolean cubeExists(final int x, final int y, final int z) {
|
||||
final int xs = modelData.length;
|
||||
final int ys = modelData[0].length;
|
||||
final int zs = modelData[0][0].length;
|
||||
|
||||
if (x >= xs || x < 0 || y >= ys || y < 0 || z >= zs || z < 0)
|
||||
return false;
|
||||
|
||||
final byte[] values = modelData[x][y][z];
|
||||
return values[0] != 0 || values[1] != 0 || values[2] != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the model, requires previous translation. The model is rendered in a scale of
|
||||
* 0.0625F, or 1/16, the side of each voxel is one 16th of the side of a regular minecraft block.
|
||||
*/
|
||||
public void render() {
|
||||
glPushMatrix();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
|
||||
final float scale = 0.0625F;
|
||||
glScalef(scale, scale, scale);
|
||||
glRotatef(-90F, 1F, 0F, 0F);
|
||||
|
||||
for (int i : pointers) {
|
||||
final int x = i & 1023;
|
||||
final int y = i >> 10 & 1023;
|
||||
final int z = i >> 20 & 1023;
|
||||
|
||||
glTranslatef(x, y, z);
|
||||
|
||||
final byte[] color = modelData[x][y][z];
|
||||
glColor3ub(color[0], color[1], color[2]);
|
||||
|
||||
cube.render(1F);
|
||||
|
||||
glTranslatef(-x, -y, -z);
|
||||
}
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_RESCALE_NORMAL);
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [6 Jul 2013, 17:49:35 (GMT)]
|
||||
*/
|
||||
|
||||
package vazkii.tinkerer.client.render.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.tinkerer.lib.LibRenderIDs;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderMobMagnet implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
TileEntityRenderer.instance.renderTileEntityAt(new TileEntityMobMagnet(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idMobMagnet;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [26 Jul 2013, 02:27:58 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.client.render.item;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.tinkerer.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.client.model.ModelCubeWorld;
|
||||
import vazkii.tinkerer.lib.LibResources;
|
||||
|
||||
public class RenderItemConnector implements IItemRenderer {
|
||||
|
||||
ModelCubeWorld model;
|
||||
|
||||
public RenderItemConnector() {
|
||||
model = new ModelCubeWorld(ThaumicTinkerer.class.getResourceAsStream(LibResources.MODEL_CONNECTOR));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(90F, 0F, 0F, 1F);
|
||||
GL11.glRotatef(90F, 0F, 1F, 0F);
|
||||
GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||
GL11.glTranslatef(-0.45F, -1.5F, 0.4F);
|
||||
GL11.glRotatef(25F, 1F, 0F, 0F);
|
||||
|
||||
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
|
||||
GL11.glTranslatef(0F, 0F, -0.3F);
|
||||
GL11.glRotatef(25F, 1F, 0F, 0F);
|
||||
GL11.glRotatef(-15F, 0F, 1F, 0F);
|
||||
}
|
||||
|
||||
model.render();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [6 Jul 2013, 17:49:49 (GMT)]
|
||||
*/
|
||||
|
||||
package vazkii.tinkerer.client.render.tile;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
import thaumcraft.common.Config;
|
||||
import thaumcraft.common.items.armor.ItemHoverHarness;
|
||||
import vazkii.tinkerer.client.model.ModelMagnet;
|
||||
import vazkii.tinkerer.client.util.handler.ClientTickHandler;
|
||||
import vazkii.tinkerer.lib.LibResources;
|
||||
|
||||
public class RenderTileMobMagnet extends TileEntitySpecialRenderer {
|
||||
|
||||
ModelMagnet model = new ModelMagnet();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GL11.glTranslatef((float)x, (float)y , (float)z);
|
||||
boolean blue = tileentity.worldObj == null || tileentity.getBlockMetadata() == 0;
|
||||
bindTextureByName(blue ? LibResources.MODEL_MOB_MAGNET_S : LibResources.MODEL_MOB_MAGNET_N);
|
||||
|
||||
int redstone = 0;
|
||||
if(tileentity.worldObj != null) {
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
redstone = Math.max(redstone, tileentity.worldObj.getIndirectPowerLevelTo(tileentity.xCoord + dir.offsetX, tileentity.yCoord + dir.offsetY, tileentity.zCoord + dir.offsetZ, dir.ordinal()));
|
||||
} else redstone = 15;
|
||||
|
||||
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
model.render();
|
||||
|
||||
GL11.glRotatef(90F, 1F, 0F, 0F);
|
||||
GL11.glTranslatef(0F, 0F, -0.6F);
|
||||
Icon icon = ((ItemHoverHarness) Config.itemHoverHarness).iconLightningRing;
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 2; j++) {
|
||||
GL11.glScalef(1F, -1F, 1F);
|
||||
UtilsFX.renderQuadCenteredFromIcon(false, icon, redstone / 15F * 0.7F + (redstone == 0 ? 0 : 0.4F), blue ? 0F : 1F, 0F, blue ? 1F : 0F, 225, GL11.GL_ONE_MINUS_SRC_ALPHA, 0.9F);
|
||||
}
|
||||
|
||||
GL11.glTranslated(0, 0, -(Math.cos(ClientTickHandler.clientTicksElapsed / 10F) + 1) * 0.09 - 0.1);
|
||||
}
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -24,11 +24,14 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import thaumcraft.client.fx.FXLightningBolt;
|
||||
import vazkii.tinkerer.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.client.render.block.RenderMagnet;
|
||||
import vazkii.tinkerer.client.render.block.RenderMobMagnet;
|
||||
import vazkii.tinkerer.client.render.block.RenderWardChest;
|
||||
import vazkii.tinkerer.client.render.entity.RenderDeathRune;
|
||||
import vazkii.tinkerer.client.render.item.RenderItemConnector;
|
||||
import vazkii.tinkerer.client.render.item.RenderItemFluxDetector;
|
||||
import vazkii.tinkerer.client.render.tile.RenderTileAnimationTablet;
|
||||
import vazkii.tinkerer.client.render.tile.RenderTileMagnet;
|
||||
import vazkii.tinkerer.client.render.tile.RenderTileMobMagnet;
|
||||
import vazkii.tinkerer.client.render.tile.RenderTileTransmutator;
|
||||
import vazkii.tinkerer.client.render.tile.RenderTileWardChest;
|
||||
import vazkii.tinkerer.client.util.handler.ClientTickHandler;
|
||||
@@ -39,11 +42,13 @@ import vazkii.tinkerer.item.ModItems;
|
||||
import vazkii.tinkerer.lib.LibRenderIDs;
|
||||
import vazkii.tinkerer.network.PacketManager;
|
||||
import vazkii.tinkerer.network.packet.PacketAnimationTabletSync;
|
||||
import vazkii.tinkerer.network.packet.PacketMobMagnetSync;
|
||||
import vazkii.tinkerer.network.packet.PacketSoulHeartSync;
|
||||
import vazkii.tinkerer.network.packet.PacketTransmutatorSync;
|
||||
import vazkii.tinkerer.network.packet.PacketVerification;
|
||||
import vazkii.tinkerer.tile.TileEntityAnimationTablet;
|
||||
import vazkii.tinkerer.tile.TileEntityMagnet;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
import vazkii.tinkerer.tile.TileEntityTransmutator;
|
||||
import vazkii.tinkerer.tile.TileEntityWardChest;
|
||||
import vazkii.tinkerer.util.helper.MiscHelper;
|
||||
@@ -71,6 +76,7 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWardChest.class, new RenderTileWardChest());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAnimationTablet.class, new RenderTileAnimationTablet());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMagnet.class, new RenderTileMagnet());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMobMagnet.class, new RenderTileMobMagnet());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,17 +95,21 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
PacketManager.packetHandlers.add(new PacketTransmutatorSync());
|
||||
PacketManager.packetHandlers.add(new PacketAnimationTabletSync());
|
||||
PacketManager.packetHandlers.add(new PacketSoulHeartSync());
|
||||
PacketManager.packetHandlers.add(new PacketMobMagnetSync());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initRenders() {
|
||||
LibRenderIDs.idWardChest = RenderingRegistry.getNextAvailableRenderId();
|
||||
LibRenderIDs.idMagnet = RenderingRegistry.getNextAvailableRenderId();
|
||||
LibRenderIDs.idMobMagnet = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderWardChest());
|
||||
RenderingRegistry.registerBlockHandler(new RenderMagnet());
|
||||
RenderingRegistry.registerBlockHandler(new RenderMobMagnet());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.fluxDetector.itemID, new RenderItemFluxDetector());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.connector.itemID, new RenderItemConnector());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,8 +26,11 @@ import vazkii.tinkerer.lib.LibItemNames;
|
||||
import vazkii.tinkerer.lib.LibMisc;
|
||||
import vazkii.tinkerer.network.PacketManager;
|
||||
import vazkii.tinkerer.network.packet.PacketAnimationTabletButton;
|
||||
import vazkii.tinkerer.network.packet.PacketMobMagnetButton;
|
||||
import vazkii.tinkerer.tile.TileEntityAnimationTablet;
|
||||
import vazkii.tinkerer.tile.TileEntityInterface;
|
||||
import vazkii.tinkerer.tile.TileEntityMagnet;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
import vazkii.tinkerer.tile.TileEntityTransmutator;
|
||||
import vazkii.tinkerer.tile.TileEntityWardChest;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
@@ -42,6 +45,8 @@ public class TTCommonProxy {
|
||||
GameRegistry.registerTileEntity(TileEntityWardChest.class, tileName(LibBlockNames.WARD_CHEST));
|
||||
GameRegistry.registerTileEntity(TileEntityAnimationTablet.class, tileName(LibBlockNames.ANIMATION_TABLET));
|
||||
GameRegistry.registerTileEntity(TileEntityMagnet.class, tileName(LibBlockNames.MAGNET));
|
||||
GameRegistry.registerTileEntity(TileEntityMobMagnet.class, tileName(LibBlockNames.MOB_MAGNET));
|
||||
GameRegistry.registerTileEntity(TileEntityInterface.class, tileName(LibBlockNames.INTERFACE));
|
||||
}
|
||||
|
||||
public void initRenders() { }
|
||||
@@ -54,6 +59,7 @@ public class TTCommonProxy {
|
||||
|
||||
public void initPackets() {
|
||||
PacketManager.packetHandlers.add(new PacketAnimationTabletButton());
|
||||
PacketManager.packetHandlers.add(new PacketMobMagnetButton());
|
||||
}
|
||||
|
||||
private static String tileName(String name) {
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [6 Jul 2013, 15:13:39 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.inventory.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.tinkerer.inventory.slot.SlotMobMagnet;
|
||||
import vazkii.tinkerer.item.ItemSoulMould;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
|
||||
public class ContainerMobMagnet extends ContainerPlayerInv {
|
||||
|
||||
public TileEntityMobMagnet mobMagnet;
|
||||
|
||||
public ContainerMobMagnet(TileEntityMobMagnet mobMagnet, InventoryPlayer playerInv) {
|
||||
super(playerInv);
|
||||
|
||||
this.mobMagnet = mobMagnet;
|
||||
|
||||
addSlotToContainer(new SlotMobMagnet(mobMagnet, 0, 53, 37));
|
||||
|
||||
initPlayerInv();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return mobMagnet.isUseableByPlayer(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot)inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
|
||||
if(var5.getItem() instanceof ItemSoulMould) {
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 < 1) {
|
||||
if(!mergeItemStack(var5, 1, 37, false))
|
||||
return null;
|
||||
} else if(!mergeItemStack(var5, 0, 1, false))
|
||||
return null;
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
var4.putStack((ItemStack)null);
|
||||
else
|
||||
var4.onSlotChanged();
|
||||
|
||||
if (var5.stackSize == var3.stackSize)
|
||||
return null;
|
||||
|
||||
var4.onPickupFromSlot(par1EntityPlayer, var5);
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Jul 2013, 21:37:48 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.inventory.slot;
|
||||
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.tinkerer.item.ItemSoulMould;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
|
||||
public class SlotMobMagnet extends Slot {
|
||||
|
||||
public SlotMobMagnet(TileEntityMobMagnet mobMagnet, int par2, int par3, int par4) {
|
||||
super(mobMagnet, par2, par3, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
if(par1ItemStack.getItem() instanceof ItemSoulMould) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class ItemBrightNitor extends ItemMod {
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
int x = (int) par3Entity.posX;
|
||||
int y = (int) par3Entity.posY;
|
||||
int y = (int) par3Entity.posY + 1;
|
||||
int z = (int) par3Entity.posZ;
|
||||
|
||||
if((par2World.getBlockId(x, y, z) == 0 || par2World.getBlockId(x, y, z) == ModBlocks.nitorGas.blockID) && !par2World.isRemote)
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [26 Jul 2013, 02:22:00 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.lib.LibBlockNames;
|
||||
import vazkii.tinkerer.tile.TileEntityInterface;
|
||||
import vazkii.tinkerer.util.helper.ItemNBTHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemConnector extends ItemMod {
|
||||
|
||||
public ItemConnector(int par1) {
|
||||
super(par1);
|
||||
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
if (par3World.isRemote)
|
||||
return false;
|
||||
|
||||
TileEntity tile = par3World.getBlockTileEntity(par4, par5, par6);
|
||||
|
||||
if (getY(par1ItemStack) == -1) {
|
||||
if (tile != null && tile instanceof TileEntityInterface) {
|
||||
setX(par1ItemStack, par4);
|
||||
setY(par1ItemStack, par5);
|
||||
setZ(par1ItemStack, par6);
|
||||
|
||||
if(par3World.isRemote)
|
||||
par2EntityPlayer.swingItem();
|
||||
|
||||
playSound(par3World, par4, par5, par6);
|
||||
par2EntityPlayer.addChatMessage("Location Bound!");
|
||||
} else
|
||||
par2EntityPlayer.addChatMessage("Not a " + LibBlockNames.INTERFACE_D + ".");
|
||||
} else {
|
||||
if (tile != null && tile instanceof TileEntityInterface) {
|
||||
par2EntityPlayer.addChatMessage("Can't bind an Interface to another.");
|
||||
return true;
|
||||
}
|
||||
|
||||
int x = getX(par1ItemStack);
|
||||
int y = getY(par1ItemStack);
|
||||
int z = getZ(par1ItemStack);
|
||||
|
||||
TileEntity tile1 = par3World.getBlockTileEntity(x, y, z);
|
||||
if (tile1 == null || !(tile1 instanceof TileEntityInterface)) {
|
||||
setY(par1ItemStack, -1);
|
||||
|
||||
par2EntityPlayer.addChatMessage(LibBlockNames.INTERFACE_D + " isn't present.");
|
||||
} else {
|
||||
TileEntityInterface interf = (TileEntityInterface) tile1;
|
||||
|
||||
if(Math.abs(x - par4) > 3 || Math.abs(y - par5) > 3 || Math.abs(z - par6) > 3) {
|
||||
par2EntityPlayer.addChatMessage("The Interface is too far away.");
|
||||
return true;
|
||||
}
|
||||
|
||||
interf.x = par4;
|
||||
interf.y = par5;
|
||||
interf.z = par6;
|
||||
|
||||
setY(par1ItemStack, -1);
|
||||
|
||||
if(par3World.isRemote)
|
||||
par2EntityPlayer.swingItem();
|
||||
|
||||
playSound(par3World, par4, par5, par6);
|
||||
par2EntityPlayer.addChatMessage("Locations bound!");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void playSound(World world, int x, int y, int z) {
|
||||
if(!world.isRemote)
|
||||
world.playSoundEffect(x, y, z, "random.orb", 0.8F, 1F);
|
||||
}
|
||||
|
||||
public static void setX(ItemStack stack, int x) {
|
||||
ItemNBTHelper.setInt(stack, "posx", x);
|
||||
}
|
||||
|
||||
public static void setY(ItemStack stack, int y) {
|
||||
ItemNBTHelper.setInt(stack, "posy", y);
|
||||
}
|
||||
|
||||
public static void setZ(ItemStack stack, int z) {
|
||||
ItemNBTHelper.setInt(stack, "posz", z);
|
||||
}
|
||||
|
||||
public static int getX(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, "posx", 0);
|
||||
}
|
||||
|
||||
public static int getY(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, "posy", -1);
|
||||
}
|
||||
|
||||
public static int getZ(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, "posz", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [26 Jul 2013, 15:27:45 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.item;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class ItemIceGlobe extends ItemMod {
|
||||
|
||||
public ItemIceGlobe(int par1) {
|
||||
super(par1);
|
||||
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||
if(!(entity instanceof EntityLiving))
|
||||
return false;
|
||||
|
||||
EntityLiving living = (EntityLiving) entity;
|
||||
|
||||
if(!living.func_104002_bU()) { // Check if presistanceRequired
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
ReflectionHelper.setPrivateValue(EntityLiving.class, living, true, 72); // Set presistanceRequired to true
|
||||
if(!player.worldObj.isRemote)
|
||||
player.worldObj.playSoundAtEntity(entity, "mob.zombie.remedy", 1F, 1F);
|
||||
} else {
|
||||
if(player.worldObj.isRemote)
|
||||
player.addChatMessage("This entity is already preserved.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [7 Jul 2013, 13:58:53 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.util.handler.EntityInteractionHandler;
|
||||
import vazkii.tinkerer.util.helper.ItemNBTHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
public class ItemSoulMould extends ItemMod {
|
||||
|
||||
private static final String TAG_PATTERN = "pattern";
|
||||
private static final String NON_ASSIGNED = "Blank";
|
||||
public ItemSoulMould(int par1) {
|
||||
super(par1);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving) {
|
||||
EntityPlayer player = EntityInteractionHandler.getLastInteractingPlayer();
|
||||
if(player != null) {
|
||||
setPattern(player.getCurrentEquippedItem(), par2EntityLiving);
|
||||
}
|
||||
else {
|
||||
setPattern(par1ItemStack, par2EntityLiving);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
if(par3EntityPlayer.isSneaking()) {
|
||||
clearPattern(par1ItemStack);
|
||||
}
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
String name = getPatternName(par1ItemStack);
|
||||
par3List.add(EnumChatFormatting.GOLD + "Current Pattern: " + name);
|
||||
}
|
||||
|
||||
private void setPattern(ItemStack par1ItemStack, EntityLiving par2EntityLiving) {
|
||||
ItemNBTHelper.setString(par1ItemStack, TAG_PATTERN, par2EntityLiving.getEntityName());
|
||||
}
|
||||
|
||||
public String getPatternName(ItemStack par1ItemStack) {
|
||||
return ItemNBTHelper.getString(par1ItemStack, TAG_PATTERN, NON_ASSIGNED);
|
||||
}
|
||||
|
||||
private void clearPattern(ItemStack par1ItemStack) {
|
||||
ItemNBTHelper.getNBT(par1ItemStack).removeTag(TAG_PATTERN);
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,8 @@ public class ItemWeatherCrystal extends ItemMod {
|
||||
|
||||
public ItemWeatherCrystal(int par1) {
|
||||
super(par1);
|
||||
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,6 +56,9 @@ public final class ModItems {
|
||||
public static Item rainwaterBottle;
|
||||
public static Item weatherCrystal;
|
||||
public static Item lovePotion;
|
||||
public static Item soulMould;
|
||||
public static Item connector;
|
||||
public static Item iceGlobe;
|
||||
|
||||
public static void initItems() {
|
||||
wandTinkerer = new ItemWandTinkerer(LibItemIDs.idWandTinkerer).setUnlocalizedName(LibItemNames.WAND_TINKERER);
|
||||
@@ -87,6 +90,9 @@ public final class ModItems {
|
||||
rainwaterBottle = new ItemRainwaterBottle(LibItemIDs.idRainwaterBottle).setUnlocalizedName(LibItemNames.RAINWATER_BOTTLE);
|
||||
weatherCrystal = new ItemWeatherCrystal(LibItemIDs.idWeatherCrystal).setUnlocalizedName(LibItemNames.WEATHER_CRYSTAL);
|
||||
lovePotion = new ItemLovePotion(LibItemIDs.idLovePotion).setUnlocalizedName(LibItemNames.LOVE_POTION);
|
||||
soulMould = new ItemSoulMould(LibItemIDs.idSoulMould).setUnlocalizedName(LibItemNames.SOUL_MOULD);
|
||||
connector = new ItemConnector(LibItemIDs.idConnector).setUnlocalizedName(LibItemNames.CONNECTOR);
|
||||
iceGlobe = new ItemIceGlobe(LibItemIDs.idIceGlobe).setUnlocalizedName(LibItemNames.ICE_GLOBE);
|
||||
|
||||
nameItems();
|
||||
}
|
||||
@@ -118,6 +124,9 @@ public final class ModItems {
|
||||
LanguageRegistry.addName(scythe, LibItemNames.SCYTHE_D);
|
||||
LanguageRegistry.addName(rainwaterBottle, LibItemNames.RAINWATER_BOTTLE_D);
|
||||
LanguageRegistry.addName(lovePotion, LibItemNames.LOVE_POTION_D);
|
||||
LanguageRegistry.addName(soulMould, LibItemNames.SOUL_MOULD_D);
|
||||
LanguageRegistry.addName(connector, LibItemNames.CONNECTOR_D);
|
||||
LanguageRegistry.addName(iceGlobe, LibItemNames.ICE_GLOBE_D);
|
||||
}
|
||||
|
||||
public static void applyObjectTags() {
|
||||
@@ -167,5 +176,8 @@ public final class ModItems {
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.WEATHER, 2).add(EnumTag.WATER, 1).add(EnumTag.CRYSTAL, 1);
|
||||
ThaumcraftApi.registerObjectTag(rainwaterBottle.itemID, LibMisc.TAG_META_WILDCARD, tags);
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.LIFE, 4).add(EnumTag.KNOWLEDGE, 6).add(EnumTag.CRYSTAL, 2).add(EnumTag.SPIRIT, 4);
|
||||
ThaumcraftApi.registerObjectTag(soulMould.itemID, LibMisc.TAG_META_WILDCARD, tags);
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,8 @@ public final class LibBlockIDs {
|
||||
public static final int DEFAULT_PHANTOM_STONE = 2159;
|
||||
public static final int DEFAULT_NITOR_GAS = 2160;
|
||||
public static final int DEFAULT_MAGNET = 2161;
|
||||
public static final int DEFAULT_MOB_MAGNET = 2162;
|
||||
public static final int DEFAULT_INTERFACE = 2163;
|
||||
|
||||
public static int idGlowstoneGas;
|
||||
public static int idTransmutator;
|
||||
@@ -41,4 +43,6 @@ public final class LibBlockIDs {
|
||||
public static int idPhantomStone;
|
||||
public static int idNitorGas;
|
||||
public static int idMagnet;
|
||||
public static int idMobMagnet;
|
||||
public static int idInterface;
|
||||
}
|
||||
@@ -60,6 +60,14 @@ public final class LibBlockNames {
|
||||
public static final String MAGNET_R = "MAGNET";
|
||||
public static final String MAGNET_D = "Thaumostatic Magnetizer";
|
||||
|
||||
public static final String MOB_MAGNET = "mobMagnet";
|
||||
public static final String MOB_MAGNET_R = "MOB_MAGNET";
|
||||
public static final String MOB_MAGNET_D = "Advanced Thaumostatic Magnetizer";
|
||||
|
||||
public static final String INTERFACE = "interface";
|
||||
public static final String INTERFACE_R = "INTERFACE";
|
||||
public static final String INTERFACE_D = "Transvector Interface";
|
||||
|
||||
public static final String[] DARK_QUARTZ_BLOCK_NAMES = {
|
||||
"Block of Smokey Quartz",
|
||||
"Chiseled Smokey Quartz Block",
|
||||
|
||||
@@ -18,5 +18,5 @@ public final class LibGuiIDs {
|
||||
|
||||
public static final int ID_TRANSMUTATOR = 0;
|
||||
public static final int ID_ANIMATION_TABLET = 1;
|
||||
|
||||
public static final int ID_MOB_MAGNET = 2;
|
||||
}
|
||||
@@ -31,6 +31,9 @@ public final class LibItemIDs {
|
||||
public static final int DEFAULT_RAINWATER_BOTTLE = 21176;
|
||||
public static final int DEFAULT_WEATHER_CRYSTAL = 21177;
|
||||
public static final int DEFAULT_LOVE_POTION = 21178;
|
||||
public static final int DEFAULT_SOUL_MOULD = 21179;
|
||||
public static final int DEFAULT_CONNECTOR = 21180;
|
||||
public static final int DEFAULT_ICE_GLOBE = 21181;
|
||||
|
||||
public static int idWandTinkerer;
|
||||
public static int idGlowstoneGas;
|
||||
@@ -61,5 +64,8 @@ public final class LibItemIDs {
|
||||
public static int idRainwaterBottle;
|
||||
public static int idWeatherCrystal;
|
||||
public static int idLovePotion;
|
||||
public static int idSoulMould;
|
||||
public static int idConnector;
|
||||
public static int idIceGlobe;
|
||||
|
||||
}
|
||||
@@ -125,4 +125,15 @@ public final class LibItemNames {
|
||||
public static final String LOVE_POTION_R = "LOVE_POTION";
|
||||
public static final String LOVE_POTION_D = "Aphrodisiac Concoction";
|
||||
|
||||
public static final String SOUL_MOULD = "soulMould";
|
||||
public static final String SOUL_MOULD_R = "SOUL_MOULD";
|
||||
public static final String SOUL_MOULD_D = "Soul Mould";
|
||||
|
||||
public static final String CONNECTOR = "connector";
|
||||
public static final String CONNECTOR_R = "CONNECTOR";
|
||||
public static final String CONNECTOR_D = "Interface Binder";
|
||||
|
||||
public static final String ICE_GLOBE = "iceGlobe";
|
||||
public static final String ICE_GLOBE_R = "ICE_GLOBE";
|
||||
public static final String ICE_GLOBE_D = "Cryogenic Globe";
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public final class LibMisc {
|
||||
|
||||
public static final String MOD_ID = "ThaumicTinkerer";
|
||||
public static final String MOD_NAME = "Thaumic Tinkerer";
|
||||
public static final String MOD_VERSION = "1.0.7";
|
||||
public static final String MOD_VERSION = "1.0.8";
|
||||
|
||||
public static final String DEPENDENCIES = "required-after:Thaumcraft";
|
||||
|
||||
@@ -29,6 +29,4 @@ public final class LibMisc {
|
||||
public static final short TAG_META_WILDCARD = -1;
|
||||
|
||||
public static final float MODEL_DEFAULT_RENDER_SCALE = 0.0625F;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -23,4 +23,6 @@ public final class LibNetwork {
|
||||
public static final String SUBCHANNEL_ANIMATION_TABLET_SYNC = "tabletSync";
|
||||
public static final String SUBCHANNEL_ANIMATION_TABLET_BUTTON = "tabletButton";
|
||||
public static final String SUBCHANNEL_SOUL_HEART_SYNC = "soulHearts";
|
||||
public static final String SUBCHANNEL_MOB_MAGNET_SYNC = "mobMagnetSync";
|
||||
public static final String SUBCHANNEL_MOB_MAGNET_BUTTON = "mobMagnetButton";
|
||||
}
|
||||
@@ -18,5 +18,5 @@ public final class LibRenderIDs {
|
||||
|
||||
public static int idWardChest;
|
||||
public static int idMagnet;
|
||||
|
||||
public static int idMobMagnet;
|
||||
}
|
||||
@@ -31,12 +31,16 @@ public final class LibResources {
|
||||
|
||||
public static final String GUI_TRANSMUTATOR = ROOT_GUI + "guiTransmutator.png";
|
||||
public static final String GUI_ANIMATION_TABLET = ROOT_GUI + "guiAnimationTablet.png";
|
||||
public static final String GUI_MOB_MAGNET = ROOT_GUI + "guiMobMagnet.png";
|
||||
public static final String GUI_SOUL_HEARTS = ROOT_GUI + "soulHearts.png";
|
||||
|
||||
public static final String MODEL_WARD_CHEST = ROOT_MODEL + "chestWard.png";
|
||||
public static final String MODEL_LEGS_GOLIATH = ROOT_MODEL + "armorGoliath.png";
|
||||
public static final String MODEL_MAGNET_N = ROOT_MODEL + "magnetN.png";
|
||||
public static final String MODEL_MAGNET_S = ROOT_MODEL + "magnetS.png";
|
||||
public static final String MODEL_MOB_MAGNET_N = ROOT_MODEL + "mobMagnetN.png";
|
||||
public static final String MODEL_MOB_MAGNET_S = ROOT_MODEL + "mobMagnetS.png";
|
||||
public static final String MODEL_CONNECTOR = ROOT_MODEL + "connector.cub";
|
||||
|
||||
public static final String MISC_GLYPHS = BLUR + ROOT_MISC + "transmutatorGlyphs.png";
|
||||
public static final String MISC_WARD_CHEST_OVERLAY = ROOT_MISC + "wardChestOverlay.png";
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [12 Jul 2013, 22:24:12 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.network.packet;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import vazkii.tinkerer.inventory.container.ContainerMobMagnet;
|
||||
import vazkii.tinkerer.lib.LibNetwork;
|
||||
import vazkii.tinkerer.network.ModPacket;
|
||||
import vazkii.tinkerer.network.PacketManager;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
public class PacketMobMagnetButton extends ModPacket {
|
||||
|
||||
TileEntityMobMagnet mobMagnet;
|
||||
|
||||
public PacketMobMagnetButton() { }
|
||||
|
||||
public PacketMobMagnetButton(TileEntityMobMagnet mobMagnet) {
|
||||
this.mobMagnet = mobMagnet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteArrayOutputStream asOutputStream() throws IOException {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
DataOutputStream data = new DataOutputStream(stream);
|
||||
writeSubchannel(data);
|
||||
data.writeInt(mobMagnet.xCoord);
|
||||
data.writeInt(mobMagnet.yCoord);
|
||||
data.writeInt(mobMagnet.zCoord);
|
||||
data.writeBoolean(mobMagnet.adult);
|
||||
return stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readPayload(Packet250CustomPayload packet, INetworkManager manager, Player player, String subchannel) throws IOException {
|
||||
if(subchannel.equals(getSubchannel()) && player != null && player instanceof EntityPlayer) {
|
||||
EntityPlayer entityPlayer = (EntityPlayer)player;
|
||||
if(entityPlayer.openContainer != null && entityPlayer.openContainer instanceof ContainerMobMagnet) {
|
||||
ByteArrayInputStream stream = new ByteArrayInputStream(packet.data);
|
||||
DataInputStream inputStream = new DataInputStream(stream);
|
||||
skipSubchannel(inputStream);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
ContainerMobMagnet container = (ContainerMobMagnet)entityPlayer.openContainer;
|
||||
if(container.mobMagnet.xCoord == x && container.mobMagnet.yCoord == y && container.mobMagnet.zCoord == z) {
|
||||
TileEntityMobMagnet mobMagnet = (TileEntityMobMagnet) container.mobMagnet.worldObj.getBlockTileEntity(x, y, z);
|
||||
boolean adult = inputStream.readBoolean();
|
||||
mobMagnet.adult = adult;
|
||||
PacketMobMagnetSync packet1 = new PacketMobMagnetSync(mobMagnet);
|
||||
PacketManager.sendPacketToClient(player, packet1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSubchannel() {
|
||||
return LibNetwork.SUBCHANNEL_MOB_MAGNET_BUTTON;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [6 Jul 2013, 22:02:57 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.network.packet;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import vazkii.tinkerer.lib.LibNetwork;
|
||||
import vazkii.tinkerer.network.ModPacket;
|
||||
import vazkii.tinkerer.network.PacketManager;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
public class PacketMobMagnetSync extends ModPacket {
|
||||
|
||||
TileEntityMobMagnet mobMagnet;
|
||||
|
||||
public PacketMobMagnetSync() { }
|
||||
|
||||
public PacketMobMagnetSync(TileEntityMobMagnet mobMagnet) {
|
||||
this.mobMagnet = mobMagnet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteArrayOutputStream asOutputStream() throws IOException {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
DataOutputStream data = new DataOutputStream(stream);
|
||||
writeSubchannel(data);
|
||||
data.writeInt(mobMagnet.xCoord);
|
||||
data.writeInt(mobMagnet.yCoord);
|
||||
data.writeInt(mobMagnet.zCoord);
|
||||
PacketManager.writeItemStackIntoStream(mobMagnet.getStackInSlot(0), data);
|
||||
data.writeBoolean(mobMagnet.adult);
|
||||
return stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean readPayload(Packet250CustomPayload packet, INetworkManager manager, Player player, String subchannel) throws IOException {
|
||||
if(subchannel.equals(getSubchannel()) && player != null && player instanceof EntityPlayer) {
|
||||
ByteArrayInputStream stream = new ByteArrayInputStream(packet.data);
|
||||
DataInputStream inputStream = new DataInputStream(stream);
|
||||
skipSubchannel(inputStream);
|
||||
int x = inputStream.readInt();
|
||||
int y = inputStream.readInt();
|
||||
int z = inputStream.readInt();
|
||||
TileEntityMobMagnet mobMagnet = (TileEntityMobMagnet) ((EntityPlayer)player).worldObj.getBlockTileEntity(x, y, z);
|
||||
ItemStack stack = PacketManager.getItemStackFromStream(inputStream);
|
||||
if(mobMagnet != null) {
|
||||
mobMagnet.setInventorySlotContents(0, stack);
|
||||
boolean adult = inputStream.readBoolean();
|
||||
mobMagnet.adult = adult;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSubchannel() {
|
||||
return LibNetwork.SUBCHANNEL_MOB_MAGNET_SYNC;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,6 +66,12 @@ public final class ModArcaneRecipes {
|
||||
'T', new ItemStack(Config.blockInfusionWorkbench, 1, 0),
|
||||
'B', new ItemStack(Config.itemResource, 1, 5),
|
||||
'D', new ItemStack(Item.dyePowder, 1, LibMisc.CRAFTING_META_WILDCARD)) }));
|
||||
|
||||
ThaumcraftApi.addArcaneCraftingRecipe(LibItemNames.SOUL_MOULD_R, LibItemNames.SOUL_MOULD_R, 50, new ItemStack(ModItems.soulMould),
|
||||
" G ", "TET", " G ",
|
||||
'G', new ItemStack(Item.ingotGold),
|
||||
'T', new ItemStack(Config.itemResource, 1, 2),
|
||||
'E', new ItemStack(Item.enderPearl));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -248,5 +248,37 @@ public final class ModInfusionRecipes {
|
||||
'R', new ItemStack(Item.redstone),
|
||||
'G', new ItemStack(Item.lightStoneDust),
|
||||
'Z', new ItemStack(Item.blazePowder));
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.POWER, 12).add(EnumTag.MOTION, 16).add(EnumTag.MECHANISM, 6).add(EnumTag.FLESH, 4);
|
||||
ThaumcraftApi.addInfusionCraftingRecipe(LibBlockNames.MOB_MAGNET_R, LibBlockNames.MOB_MAGNET_R, 150, tags, new ItemStack(ModBlocks.mobMagnet),
|
||||
" I ", "SIs", "LWR",
|
||||
'I', new ItemStack(Item.ingotGold),
|
||||
's', new ItemStack(Config.itemShard, 1, 3),
|
||||
'S', new ItemStack(Config.itemShard),
|
||||
'W', new ItemStack(Config.blockJar, 1, 1),
|
||||
'L', new ItemStack(Item.dyePowder, 1, 4),
|
||||
'R', new ItemStack(Item.redstone));
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.MECHANISM, 6).add(EnumTag.EXCHANGE, 6);
|
||||
ThaumcraftApi.addInfusionCraftingRecipe(LibBlockNames.INTERFACE_R, LibBlockNames.INTERFACE_R, 25, tags, new ItemStack(ModBlocks.interfase),
|
||||
"BRB", "LEL", "BRB",
|
||||
'B', new ItemStack(Config.blockInfusionWorkbench),
|
||||
'E', new ItemStack(Item.enderPearl),
|
||||
'L', new ItemStack(Item.dyePowder, 1, 4),
|
||||
'R', new ItemStack(Item.redstone));
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.MECHANISM, 6).add(EnumTag.POWER, 6);
|
||||
ThaumcraftApi.addInfusionCraftingRecipe(LibBlockNames.INTERFACE_R, LibItemNames.CONNECTOR_R, 25, tags, new ItemStack(ModItems.connector),
|
||||
" I ", " WI", "S ",
|
||||
'I', new ItemStack(Item.ingotIron),
|
||||
'W', new ItemStack(Config.itemWandCastingApprentice),
|
||||
'S', new ItemStack(Config.itemShard, 1, 4));
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.COLD, 12).add(EnumTag.LIFE, 6).add(EnumTag.TIME, 6);
|
||||
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.ICE_GLOBE_R, LibItemNames.ICE_GLOBE_R, 50, tags, new ItemStack(ModItems.iceGlobe),
|
||||
" G ", "G G", "ICI",
|
||||
'G', new ItemStack(Block.thinGlass),
|
||||
'I', new ItemStack(Item.ingotIron),
|
||||
'C', new ItemStack(Block.ice));
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,9 @@ public final class ModResearchItems {
|
||||
public static ResearchItem rainwaterBottle;
|
||||
public static ResearchItem weatherCrystals;
|
||||
public static ResearchItem lovePotion;
|
||||
public static ResearchItem mobMagnet;
|
||||
public static ResearchItem interfase;
|
||||
public static ResearchItem iceGlobe;
|
||||
|
||||
public static void registerModResearchItems() {
|
||||
ObjectTags tags = new ObjectTags().add(EnumTag.MAGIC, 16).add(EnumTag.VOID, 8);
|
||||
@@ -160,5 +163,14 @@ public final class ModResearchItems {
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.LIFE, 24).add(EnumTag.CONTROL, 10).add(EnumTag.EARTH, 5).add(EnumTag.HEAL, 4);
|
||||
lovePotion = new ResearchItem(LibItemNames.LOVE_POTION_R, tags, 1, 20, new ItemStack(ModItems.lovePotion)).setHidden().setParents(Config.researchUTFT).registerResearchItem();
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.POWER, 8).add(EnumTag.KNOWLEDGE, 14).add(EnumTag.MOTION, 6).add(EnumTag.METAL, 8).add(EnumTag.MECHANISM, 14).add(EnumTag.VALUABLE, 8).add(EnumTag.PURE, 12).add(EnumTag.FLESH, 10);
|
||||
mobMagnet = new ResearchItem(LibBlockNames.MOB_MAGNET_R, tags, -5, 27, new ItemStack(ModBlocks.mobMagnet)).setHidden().setParents(magnet).registerResearchItem();
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.MECHANISM, 5).add(EnumTag.POWER, 6).add(EnumTag.ELDRITCH, 2).add(EnumTag.EXCHANGE, 5);
|
||||
interfase = new ResearchItem(LibBlockNames.INTERFACE_R, tags, -5, -2, new ItemStack(ModBlocks.interfase)).setHidden().setParents(Config.researchMagicBlock).registerResearchItem();
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.COLD, 20).add(EnumTag.LIFE, 8).add(EnumTag.FLESH, 6).add(EnumTag.TIME, 6);
|
||||
iceGlobe = new ResearchItem(LibItemNames.ICE_GLOBE_R, tags, -1, 20, new ItemStack(ModItems.iceGlobe)).setHidden().setParents(Config.researchUTFT).registerResearchItem();
|
||||
}
|
||||
}
|
||||
@@ -409,6 +409,10 @@ public class TileEntityAnimationTablet extends TileEntity implements IInventory
|
||||
if (inventorySlots[par1].stackSize <= par2) {
|
||||
stackAt = inventorySlots[par1];
|
||||
inventorySlots[par1] = null;
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
PacketDispatcher.sendPacketToAllPlayers(getDescriptionPacket());
|
||||
|
||||
return stackAt;
|
||||
} else {
|
||||
stackAt = inventorySlots[par1].splitStack(par2);
|
||||
@@ -416,6 +420,9 @@ public class TileEntityAnimationTablet extends TileEntity implements IInventory
|
||||
if (inventorySlots[par1].stackSize == 0)
|
||||
inventorySlots[par1] = null;
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
PacketDispatcher.sendPacketToAllPlayers(getDescriptionPacket());
|
||||
|
||||
return stackAt;
|
||||
}
|
||||
}
|
||||
@@ -431,6 +438,9 @@ public class TileEntityAnimationTablet extends TileEntity implements IInventory
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
inventorySlots[i] = itemstack;
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
PacketDispatcher.sendPacketToAllPlayers(getDescriptionPacket());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* ThaumicTinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [26 Jul 2013, 01:56:42 (GMT)]
|
||||
*/
|
||||
package vazkii.tinkerer.tile;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.api.power.IPowerProvider;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
|
||||
public class TileEntityInterface extends TileEntity implements ISidedInventory, ITankContainer, IPowerReceptor {
|
||||
|
||||
public int x, y, z;
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound par1nbtTagCompound) {
|
||||
super.writeToNBT(par1nbtTagCompound);
|
||||
|
||||
par1nbtTagCompound.setInteger("xt", x);
|
||||
par1nbtTagCompound.setInteger("yt", y);
|
||||
par1nbtTagCompound.setInteger("zt", z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound par1nbtTagCompound) {
|
||||
super.readFromNBT(par1nbtTagCompound);
|
||||
|
||||
x = par1nbtTagCompound.getInteger("xt");
|
||||
y = par1nbtTagCompound.getInteger("yt");
|
||||
z = par1nbtTagCompound.getInteger("zt");
|
||||
}
|
||||
|
||||
private TileEntity getTile() {
|
||||
if(!worldObj.blockExists(x, y, z))
|
||||
return null;
|
||||
|
||||
TileEntity tile = worldObj.getBlockTileEntity(x, y, z);
|
||||
if(tile == null)
|
||||
y = -1;
|
||||
|
||||
return tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IInventory ? ((IInventory) tile).getSizeInventory() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IInventory ? ((IInventory) tile).getStackInSlot(i) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IInventory ? ((IInventory) tile).decrStackSize(i, j) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IInventory ? ((IInventory) tile).getStackInSlotOnClosing(i) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
TileEntity tile = getTile();
|
||||
if (tile instanceof IInventory)
|
||||
((IInventory) tile).setInventorySlotContents(i, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName() {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IInventory ? ((IInventory) tile).getInvName() : "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized() {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IInventory ? ((IInventory) tile).isInvNameLocalized() : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IInventory ? ((IInventory) tile).getInventoryStackLimit() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChest() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeChest() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStackValidForSlot(int i, ItemStack itemstack) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IInventory ? ((IInventory) tile).isStackValidForSlot(i, itemstack) : false;
|
||||
}
|
||||
|
||||
// 1.6 stuff:
|
||||
/*@Override
|
||||
public int fill(ForgeDirection from, LiquidStack resource, boolean doFill) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ILiquidTank ? ((IFluidHandler) tile).fill(from, resource, doFill) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IFluidHandler ? ((IFluidHandler) tile).drain(from, resource, doDrain) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IFluidHandler ? ((IFluidHandler) tile).drain(from, maxDrain, doDrain) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IFluidHandler ? ((IFluidHandler) tile).canFill(from, fluid) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IFluidHandler ? ((IFluidHandler) tile).canDrain(from, fluid) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IFluidHandler ? ((IFluidHandler) tile).getTankInfo(from) : null;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int var1) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ISidedInventory ? ((ISidedInventory) tile).getAccessibleSlotsFromSide(var1) : tile instanceof IInventory ? buildSlotsForLinearInventory((IInventory) tile) : new int[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ISidedInventory ? ((ISidedInventory) tile).canInsertItem(i, itemstack, j) : tile instanceof IInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ISidedInventory ? ((ISidedInventory) tile).canExtractItem(i, itemstack, j) : tile instanceof IInventory;
|
||||
}
|
||||
|
||||
private int[] buildSlotsForLinearInventory(IInventory inv) {
|
||||
int[] slots = new int[inv.getSizeInventory()];
|
||||
for (int i = 0; i < slots.length; i++)
|
||||
slots[i] = i;
|
||||
|
||||
return slots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWork() {
|
||||
TileEntity tile = getTile();
|
||||
if (tile instanceof IPowerReceptor)
|
||||
((IPowerReceptor) tile).doWork();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPowerProvider(IPowerProvider provider) {
|
||||
TileEntity tile = getTile();
|
||||
if (tile instanceof IPowerReceptor)
|
||||
((IPowerReceptor) tile).setPowerProvider(provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPowerProvider getPowerProvider() {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IPowerReceptor ? ((IPowerReceptor) tile).getPowerProvider() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int powerRequest(ForgeDirection from) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof IPowerReceptor ? ((IPowerReceptor) tile).powerRequest(from) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, LiquidStack resource, boolean doFill) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ITankContainer ? ((ITankContainer) tile).fill(from, resource, doFill) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(int tankIndex, LiquidStack resource, boolean doFill) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ITankContainer ? ((ITankContainer) tile).fill(tankIndex, resource, doFill) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LiquidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ITankContainer ? ((ITankContainer) tile).drain(from, maxDrain, doDrain) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LiquidStack drain(int tankIndex, int maxDrain, boolean doDrain) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ITankContainer ? ((ITankContainer) tile).drain(tankIndex, maxDrain, doDrain) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILiquidTank[] getTanks(ForgeDirection direction) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ITankContainer ? ((ITankContainer) tile).getTanks(direction) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) {
|
||||
TileEntity tile = getTile();
|
||||
return tile instanceof ITankContainer ? ((ITankContainer) tile).getTank(direction, type) : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
/**
|
||||
* This class was created by <TheWhiteWolves>. It's distributed as
|
||||
* part of the Thaumic Tinkerer Mod.
|
||||
*
|
||||
* Thaumic Tinkerer is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* Thaumic Tinkerer is a Derivative Work on Thaumcraft 3.
|
||||
* Thaumcraft 3 © Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* File Created @ [6 Jul 2013, 15:13:00 (GMT)]
|
||||
*/
|
||||
|
||||
package vazkii.tinkerer.tile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import thaumcraft.client.codechicken.core.vec.Vector3;
|
||||
import vazkii.tinkerer.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.lib.LibBlockNames;
|
||||
import vazkii.tinkerer.network.PacketManager;
|
||||
import vazkii.tinkerer.network.packet.PacketMobMagnetSync;
|
||||
import vazkii.tinkerer.util.helper.ItemNBTHelper;
|
||||
|
||||
public class TileEntityMobMagnet extends TileEntity implements IInventory {
|
||||
|
||||
ItemStack[] inventorySlots = new ItemStack[1];
|
||||
private static final String TAG_PATTERN = "pattern";
|
||||
private static final String NON_ASSIGNED = "Blank";
|
||||
|
||||
public boolean adult = true;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
int redstone = 0;
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
redstone = Math.max(redstone, worldObj.getIndirectPowerLevelTo(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal()));
|
||||
|
||||
if(redstone > 0) {
|
||||
double x1 = xCoord + 0.5;
|
||||
double y1 = yCoord + 0.5;
|
||||
double z1 = zCoord + 0.5;
|
||||
|
||||
boolean blue = getBlockMetadata() == 0;
|
||||
int speedMod = blue ? 1 : -1;
|
||||
double range = redstone / 2;
|
||||
|
||||
AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(x1 - range, yCoord, z1 - range, x1 + range, y1 + range, z1 + range);
|
||||
List<EntityLiving> entities = worldObj.getEntitiesWithinAABB(EntityLiving.class, boundingBox);
|
||||
|
||||
for(EntityLiving entity : entities) {
|
||||
if(!(entity instanceof EntityPlayer)) {
|
||||
|
||||
if(inventorySlots[0] != null) { // Filter Exists
|
||||
// Fill in Filter effects here
|
||||
String pattern = ItemNBTHelper.getString(inventorySlots[0], TAG_PATTERN, NON_ASSIGNED);
|
||||
if(entity.getEntityName().equals(pattern)) {
|
||||
if(entity instanceof EntityAgeable) {
|
||||
if(adult && !entity.isChild()) {
|
||||
moveEntity(blue, entity, x1, y1, z1, speedMod);
|
||||
}
|
||||
else if(!adult && entity.isChild()) {
|
||||
moveEntity(blue, entity, x1, y1, z1, speedMod);
|
||||
}
|
||||
}
|
||||
else {
|
||||
moveEntity(blue, entity, x1, y1, z1, speedMod);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
moveEntity(blue, entity, x1, y1, z1, speedMod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void moveEntity(boolean blue, EntityLiving entity, double x1, double y1, double z1, int speedMod) {
|
||||
double x2 = entity.posX;
|
||||
double y2 = entity.posY;
|
||||
double z2 = entity.posZ;
|
||||
|
||||
float distanceSqrd = blue ? (float) ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)) : 1.1F;
|
||||
|
||||
if(distanceSqrd > 1) {
|
||||
setEntityMotionFromVector(entity, x1, y1, z1, speedMod * 0.25F);
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) x2, (float) y2, (float) z2, blue ? 2 : 4);
|
||||
}
|
||||
}
|
||||
|
||||
private static void setEntityMotionFromVector(Entity entity, double x, double y, double z, float modifier) {
|
||||
Vector3 originalPosVector = new Vector3(x, y, z);
|
||||
Vector3 entityVector = Vector3.fromEntityCenter(entity);
|
||||
Vector3 finalVector = originalPosVector.subtract(entityVector).normalize();
|
||||
entity.motionX = finalVector.x * modifier;
|
||||
entity.motionY = finalVector.y * modifier;
|
||||
entity.motionZ = finalVector.z * modifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
super.readFromNBT(par1NBTTagCompound);
|
||||
|
||||
NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
|
||||
inventorySlots = new ItemStack[getSizeInventory()];
|
||||
for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
|
||||
NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
|
||||
byte var5 = var4.getByte("Slot");
|
||||
if (var5 >= 0 && var5 < inventorySlots.length)
|
||||
inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
super.writeToNBT(par1NBTTagCompound);
|
||||
|
||||
NBTTagList var2 = new NBTTagList();
|
||||
for (int var3 = 0; var3 < inventorySlots.length; ++var3) {
|
||||
if (inventorySlots[var3] != null) {
|
||||
NBTTagCompound var4 = new NBTTagCompound();
|
||||
var4.setByte("Slot", (byte)var3);
|
||||
inventorySlots[var3].writeToNBT(var4);
|
||||
var2.appendTag(var4);
|
||||
}
|
||||
}
|
||||
par1NBTTagCompound.setTag("Items", var2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return inventorySlots.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return inventorySlots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if (inventorySlots[i] != null) {
|
||||
ItemStack stackAt;
|
||||
|
||||
if (inventorySlots[i].stackSize <= j) {
|
||||
stackAt = inventorySlots[i];
|
||||
inventorySlots[i] = null;
|
||||
return stackAt;
|
||||
} else {
|
||||
stackAt = inventorySlots[i].splitStack(j);
|
||||
|
||||
if (inventorySlots[i].stackSize == 0)
|
||||
inventorySlots[i] = null;
|
||||
|
||||
return stackAt;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
return getStackInSlot(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
inventorySlots[i] = itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName() {
|
||||
return LibBlockNames.MOB_MAGNET_D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this ? false : entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChest() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeChest() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStackValidForSlot(int i, ItemStack itemstack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
return PacketManager.generatePacket(new PacketMobMagnetSync(this));
|
||||
}
|
||||
}
|
||||
@@ -73,6 +73,9 @@ public final class ConfigurationHandler {
|
||||
LibItemIDs.idRainwaterBottle = loadItem(LibItemNames.RAINWATER_BOTTLE, LibItemIDs.DEFAULT_RAINWATER_BOTTLE);
|
||||
LibItemIDs.idWeatherCrystal = loadItem(LibItemNames.WEATHER_CRYSTAL, LibItemIDs.DEFAULT_WEATHER_CRYSTAL);
|
||||
LibItemIDs.idLovePotion = loadItem(LibItemNames.LOVE_POTION, LibItemIDs.DEFAULT_LOVE_POTION);
|
||||
LibItemIDs.idSoulMould = loadItem(LibItemNames.SOUL_MOULD, LibItemIDs.DEFAULT_SOUL_MOULD);
|
||||
LibItemIDs.idConnector = loadItem(LibItemNames.CONNECTOR, LibItemIDs.DEFAULT_CONNECTOR);
|
||||
LibItemIDs.idIceGlobe = loadItem(LibItemNames.ICE_GLOBE, LibItemIDs.DEFAULT_ICE_GLOBE);
|
||||
|
||||
LibBlockIDs.idGlowstoneGas = loadBlock(LibBlockNames.GLOWSTONE_GAS, LibBlockIDs.DEFAULT_GLOWSTONE_GAS);
|
||||
LibBlockIDs.idTransmutator = loadBlock(LibBlockNames.TRANSMUTATOR, LibBlockIDs.DEFAULT_TRANSMUTATOR);
|
||||
@@ -86,6 +89,8 @@ public final class ConfigurationHandler {
|
||||
LibBlockIDs.idPhantomStone = loadBlock(LibBlockNames.PHANTOM_STONE, LibBlockIDs.DEFAULT_PHANTOM_STONE);
|
||||
LibBlockIDs.idNitorGas = loadBlock(LibBlockNames.NITOR_GAS, LibBlockIDs.DEFAULT_NITOR_GAS);
|
||||
LibBlockIDs.idMagnet = loadBlock(LibBlockNames.MAGNET, LibBlockIDs.DEFAULT_MAGNET);
|
||||
LibBlockIDs.idMobMagnet = loadBlock(LibBlockNames.MOB_MAGNET, LibBlockIDs.DEFAULT_MOB_MAGNET);
|
||||
LibBlockIDs.idInterface = loadBlock(LibBlockNames.INTERFACE, LibBlockIDs.DEFAULT_INTERFACE);
|
||||
|
||||
LibPotions.idStopwatch = loadPotion(LibPotions.NAME_STOPWATCH, LibPotions.DEFAULT_ID_STOPWATCH);
|
||||
LibPotions.idFrozen = loadPotion(LibPotions.NAME_FROZEN, LibPotions.DEFAULT_ID_FROZEN);
|
||||
|
||||
@@ -18,11 +18,14 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.client.gui.GuiAnimationTablet;
|
||||
import vazkii.tinkerer.client.gui.GuiMobMagnet;
|
||||
import vazkii.tinkerer.client.gui.GuiTransmutator;
|
||||
import vazkii.tinkerer.inventory.container.ContainerAnimationTablet;
|
||||
import vazkii.tinkerer.inventory.container.ContainerMobMagnet;
|
||||
import vazkii.tinkerer.inventory.container.ContainerTransmutator;
|
||||
import vazkii.tinkerer.lib.LibGuiIDs;
|
||||
import vazkii.tinkerer.tile.TileEntityAnimationTablet;
|
||||
import vazkii.tinkerer.tile.TileEntityMobMagnet;
|
||||
import vazkii.tinkerer.tile.TileEntityTransmutator;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
@@ -37,6 +40,9 @@ public final class GuiHandler implements IGuiHandler {
|
||||
|
||||
case LibGuiIDs.ID_ANIMATION_TABLET :
|
||||
return new ContainerAnimationTablet((TileEntityAnimationTablet) tile, player.inventory);
|
||||
|
||||
case LibGuiIDs.ID_MOB_MAGNET :
|
||||
return new ContainerMobMagnet((TileEntityMobMagnet) tile, player.inventory);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -50,6 +56,9 @@ public final class GuiHandler implements IGuiHandler {
|
||||
|
||||
case LibGuiIDs.ID_ANIMATION_TABLET :
|
||||
return new GuiAnimationTablet((TileEntityAnimationTablet) tile, player.inventory);
|
||||
|
||||
case LibGuiIDs.ID_MOB_MAGNET :
|
||||
return new GuiMobMagnet((TileEntityMobMagnet) tile, player.inventory);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
@@ -382,4 +382,49 @@ This potion-like item acts similar to a splash potion, simply tossing it near an
|
||||
<page type = "infusioncrafting">LOVE_POTION</page>
|
||||
</project>
|
||||
|
||||
<!-- ======================================== Advanced Thaumostatic Magnetizer /-->
|
||||
<project id = "MOB_MAGNET" version = "1">
|
||||
<name>Advanced Thaumostatic Magnetizer</name>
|
||||
<popupText>[TT] Corporal Attraction</popupText>
|
||||
<longText>By tinkerering with the Thuamostatic Magnetizer you think you can apply the knowledge of moving matter in space to the flesh and make the field more accurate in its effect</longText>
|
||||
<page type = "text">With the Thaumostatic Magnetizer you devised a way to manipulate inanimate objects in the world with a magnetic field, this was useful but with more tinkerering you have devised a way to apply this magnetic field to the flesh (living or dead).
|
||||
|
||||
This block acts as a magnet, it's state can be changed by right clicking it. While in south (blue) mode, it'll pull any nearby mobs towards it. While in north (red) mode, it'll do the opposite. Furthermore, the range of this attraction, or repulsion, is determined by the strength of the redstone signal applied to it.</page>
|
||||
<page type = "infusioncrafting">MOB_MAGNET</page>
|
||||
<page type = "text">With the new function of the magnetizer, you have created a filtering system for the Advanced Magnetizer.
|
||||
|
||||
Using a new device you have created you can Right-Click on a mob to take a copy of its magnetic signature and then use this to make the magnetizer affect only that mob.
|
||||
|
||||
Shift-Right Clicking will clear the magnetic signature.
|
||||
|
||||
To use the Soul Mould as a filter, Right-Click the Advanced Magnetizer with a casting wand to open the interface and place the Soul Mould in.</page>
|
||||
<page type = "arcanecrafting">SOUL_MOULD</page>
|
||||
</project>
|
||||
|
||||
<!-- ======================================== Transvector Interface /-->
|
||||
<project id = "INTERFACE" version = "1">
|
||||
<name>Transvector Interface</name>
|
||||
<popupText>[TT] Cubic Extension</popupText>
|
||||
<longText>The fact that you can only interact with six sides of a block at once is frustrating you. You think you can make a way of extending said interaction.</longText>
|
||||
<page type = "text">"The thing is, there's only six sides to a block." - Direwolf20
|
||||
|
||||
Myth = Busted! Your latest construct can be bound to a block in the nearby vacinity. It's sides will mimic the sides of the block selected, and it'll function as an extnsion. It can accept buildcraft power, items, and liquids, being able to also export the latter two. [continued]</page>
|
||||
<page type = "infusioncrafting">INTERFACE</page>
|
||||
<page type = "text">In order to bind an interface to another block, you need to create a special tool to do so. What you call the Interface Binder should get the job done.
|
||||
|
||||
By simply right clicking on the interface followed by right clicking on the target, these two get bound and ready for operation. (Note: buildcraft pipes need to be broken and replaced to work)</page>
|
||||
<page type = "infusioncrafting">CONNECTOR</page>
|
||||
</project>
|
||||
|
||||
<!-- ======================================== Cryogenic Globe /-->
|
||||
<project id = "ICE_GLOBE" version = "1">
|
||||
<name>Cryogenic Globe</name>
|
||||
<popupText>[TT] Absolute Zero</popupText>
|
||||
<longText>By studying the element of cold, you think you can create a method of preserving living beings.</longText>
|
||||
<page type = "text">After study of the element of cold, you managed to devise a globe of pure cold.
|
||||
|
||||
This globe can be utilized by left clicking on a living being (this won't hurt them). Upon doing so, the globe is consumed, and the living being gets possessed with cryogenic energy, preventing it from naturally despawning.</page>
|
||||
<page type = "infusioncrafting">ICE_GLOBE</page>
|
||||
</project>
|
||||
|
||||
</research>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
@@ -0,0 +1,12 @@
|
||||
0*1
|
||||
1*1
|
||||
2*1
|
||||
3*1
|
||||
4*1
|
||||
5*1
|
||||
6*1
|
||||
7*1
|
||||
8*1
|
||||
9*1
|
||||
10*1
|
||||
11*20
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.3 KiB |