placable geiger counter, counterfeit keys, prototype forcefield

This commit is contained in:
HbmMods 2018-11-28 18:57:28 +01:00
parent 47f521de90
commit 45275fe787
33 changed files with 786 additions and 24 deletions

View File

@ -268,6 +268,8 @@ item.turret_biometry.name=Geschütz-Telemetriekarte
item.key.name=Schlüssel
item.key_red.name=Roter Schlüssel
item.key_kit.name=Schlüssel-Imitationskit
item.key_fake.name=Gefälschter Schlüssel
item.pin.name=Haarklammer
item.padlock_rusty.name=Rostiges Vorhängeschloss
item.padlock.name=Vorhängeschloss
@ -1783,7 +1785,8 @@ item.pellet_coolant.name=Kühlcluster
item.linker.name=Telelinker
item.oil_detector.name=Ölvorkommen-Detektor
item.geiger_counter.name=Geigerzähler
item.geiger_counter.name=Mobiler Geigerzähler
tile.geiger.name=Geigerzähler
item.survey_scanner.name=Tiefenscanner
item.thermo_element.name=Thermoelektrisches Element

View File

@ -281,6 +281,8 @@ item.turret_biometry.name=Turret Telemetry Card
item.key.name=Key
item.key_red.name=Red Key
item.key_kit.name=Key Imitation Kit
item.key_fake.name=Counterfeit Key
item.pin.name=Bobby Pin
item.padlock_rusty.name=Rusty Padlock
item.padlock.name=Padlock
@ -1783,7 +1785,8 @@ item.pellet_coolant.name=Coolant Cluster
item.linker.name=Telelinker
item.oil_detector.name=Oil Reservoir Detector
item.geiger_counter.name=Geiger Counter
item.geiger_counter.name=Handheld Geiger Counter
tile.geiger.name=Geiger Counter
item.survey_scanner.name=Survey Scanner
item.thermo_element.name=Thermoelectric Element

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

View File

@ -154,6 +154,7 @@ public class ModBlocks {
public static Block steel_scaffold;
public static Block broadcaster_pc;
public static Block geiger;
public static Block mush;
public static Block mush_block;
@ -594,7 +595,8 @@ public class ModBlocks {
public static Block ntm_dirt;
public static Block ff;
private static void initializeBlock() {
test_render = new TestRender(Material.rock).setBlockName("test_render").setCreativeTab(null);
@ -718,6 +720,7 @@ public class ModBlocks {
steel_scaffold = new DecoBlock(Material.rock).setBlockName("steel_scaffold").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":steel_scaffold");
broadcaster_pc = new PinkCloudBroadcaster(Material.rock).setBlockName("broadcaster_pc").setCreativeTab(MainRegistry.machineTab).setHardness(15.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":broadcaster_pc");
geiger = new GeigerCounter(Material.rock).setBlockName("geiger").setCreativeTab(MainRegistry.machineTab).setHardness(15.0F).setResistance(15.0F).setBlockTextureName(RefStrings.MODID + ":geiger");
mush = new BlockMush(Material.plants).setBlockName("mush").setCreativeTab(MainRegistry.blockTab).setLightLevel(0.5F).setStepSound(Block.soundTypeGrass).setBlockTextureName(RefStrings.MODID + ":mush");
mush_block = new BlockMushHuge(Material.plants).setBlockName("mush_block").setLightLevel(1.0F).setStepSound(Block.soundTypeGrass).setHardness(0.2F).setBlockTextureName(RefStrings.MODID + ":mush_block_skin");
@ -1048,6 +1051,8 @@ public class ModBlocks {
dummy_block_puf6 = new DummyBlockMachine(Material.iron, guiID_puf6_tank, machine_puf6_tank).setBlockName("dummy_block_puf6").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
ntm_dirt = new BlockNTMDirt().setBlockName("ntm_dirt").setHardness(0.5F).setStepSound(Block.soundTypeGravel).setCreativeTab(null).setBlockTextureName("dirt");
ff = new BlockFF(Material.iron).setBlockName("ff").setHardness(0.5F).setStepSound(Block.soundTypeGravel).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":code");
}
private static void registerBlock() {
@ -1265,6 +1270,9 @@ public class ModBlocks {
//This Thing
GameRegistry.registerBlock(broadcaster_pc, broadcaster_pc.getUnlocalizedName());
//Geiger Counter
GameRegistry.registerBlock(geiger, geiger.getUnlocalizedName());
//Silo Hatch
GameRegistry.registerBlock(seal_frame, seal_frame.getUnlocalizedName());
GameRegistry.registerBlock(seal_controller, seal_controller.getUnlocalizedName());
@ -1509,5 +1517,6 @@ public class ModBlocks {
GameRegistry.registerBlock(cheater_virus, cheater_virus.getUnlocalizedName());
GameRegistry.registerBlock(cheater_virus_seed, cheater_virus_seed.getUnlocalizedName());
GameRegistry.registerBlock(ntm_dirt, ntm_dirt.getUnlocalizedName());
GameRegistry.registerBlock(ff, ff.getUnlocalizedName());
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.blocks.generic;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemLock;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
@ -148,7 +149,7 @@ public class BlockStorageCrate extends BlockContainer {
if(world.isRemote)
{
return true;
} else if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemLock) {
} else if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
return false;
} else if(!player.isSneaking())

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import com.hbm.interfaces.IBomb;
import com.hbm.interfaces.IMultiblock;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemLock;
import com.hbm.tileentity.machine.TileEntityBlastDoor;
import com.hbm.tileentity.machine.TileEntityVaultDoor;
@ -57,7 +58,7 @@ public class BlastDoor extends BlockContainer implements IBomb, IMultiblock {
if(world.isRemote)
{
return true;
} else if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemLock) {
} else if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
return false;
} if(!player.isSneaking()) {

View File

@ -0,0 +1,36 @@
package com.hbm.blocks.machine;
import com.hbm.tileentity.machine.TileEntityFF;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class BlockFF extends BlockContainer {
public BlockFF(Material p_i45386_1_) {
super(p_i45386_1_);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityFF();
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
}

View File

@ -5,6 +5,7 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IBomb;
import com.hbm.interfaces.IDummy;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemLock;
import com.hbm.tileentity.machine.TileEntityBlastDoor;
import com.hbm.tileentity.machine.TileEntityDummy;
@ -82,7 +83,7 @@ public class DummyBlockBlast extends BlockContainer implements IDummy, IBomb {
if(world.isRemote)
{
return true;
} else if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemLock) {
} else if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
return false;
} else if(!player.isSneaking())

View File

@ -5,6 +5,7 @@ import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IBomb;
import com.hbm.interfaces.IDummy;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemLock;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityDummy;
@ -85,7 +86,7 @@ public class DummyBlockVault extends BlockContainer implements IDummy, IBomb {
if(world.isRemote)
{
return true;
} else if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemLock) {
} else if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
return false;
} else if(!player.isSneaking())

View File

@ -0,0 +1,146 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.MainRegistry;
import com.hbm.saveddata.RadEntitySavedData;
import com.hbm.saveddata.RadiationSavedData;
import com.hbm.tileentity.machine.TileEntityBroadcaster;
import com.hbm.tileentity.machine.TileEntityMachineBattery;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
public class GeigerCounter extends BlockContainer {
public GeigerCounter(Material p_i45386_1_) {
super(p_i45386_1_);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityGeiger();
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
if(i == 0)
{
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
}
if(i == 1)
{
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
}
if(i == 2)
{
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
}
if(i == 3)
{
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
}
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
{
int te = p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_);
float f = 0.0625F;
this.setBlockBounds(0.0F, 0.0F, 2*f, 1.0F, 1.0F, 14*f);
switch(te)
{
case 4:
this.setBlockBounds(2*f, 0.0F, 1*f, 14*f, 9*f, 15*f);
break;
case 2:
this.setBlockBounds(1*f, 0.0F, 2*f, 15*f, 9*f, 14*f);
break;
case 5:
this.setBlockBounds(2*f, 0.0F, 1*f, 14*f, 9*f, 15*f);
break;
case 3:
this.setBlockBounds(1*f, 0.0F, 2*f, 15*f, 9*f, 14*f);
break;
}
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
int te = world.getBlockMetadata(x, y, z);
float f = 0.0625F;
this.setBlockBounds(0.0F, 0.0F, 2*f, 1.0F, 1.0F, 14*f);
switch(te)
{
case 4:
this.setBlockBounds(2*f, 0.0F, 1*f, 14*f, 9*f, 15*f);
break;
case 2:
this.setBlockBounds(1*f, 0.0F, 2*f, 15*f, 9*f, 14*f);
break;
case 5:
this.setBlockBounds(2*f, 0.0F, 1*f, 14*f, 9*f, 15*f);
break;
case 3:
this.setBlockBounds(1*f, 0.0F, 2*f, 15*f, 9*f, 14*f);
break;
}
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote)
{
return true;
} else if(!player.isSneaking())
{
world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F);
RadEntitySavedData eData = RadEntitySavedData.getData(player.worldObj);
int eRad = (int)eData.getRadFromEntity(player);
RadiationSavedData data = RadiationSavedData.getData(player.worldObj);
Chunk chunk = world.getChunkFromBlockCoords((int)player.posX, (int)player.posZ);
int rads = (int)Math.ceil(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition));
player.addChatMessage(new ChatComponentText("Current chunk radiation: " + rads + " RAD/s"));
player.addChatMessage(new ChatComponentText("Player contamination: " + eRad + " RAD"));
return true;
} else {
return false;
}
}
}

View File

@ -0,0 +1,69 @@
package com.hbm.blocks.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.saveddata.RadiationSavedData;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
public class TileEntityGeiger extends TileEntity {
int timer = 0;
int ticker = 0;
@Override
public void updateEntity() {
timer++;
if(timer == 10) {
timer = 0;
ticker = check();
}
if(timer % 5 == 0) {
if(ticker > 0) {
List<Integer> list = new ArrayList<Integer>();
if(ticker < 1)
list.add(0);
if(ticker < 5)
list.add(0);
if(ticker < 10)
list.add(1);
if(ticker > 5 && ticker < 15)
list.add(2);
if(ticker > 10 && ticker < 20)
list.add(3);
if(ticker > 15 && ticker < 25)
list.add(4);
if(ticker > 20 && ticker < 30)
list.add(5);
if(ticker > 25)
list.add(6);
int r = list.get(worldObj.rand.nextInt(list.size()));
if(r > 0)
worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:item.geiger" + r, 1.0F, 1.0F);
} else if(worldObj.rand.nextInt(50) == 0) {
worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:item.geiger"+ (1 + worldObj.rand.nextInt(1)), 1.0F, 1.0F);
}
}
}
public int check() {
RadiationSavedData data = RadiationSavedData.getData(worldObj);
Chunk chunk = worldObj.getChunkFromBlockCoords(xCoord, zCoord);
int rads = (int)Math.ceil(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition));
return rads;
}
}

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.machine;
import com.hbm.interfaces.IBomb;
import com.hbm.interfaces.IMultiblock;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemLock;
import com.hbm.tileentity.machine.TileEntityVaultDoor;
@ -222,7 +223,7 @@ public class VaultDoor extends BlockContainer implements IBomb, IMultiblock {
if(world.isRemote)
{
return true;
} else if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemLock) {
} else if(player.getHeldItem() != null && (player.getHeldItem().getItem() instanceof ItemLock || player.getHeldItem().getItem() == ModItems.key_kit)) {
return false;
} if(!player.isSneaking()) {

View File

@ -90,7 +90,7 @@ public class EntityFalloutRain extends Entity {
this.setDead();
}
System.out.println(age + " " + maxAge);
//System.out.println(age + " " + maxAge);
}
}

View File

@ -50,7 +50,7 @@ public class EntityNukeExplosionMK4 extends Entity {
RadiationSavedData data = RadiationSavedData.getData(worldObj);
float radMax = (float) (length / 2F * Math.pow(length, 2) / 35F);
System.out.println(radMax);
//System.out.println(radMax);
float rad = radMax / 4F;
data.incrementRad(worldObj, (int)this.posX, (int)this.posZ, rad, radMax);
}

View File

@ -29,13 +29,20 @@ public class EntityBombletZeta extends EntityThrowable {
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + this.motionX, posY + this.motionY, posZ + this.motionZ);
/*this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
this.posZ += this.motionZ;*/
this.motionX *= 0.99;
this.motionZ *= 0.99;

View File

@ -29,13 +29,20 @@ public class EntityBoxcar extends EntityThrowable {
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + this.motionX, posY + this.motionY, posZ + this.motionZ);
/*this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
this.posZ += this.motionZ;*/
this.motionY -= 0.03;
if(motionY < -1.5)

View File

@ -29,13 +29,20 @@ public class EntityBurningFOEQ extends EntityThrowable {
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + this.motionX, posY + this.motionY, posZ + this.motionZ);
/*this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
this.posZ += this.motionZ;*/
if(motionY > -4)
motionY -= 0.1;

View File

@ -55,13 +55,20 @@ public class EntityFallingNuke extends EntityThrowable {
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + this.motionX, posY + this.motionY, posZ + this.motionZ);
/*this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
this.posZ += this.motionZ;*/
this.motionX *= 0.99;
this.motionZ *= 0.99;

View File

@ -27,13 +27,20 @@ public class EntityMeteor extends EntityThrowable {
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + this.motionX, posY + this.motionY, posZ + this.motionZ);
/*this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
this.posZ += this.motionZ;*/
this.motionY -= 0.03;
if(motionY < -2.5)

View File

@ -1239,6 +1239,8 @@ public class ModItems {
public static Item key;
public static Item key_red;
public static Item key_kit;
public static Item key_fake;
public static Item pin;
public static Item padlock_rusty;
public static Item padlock;
@ -2398,6 +2400,8 @@ public class ModItems {
key = new ItemKey().setUnlocalizedName("key").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":key");
key_red = new ItemCustomLore().setUnlocalizedName("key_red").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":key_red");
key_kit = new ItemCounterfitKeys().setUnlocalizedName("key_kit").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":key_pair");
key_fake = new ItemKey().setUnlocalizedName("key_fake").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":key_gold");
pin = new ItemCustomLore().setUnlocalizedName("pin").setMaxStackSize(8).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pin");
padlock_rusty = new ItemLock(1).setUnlocalizedName("padlock_rusty").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":padlock_rusty");
padlock = new ItemLock(0.1).setUnlocalizedName("padlock").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":padlock");
@ -3474,6 +3478,8 @@ public class ModItems {
//Keys and Locks
GameRegistry.registerItem(key, key.getUnlocalizedName());
GameRegistry.registerItem(key_red, key_red.getUnlocalizedName());
GameRegistry.registerItem(key_kit, key_kit.getUnlocalizedName());
GameRegistry.registerItem(key_fake, key_fake.getUnlocalizedName());
GameRegistry.registerItem(pin, pin.getUnlocalizedName());
GameRegistry.registerItem(padlock_rusty, padlock_rusty.getUnlocalizedName());
GameRegistry.registerItem(padlock, padlock.getUnlocalizedName());

View File

@ -0,0 +1,52 @@
package com.hbm.items.tool;
import java.util.List;
import com.hbm.items.ModItems;
import com.hbm.tileentity.machine.TileEntityLockableBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class ItemCounterfitKeys extends Item {
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int b, float f0, float f1, float f2)
{
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TileEntityLockableBase) {
TileEntityLockableBase locked = (TileEntityLockableBase) te;
if(locked.isLocked()) {
ItemStack st = new ItemStack(ModItems.key_fake);
ItemKeyPin.setPins(st, locked.getPins());
player.inventory.setInventorySlotContents(player.inventory.currentItem, st.copy());
if(!player.inventory.addItemStackToInventory(st.copy())) {
player.dropPlayerItemWithRandomChoice(st.copy(), false);
}
player.inventoryContainer.detectAndSendChanges();
player.swingItem();
return true;
}
}
return false;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
list.add("Use on a locked container to create two counterfeit keys!");
}
}

View File

@ -30,7 +30,7 @@ public class ItemGeigerCounter extends Item {
setInt(stack, getInt(stack, "timer") + 1, "timer");
if(getInt(stack, "timer") == 10) {
setInt(stack, 0, "timer");
setInt(stack, check(world, (int)entity.posX, (int)entity.posY, (int)entity.posZ, 15), "ticker");
setInt(stack, check(world, (int)entity.posX, (int)entity.posY, (int)entity.posZ), "ticker");
}
int x = getInt(stack, "ticker");
@ -80,7 +80,7 @@ public class ItemGeigerCounter extends Item {
return 0;
}
public static int check(World world, int x, int y, int z, int radius) {
public static int check(World world, int x, int y, int z) {
RadiationSavedData data = RadiationSavedData.getData(world);

View File

@ -2,6 +2,8 @@ package com.hbm.items.tool;
import java.util.List;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -16,6 +18,12 @@ public class ItemKeyPin extends Item {
list.add("Pin configuration: " + getPins(itemstack));
else
list.add("Pins not set!");
if(this == ModItems.key_fake) {
list.add("");
list.add("Pins can neither be changed, nor copied.");
}
}
public static int getPins(ItemStack stack) {
@ -32,4 +40,8 @@ public class ItemKeyPin extends Item {
}
stack.stackTagCompound.setInteger("pins", i);
}
public boolean canTransfer() {
return this != ModItems.key_fake;
}
}

View File

@ -7,6 +7,7 @@ import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.common.MinecraftForge;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.TileEntityGeiger;
import com.hbm.entity.effect.*;
import com.hbm.entity.grenade.*;
import com.hbm.entity.item.EntityMinecartTest;
@ -82,6 +83,8 @@ public class ClientProxy extends ServerProxy
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCelPrimePort.class, new RenderCelPrimePart());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCelPrimeTanks.class, new RenderCelPrimePart());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFF.class, new RenderForceField());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCentrifuge.class, new RenderCentrifuge());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineGasCent.class, new RenderCentrifuge());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineUF6Tank.class, new RenderUF6Tank());
@ -344,6 +347,7 @@ public class ClientProxy extends ServerProxy
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecoBlock.class, new RenderDecoBlock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBroadcaster.class, new RenderDecoBlock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGeiger.class, new RenderDecoBlock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRadioRec.class, new RenderDecoBlock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRadiobox.class, new RenderDecoBlock());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBomber.class, new RenderDecoBlock());

View File

@ -1163,6 +1163,7 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.geiger_counter, 1), new Object[] { "GPP", "WCS", "WBB", 'W', ModItems.wire_gold, 'P', ModItems.ingot_polymer, 'C', ModItems.circuit_copper, 'G', "ingotGold", 'S', "plateSteel", 'B', ModItems.ingot_beryllium }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.key, 1), new Object[] { " B", " B ", "P ", 'P', "plateSteel", 'B', ModItems.bolt_tungsten }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.key_kit, 1), new Object[] { "PKP", "DTD", "PKP", 'P', "plateGold", 'K', ModItems.key, 'D', "dustDiamond", 'T', ModItems.screwdriver }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.key_red, 1), new Object[] { "DSC", "SMS", "KSD", 'C', ModItems.circuit_targeting_tier4, 'M', Items.nether_star, 'K', ModItems.key, 'D', "dustDesh", 'S', "plateSaturnite" }));
GameRegistry.addRecipe(new ItemStack(ModItems.pin, 1), new Object[] { "W ", " W", " W", 'W', ModItems.wire_copper });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.padlock_rusty, 1), new Object[] { "I", "B", "I", 'I', "ingotIron", 'B', ModItems.bolt_tungsten }));
@ -1293,12 +1294,14 @@ public class CraftingManager {
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sat_laser), new Object[] { ModBlocks.sat_laser });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sat_resonator), new Object[] { ModBlocks.sat_resonator });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.sat_foeq), new Object[] { ModBlocks.sat_foeq });
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.geiger_counter), new Object[] { ModBlocks.geiger });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.sat_mapper), new Object[] { ModItems.sat_mapper });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.sat_scanner), new Object[] { ModItems.sat_scanner });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.sat_radar), new Object[] { ModItems.sat_radar });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.sat_laser), new Object[] { ModItems.sat_laser });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.sat_resonator), new Object[] { ModItems.sat_resonator });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.sat_foeq), new Object[] { ModItems.sat_foeq });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.geiger), new Object[] { ModItems.geiger_counter });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.sat_interface), new Object[] { "ISI", "PCP", "PAP", 'I', "ingotSteel", 'S', ModItems.ingot_starmetal, 'P', ModItems.plate_polymer, 'C', ModItems.sat_chip, 'A', ModItems.circuit_gold }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_spp_bottom), new Object[] { "MDM", "LCL", "LWL", 'M', "ingotMagnetizedTungsten", 'D', "plateDesh", 'L', "plateLead", 'C', ModItems.circuit_gold, 'W', ModItems.coil_magnetized_tungsten }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_spp_top), new Object[] { "LWL", "LCL", "MDM", 'M', "ingotMagnetizedTungsten", 'D', "plateDesh", 'L', "plateLead", 'C', ModItems.circuit_gold, 'W', ModItems.coil_magnetized_tungsten }));

View File

@ -44,6 +44,7 @@ import java.util.Random;
import org.apache.logging.log4j.Logger;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.TileEntityGeiger;
import com.hbm.creativetabs.BlockTab;
import com.hbm.creativetabs.ConsumableTab;
import com.hbm.creativetabs.ControlTab;
@ -271,6 +272,7 @@ import com.hbm.tileentity.machine.TileEntityCrateIron;
import com.hbm.tileentity.machine.TileEntityCrateSteel;
import com.hbm.tileentity.machine.TileEntityDiFurnace;
import com.hbm.tileentity.machine.TileEntityDummy;
import com.hbm.tileentity.machine.TileEntityFF;
import com.hbm.tileentity.machine.TileEntityFWatzCore;
import com.hbm.tileentity.machine.TileEntityFusionMultiblock;
import com.hbm.tileentity.machine.TileEntityHatch;
@ -735,6 +737,8 @@ public class MainRegistry
GameRegistry.registerTileEntity(TileEntityMachineBoiler.class, "tileentity_boiler");
GameRegistry.registerTileEntity(TileEntityMachineBoilerElectric.class, "tileentity_electric_boiler");
GameRegistry.registerTileEntity(TileEntityMachineTurbine.class, "tileentity_turbine");
GameRegistry.registerTileEntity(TileEntityGeiger.class, "tileentity_geiger");
GameRegistry.registerTileEntity(TileEntityFF.class, "tileentity_forcefield");
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);

View File

@ -0,0 +1,112 @@
// Date: 28.11.2018 08:36:32
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package com.hbm.render.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelGeiger extends ModelBase {
// fields
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape4;
ModelRenderer Shape5;
ModelRenderer Shape6;
ModelRenderer Shape7;
ModelRenderer Shape8;
public ModelGeiger() {
textureWidth = 64;
textureHeight = 32;
Shape1 = new ModelRenderer(this, 0, 0);
Shape1.addBox(0F, 0F, 0F, 12, 7, 5);
Shape1.setRotationPoint(-5F, 17F, 1F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
Shape2 = new ModelRenderer(this, 0, 30);
Shape2.addBox(0F, 0F, 0F, 7, 1, 1);
Shape2.setRotationPoint(-2.5F, 15F, 3F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape3 = new ModelRenderer(this, 10, 18);
Shape3.addBox(0F, 0F, 0F, 1, 2, 1);
Shape3.setRotationPoint(-3F, 15.5F, 3F);
Shape3.setTextureSize(64, 32);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
Shape4 = new ModelRenderer(this, 14, 18);
Shape4.addBox(0F, 0F, 0F, 1, 2, 1);
Shape4.setRotationPoint(4F, 15.5F, 3F);
Shape4.setTextureSize(64, 32);
Shape4.mirror = true;
setRotation(Shape4, 0F, 0F, 0F);
Shape5 = new ModelRenderer(this, 0, 12);
Shape5.addBox(0F, 0F, 0F, 7, 3, 3);
Shape5.setRotationPoint(-4F, 21F, -6F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, 0F, 0F, 0F);
Shape6 = new ModelRenderer(this, 20, 12);
Shape6.addBox(0F, 0F, 0F, 2, 6, 2);
Shape6.setRotationPoint(-7F, 18F, 2.5F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
Shape7 = new ModelRenderer(this, 0, 18);
Shape7.addBox(0F, 0F, 0F, 3, 2, 2);
Shape7.setRotationPoint(-7F, 22F, -5.5F);
Shape7.setTextureSize(64, 32);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
Shape8 = new ModelRenderer(this, 0, 22);
Shape8.addBox(0F, 0F, 0F, 2, 2, 6);
Shape8.setRotationPoint(-7F, 22F, -3.5F);
Shape8.setTextureSize(64, 32);
Shape8.mirror = true;
setRotation(Shape8, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
Shape1.render(f5);
Shape2.render(f5);
Shape3.render(f5);
Shape4.render(f5);
Shape5.render(f5);
Shape6.render(f5);
Shape7.render(f5);
Shape8.render(f5);
}
public void renderModel(float f) {
Shape1.render(f);
Shape2.render(f);
Shape3.render(f);
Shape4.render(f);
Shape5.render(f);
Shape6.render(f);
Shape7.render(f);
Shape8.render(f);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}

View File

@ -6,6 +6,7 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.lib.RefStrings;
import com.hbm.main.ResourceManager;
import com.hbm.render.model.ModelBroadcaster;
import com.hbm.render.model.ModelGeiger;
import com.hbm.render.model.ModelRadio;
import com.hbm.render.model.ModelSteelBeam;
import com.hbm.render.model.ModelSteelCorner;
@ -28,6 +29,7 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
private static final ResourceLocation texture6 = new ResourceLocation(RefStrings.MODID + ":" + "textures/models/ModelBroadcaster.png");
private static final ResourceLocation texture7 = new ResourceLocation(RefStrings.MODID + ":" + "textures/models/ModelRadio.png");
private static final ResourceLocation texture8 = new ResourceLocation(RefStrings.MODID + ":" + "textures/models/ModelRadioReceiver.png");
private static final ResourceLocation texture9 = new ResourceLocation(RefStrings.MODID + ":" + "textures/models/ModelGeiger.png");
private ModelSteelWall model1;
private ModelSteelCorner model2;
@ -36,6 +38,7 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
private ModelSteelScaffold model5;
private ModelBroadcaster model6;
private ModelRadio model7;
private ModelGeiger model8;
public RenderDecoBlock() {
this.model1 = new ModelSteelWall();
@ -45,6 +48,7 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
this.model5 = new ModelSteelScaffold();
this.model6 = new ModelBroadcaster();
this.model7 = new ModelRadio();
this.model8 = new ModelGeiger();
}
@Override
@ -123,6 +127,21 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
GL11.glRotatef(0, 0F, 1F, 0F); break;
}
}
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.geiger)
{
this.bindTexture(texture9);
switch(tileentity.getBlockMetadata())
{
case 4:
GL11.glRotatef(90, 0F, 1F, 0F); break;
case 2:
GL11.glRotatef(180, 0F, 1F, 0F); break;
case 5:
GL11.glRotatef(270, 0F, 1F, 0F); break;
case 3:
GL11.glRotatef(0, 0F, 1F, 0F); break;
}
}
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.radiorec)
{
this.bindTexture(texture8);
@ -172,6 +191,8 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
this.model5.renderModel(0.0625F);
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.broadcaster_pc)
this.model6.renderModel(0.0625F);
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.geiger)
this.model8.renderModel(0.0625F);
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.radiobox)
this.model7.renderModel(0.0625F, tileentity.getBlockMetadata() > 5 ? 160 : 20);
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.radiorec)

View File

@ -0,0 +1,113 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
public class RenderForceField extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
bindTexture(ResourceManager.radar_body_tex);
ResourceManager.radar_body.renderAll();
GL11.glTranslated(0, 0.5D, 0);
double rot = (System.currentTimeMillis() / 10D) % 360;
generateSphere(8, 16, 10F, 0x0088FF);
GL11.glPopMatrix();
}
private void generateSphere(int l, int s, float rad, int hex) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
float sRot = 360F / s;
float lRot = (float)Math.PI / l;
for(int k = 0; k < s; k++) {
GL11.glRotatef(sRot, 0F, 1F, 0F);
Vec3 vec = Vec3.createVectorHelper(0, rad, 0);
for(int i = 0; i < l; i++) {
Tessellator tessellator = Tessellator.instance;
/*if((i < 2 || i > l - 2) && k % 10 == 0) {
tessellator.startDrawing(3);
tessellator.setColorRGBA_F(0F, 1F, 0F, 1.0F);
tessellator.addVertex(vec.xCoord, vec.yCoord, vec.zCoord);
tessellator.addVertex(0, 0, 0);
tessellator.draw();
}*/
tessellator.startDrawing(3);
//tessellator.setColorRGBA_F(0F, 1F, 0F, 1.0F);
tessellator.setColorOpaque_I(hex);
tessellator.addVertex(vec.xCoord, vec.yCoord, vec.zCoord);
vec.rotateAroundX(lRot);
tessellator.addVertex(vec.xCoord, vec.yCoord, vec.zCoord);
tessellator.draw();
}
}
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
generateSphere2(l, s, rad, hex);
}
private void generateSphere2(int l, int s, float rad, int hex) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
float sRot = (float)Math.PI * 2F / (float)(s);
float lRot = (float)Math.PI / l;
Vec3 vec2 = Vec3.createVectorHelper(0, rad, 0);
for(int k = 0; k < l; k++) {
vec2.rotateAroundZ(lRot);
for(int i = 0; i < s; i++) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(3);
//tessellator.setColorRGBA_F(0F, 1F, 0F, 1.0F);
tessellator.setColorOpaque_I(hex);
tessellator.addVertex(vec2.xCoord, vec2.yCoord, vec2.zCoord);
vec2.rotateAroundY(sRot);
tessellator.addVertex(vec2.xCoord, vec2.yCoord, vec2.zCoord);
tessellator.draw();
}
}
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
}
}

View File

@ -0,0 +1,128 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.lib.ModDamageSource;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
public class TileEntityFF extends TileEntity {
@Override
public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
return 65536.0D;
}
List<Entity> outside = new ArrayList();
List<Entity> inside = new ArrayList();
@Override
public void updateEntity() {
//if(!worldObj.isRemote)
prototype(10F);
}
public void prototype(float rad) {
List<Entity> oLegacy = new ArrayList(outside);
List<Entity> iLegacy = new ArrayList(inside);
outside.clear();
inside.clear();
List<Object> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord + 0.5 - (rad + 25), yCoord + 0.5 - (rad + 25), zCoord + 0.5 - (rad + 25), xCoord + 0.5 + (rad + 25), yCoord + 0.5 + (rad + 25), zCoord + 0.5 + (rad + 25)));
for(Object o : list) {
if(o instanceof Entity && !(o instanceof EntityPlayer)) {
Entity entity = (Entity)o;
double dist = Math.sqrt(Math.pow(xCoord + 0.5 - entity.posX, 2) + Math.pow(yCoord + 0.5 - entity.posY, 2) + Math.pow(zCoord + 0.5 - entity.posZ, 2));
boolean out = dist > rad;
//if the entity has not been registered yet
if(!oLegacy.contains(entity) && !iLegacy.contains(entity)) {
if(out) {
outside.add(entity);
} else {
inside.add(entity);
}
//if the entity has been detected before
} else {
//if the entity has crossed inwards
if(oLegacy.contains(entity) && !out) {
Vec3 vec = Vec3.createVectorHelper(xCoord + 0.5 - entity.posX, yCoord + 0.5 - entity.posY, zCoord + 0.5 - entity.posZ);
vec = vec.normalize();
double mx = -vec.xCoord * (rad + 1);
double my = -vec.yCoord * (rad + 1);
double mz = -vec.zCoord * (rad + 1);
entity.setLocationAndAngles(xCoord + 0.5 + mx, yCoord + 0.5 + my, zCoord + 0.5 + mz, 0, 0);
double mo = Math.sqrt(Math.pow(entity.motionX, 2) + Math.pow(entity.motionY, 2) + Math.pow(entity.motionZ, 2));
entity.motionX = vec.xCoord * -mo;
entity.motionY = vec.yCoord * -mo;
entity.motionZ = vec.zCoord * -mo;
entity.posX -= entity.motionX;
entity.posY -= entity.motionY;
entity.posZ -= entity.motionZ;
outside.add(entity);
} else
//if the entity has crossed outwards
if(iLegacy.contains(entity) && out) {
Vec3 vec = Vec3.createVectorHelper(xCoord + 0.5 - entity.posX, yCoord + 0.5 - entity.posY, zCoord + 0.5 - entity.posZ);
vec = vec.normalize();
double mx = -vec.xCoord * (rad - 1);
double my = -vec.yCoord * (rad - 1);
double mz = -vec.zCoord * (rad - 1);
entity.setLocationAndAngles(xCoord + 0.5 + mx, yCoord + 0.5 + my, zCoord + 0.5 + mz, 0, 0);
double mo = Math.sqrt(Math.pow(entity.motionX, 2) + Math.pow(entity.motionY, 2) + Math.pow(entity.motionZ, 2));
entity.motionX = vec.xCoord * mo;
entity.motionY = vec.yCoord * mo;
entity.motionZ = vec.zCoord * mo;
entity.posX -= entity.motionX;
entity.posY -= entity.motionY;
entity.posZ -= entity.motionZ;
inside.add(entity);
} else {
if(out) {
outside.add(entity);
} else {
inside.add(entity);
}
}
}
}
}
}
}

View File

@ -174,12 +174,13 @@ public class TileEntityMachineKeyForge extends TileEntity implements ISidedInven
if(!worldObj.isRemote)
{
if(slots[0] != null && slots[1] != null && slots[0].getItem() instanceof ItemKeyPin && slots[1].getItem() instanceof ItemKeyPin) {
if(slots[0] != null && slots[1] != null && slots[0].getItem() instanceof ItemKeyPin && slots[1].getItem() instanceof ItemKeyPin &&
((ItemKeyPin)slots[0].getItem()).canTransfer() && ((ItemKeyPin)slots[1].getItem()).canTransfer()) {
ItemKeyPin.setPins(slots[1], ItemKeyPin.getPins(slots[0]));
}
if(slots[2] != null && slots[2].getItem() instanceof ItemKeyPin) {
if(slots[2] != null && slots[2].getItem() instanceof ItemKeyPin && ((ItemKeyPin)slots[2].getItem()).canTransfer()) {
ItemKeyPin.setPins(slots[2], worldObj.rand.nextInt(900) + 100);
}