mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
conveyorception
This commit is contained in:
parent
087ce9fccb
commit
d29d58e14f
@ -1,8 +1,6 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public interface IBlockMultiPass {
|
||||
|
||||
|
||||
14
src/main/java/com/hbm/blocks/IBlockSideRotation.java
Normal file
14
src/main/java/com/hbm/blocks/IBlockSideRotation.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public interface IBlockSideRotation {
|
||||
|
||||
public int getRotationFromSide(IBlockAccess world, int x, int y, int z, int side);
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
public static int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
}
|
||||
@ -747,6 +747,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block conveyor;
|
||||
public static Block conveyor_double;
|
||||
public static Block conveyor_triple;
|
||||
public static Block conveyor_chute;
|
||||
public static Block crane_extractor;
|
||||
public static Block crane_inserter;
|
||||
@ -1901,7 +1902,8 @@ public class ModBlocks {
|
||||
|
||||
conveyor = new BlockConveyor().setBlockName("conveyor").setHardness(0.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
|
||||
conveyor_double = new BlockConveyorDouble().setBlockName("conveyor_double").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor_double");
|
||||
conveyor_chute = new BlockConveyorChute().setBlockName("conveyor_chute").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor_chute");
|
||||
conveyor_triple = new BlockConveyorTriple().setBlockName("conveyor_triple").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor_triple");
|
||||
conveyor_chute = new BlockConveyorChute().setBlockName("conveyor_chute").setHardness(2.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
|
||||
crane_extractor = new CraneExtractor().setBlockName("crane_extractor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
crane_inserter = new CraneInserter().setBlockName("crane_inserter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
@ -3062,6 +3064,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(crane_inserter, crane_inserter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(conveyor, conveyor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(conveyor_double, conveyor_double.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(conveyor_triple, conveyor_triple.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(conveyor_chute, conveyor_chute.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(chain, chain.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ladder_sturdy, ladder_sturdy.getUnlocalizedName());
|
||||
|
||||
@ -53,35 +53,11 @@ public class BlockConveyor extends Block implements IConveyorBelt {
|
||||
@Override
|
||||
public Vec3 getTravelLocation(World world, int x, int y, int z, Vec3 itemPos, double speed) {
|
||||
|
||||
/*Vec3 snap = this.getClosestSnappingPosition(world, x, y, z, itemPos);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
|
||||
return Vec3.createVectorHelper(snap.xCoord + dir.offsetX * speed, snap.yCoord, snap.zCoord + dir.offsetZ * speed);*/
|
||||
|
||||
/*double dist = snap.distanceTo(itemPos);
|
||||
|
||||
if(dist > speed) {
|
||||
|
||||
return Vec3.createVectorHelper(
|
||||
itemPos.xCoord + (snap.xCoord - itemPos.xCoord) / dist * speed,
|
||||
snap.yCoord,
|
||||
itemPos.zCoord + (snap.zCoord - itemPos.zCoord) / dist * speed
|
||||
);
|
||||
} else {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
|
||||
return Vec3.createVectorHelper(snap.xCoord + dir.offsetX * speed, snap.yCoord, snap.zCoord + dir.offsetZ * speed);
|
||||
}*/
|
||||
|
||||
/// ATTEMT 2 ///
|
||||
/*Vec3 snap = this.getClosestSnappingPosition(world, x, y, z, itemPos);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
|
||||
return Vec3.createVectorHelper(snap.xCoord - dir.offsetX * speed, snap.yCoord, snap.zCoord - dir.offsetZ * speed);*/
|
||||
/// ///
|
||||
|
||||
ForgeDirection dir = getTravelDirection(world, x, y, z, itemPos, speed);
|
||||
//snapping point
|
||||
Vec3 snap = this.getClosestSnappingPosition(world, x, y, z, itemPos);
|
||||
//snapping point + speed
|
||||
Vec3 dest = Vec3.createVectorHelper(snap.xCoord - dir.offsetX * speed, snap.yCoord, snap.zCoord - dir.offsetZ * speed);
|
||||
Vec3 dest = Vec3.createVectorHelper(snap.xCoord - dir.offsetX * speed, snap.yCoord - dir.offsetY * speed, snap.zCoord - dir.offsetZ * speed);
|
||||
//delta to get to that point
|
||||
Vec3 motion = Vec3.createVectorHelper((dest.xCoord - itemPos.xCoord), (dest.yCoord - itemPos.yCoord), (dest.zCoord - itemPos.zCoord));
|
||||
double len = motion.lengthVector();
|
||||
|
||||
@ -1,17 +1,30 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import api.hbm.conveyor.IConveyorBelt;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockConveyorChute extends BlockConveyor {
|
||||
|
||||
@Override
|
||||
public Vec3 getTravelLocation(World world, int x, int y, int z, Vec3 itemPos, double speed) {
|
||||
|
||||
if(world.getBlock(x, y - 1, z) instanceof IConveyorBelt) {
|
||||
speed *= 5;
|
||||
} else if(itemPos.yCoord > y + 0.25) {
|
||||
speed *= 3;
|
||||
}
|
||||
|
||||
return super.getTravelLocation(world, x, y, z, itemPos, speed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ForgeDirection getTravelDirection(World world, int x, int y, int z, Vec3 itemPos, double speed) {
|
||||
|
||||
if(world.getBlock(x, y - 1, z) instanceof IConveyorBelt && itemPos.yCoord - speed < y) {
|
||||
return ForgeDirection.DOWN;
|
||||
if(world.getBlock(x, y - 1, z) instanceof IConveyorBelt || itemPos.yCoord > y + 0.25) {
|
||||
return ForgeDirection.UP;
|
||||
}
|
||||
|
||||
return ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
|
||||
@ -20,10 +33,17 @@ public class BlockConveyorChute extends BlockConveyor {
|
||||
@Override
|
||||
public Vec3 getClosestSnappingPosition(World world, int x, int y, int z, Vec3 itemPos) {
|
||||
|
||||
if(world.getBlock(x, y - 1, z) instanceof IConveyorBelt && itemPos.yCoord <= y + 0.25) {
|
||||
return super.getClosestSnappingPosition(world, x, y, z, itemPos);
|
||||
if(world.getBlock(x, y - 1, z) instanceof IConveyorBelt || itemPos.yCoord > y + 0.25) {
|
||||
return Vec3.createVectorHelper(x + 0.5, itemPos.yCoord, z + 0.5);
|
||||
} else {
|
||||
return Vec3.createVectorHelper(x + 0.5, y, z + 0.5);
|
||||
return super.getClosestSnappingPosition(world, x, y, z, itemPos);
|
||||
}
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockConveyorTriple extends BlockConveyor {
|
||||
|
||||
@Override
|
||||
public Vec3 getClosestSnappingPosition(World world, int x, int y, int z, Vec3 itemPos) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z));
|
||||
|
||||
itemPos.xCoord = MathHelper.clamp_double(itemPos.xCoord, x, x + 1);
|
||||
itemPos.zCoord = MathHelper.clamp_double(itemPos.zCoord, z, z + 1);
|
||||
|
||||
double posX = x + 0.5;
|
||||
double posZ = z + 0.5;
|
||||
|
||||
if(dir.offsetX != 0) {
|
||||
posX = itemPos.xCoord;
|
||||
posZ += (itemPos.zCoord > posZ + 0.15 ? 0.3125 : itemPos.zCoord < posZ - 0.15 ? -0.3125 : 0);
|
||||
}
|
||||
if(dir.offsetZ != 0) {
|
||||
posZ = itemPos.zCoord;
|
||||
posX += (itemPos.xCoord > posX + 0.15 ? 0.3125 : itemPos.xCoord < posX - 0.15 ? -0.3125 : 0);
|
||||
}
|
||||
|
||||
return Vec3.createVectorHelper(posX, y + 0.25, posZ);
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,12 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.blocks.IBlockSideRotation;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.test.TestConductor;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -17,7 +21,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class BlockCraneBase extends BlockContainer {
|
||||
public abstract class BlockCraneBase extends BlockContainer implements IBlockSideRotation {
|
||||
|
||||
@SideOnly(Side.CLIENT) protected IIcon iconSide;
|
||||
@SideOnly(Side.CLIENT) protected IIcon iconIn;
|
||||
@ -91,4 +95,11 @@ public abstract class BlockCraneBase extends BlockContainer {
|
||||
|
||||
return this.iconSide;
|
||||
}
|
||||
|
||||
public static int renderIDClassic = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return IBlockSideRotation.getRenderType();
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CraneExtractor extends BlockCraneBase {
|
||||
@ -29,4 +30,18 @@ public class CraneExtractor extends BlockCraneBase {
|
||||
this.iconDirectionalUp = iconRegister.registerIcon(RefStrings.MODID + ":crane_out_side_down");
|
||||
this.iconDirectionalDown = iconRegister.registerIcon(RefStrings.MODID + ":crane_out_side_up");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRotationFromSide(IBlockAccess world, int x, int y, int z, int side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(meta > 1 && side == 1) {
|
||||
if(meta == 2) return 0;
|
||||
if(meta == 3) return 3;
|
||||
if(meta == 4) return 2;
|
||||
if(meta == 5) return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@ -162,4 +163,18 @@ public class CraneInserter extends BlockCraneBase implements IEnterableBlock {
|
||||
|
||||
return toAdd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRotationFromSide(IBlockAccess world, int x, int y, int z, int side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(meta > 1 && side == 1) {
|
||||
if(meta == 2) return 3;
|
||||
if(meta == 3) return 0;
|
||||
if(meta == 4) return 1;
|
||||
if(meta == 5) return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,10 +116,10 @@ public class EntityMovingItem extends Entity implements IConveyorItem {
|
||||
|
||||
if(!(b instanceof IConveyorBelt)) {
|
||||
this.setDead();
|
||||
EntityItem item = new EntityItem(worldObj, posX, posY, posZ, this.getItemStack());
|
||||
item.motionX = this.motionX * 3;
|
||||
EntityItem item = new EntityItem(worldObj, posX + motionX * 2, posY + motionY * 2, posZ + motionZ * 2, this.getItemStack());
|
||||
item.motionX = this.motionX * 2;
|
||||
item.motionY = 0.1;
|
||||
item.motionZ = this.motionZ * 3;
|
||||
item.motionZ = this.motionZ * 2;
|
||||
item.velocityChanged = true;
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
return;
|
||||
|
||||
@ -1951,6 +1951,8 @@ public class ModItems {
|
||||
public static Item upgrade_screm;
|
||||
public static Item upgrade_gc_speed;
|
||||
public static Item upgrade_5g;
|
||||
public static Item upgrade_stack;
|
||||
public static Item upgrade_ejector;
|
||||
|
||||
public static Item ingot_euphemium;
|
||||
public static Item nugget_euphemium;
|
||||
@ -4697,6 +4699,8 @@ public class ModItems {
|
||||
upgrade_screm = new ItemMachineUpgrade().setUnlocalizedName("upgrade_screm").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_screm");
|
||||
upgrade_gc_speed = new ItemMachineUpgrade().setUnlocalizedName("upgrade_gc_speed").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_gc_speed");
|
||||
upgrade_5g = new ItemMachineUpgrade().setUnlocalizedName("upgrade_5g").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_5g");
|
||||
upgrade_stack = new ItemMetaUpgrade(3).setUnlocalizedName("upgrade_stack").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_stack");
|
||||
upgrade_ejector = new ItemMetaUpgrade(3).setUnlocalizedName("upgrade_ejector").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":upgrade_ejector");
|
||||
|
||||
wand = new ItemWand().setUnlocalizedName("wand_k").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setFull3D().setTextureName(RefStrings.MODID + ":wand");
|
||||
wand_s = new ItemWandS().setUnlocalizedName("wand_s").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setFull3D().setTextureName(RefStrings.MODID + ":wand_s");
|
||||
@ -6631,6 +6635,8 @@ public class ModItems {
|
||||
GameRegistry.registerItem(upgrade_screm, upgrade_screm.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_gc_speed, upgrade_gc_speed.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_5g, upgrade_5g.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_stack, upgrade_stack.getUnlocalizedName());
|
||||
GameRegistry.registerItem(upgrade_ejector, upgrade_ejector.getUnlocalizedName());
|
||||
|
||||
//Machine Templates
|
||||
GameRegistry.registerItem(siren_track, siren_track.getUnlocalizedName());
|
||||
|
||||
37
src/main/java/com/hbm/items/machine/ItemMetaUpgrade.java
Normal file
37
src/main/java/com/hbm/items/machine/ItemMetaUpgrade.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemMetaUpgrade extends ItemMachineUpgrade {
|
||||
|
||||
protected int levels;
|
||||
|
||||
public ItemMetaUpgrade(int levels) {
|
||||
super();
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
this.levels = levels;
|
||||
}
|
||||
|
||||
public ItemMetaUpgrade(UpgradeType type, int levels) {
|
||||
super(type);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
this.levels = levels;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list) {
|
||||
|
||||
for(int i = 0; i < this.levels; i++) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -685,6 +685,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderAntennaTop());
|
||||
RenderingRegistry.registerBlockHandler(new RenderConserve());
|
||||
RenderingRegistry.registerBlockHandler(new RenderConveyor());
|
||||
RenderingRegistry.registerBlockHandler(new RenderConveyorChute());
|
||||
RenderingRegistry.registerBlockHandler(new RenderRTGBlock());
|
||||
RenderingRegistry.registerBlockHandler(new RenderSpikeBlock());
|
||||
RenderingRegistry.registerBlockHandler(new RenderChain());
|
||||
@ -700,6 +701,7 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockCT());
|
||||
RenderingRegistry.registerBlockHandler(new RenderDetCord());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockMultipass());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockSideRotation());
|
||||
RenderingRegistry.registerBlockHandler(new RenderDiode());
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockRotated(ModBlocks.charge_dynamite.getRenderType(), ResourceManager.charge_dynamite));
|
||||
|
||||
@ -1072,13 +1072,19 @@ public class MainRegistry {
|
||||
private static HashSet<String> ignoreMappings = new HashSet();
|
||||
private static HashMap<String, Item> remapItems = new HashMap();
|
||||
|
||||
static {
|
||||
|
||||
@EventHandler
|
||||
public void handleMissingMappings(FMLMissingMappingsEvent event) {
|
||||
|
||||
ignoreMappings.clear();
|
||||
remapItems.clear();
|
||||
|
||||
/// IGNORE ///
|
||||
for(int i = 1; i <= 8; i++) ignoreMappings.add("hbm:item.gasflame" + i);
|
||||
ignoreMappings.add("hbm:item.cyclotron_tower");
|
||||
ignoreMappings.add("hbm:item.magnet_dee");
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.centrifuge_tower", Item.getItemFromBlock(ModBlocks.machine_centrifuge));
|
||||
/*remapItems.put("hbm:item.centrifuge_tower", Item.getItemFromBlock(ModBlocks.machine_centrifuge));
|
||||
remapItems.put("hbm:item.gun_revolver_nopip_ammo", ModItems.ammo_44);
|
||||
remapItems.put("hbm:item.gun_revolver_pip_ammo", ModItems.ammo_44_pip);
|
||||
remapItems.put("hbm:item.gun_calamity_ammo", ModItems.ammo_50bmg);
|
||||
@ -1091,15 +1097,25 @@ public class MainRegistry {
|
||||
remapItems.put("hbm:item.gun_bolt_action_ammo", ModItems.ammo_20gauge_slug);
|
||||
remapItems.put("hbm:item.gun_fatman_ammo", ModItems.ammo_nuke_high);
|
||||
remapItems.put("hbm:item.gun_mirv_ammo", ModItems.ammo_mirv_high);
|
||||
remapItems.put("hbm:item.gun_stinger_ammo", ModItems.ammo_stinger_rocket);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void handleMissingMappings(FMLMissingMappingsEvent event) {
|
||||
remapItems.put("hbm:item.gun_stinger_ammo", ModItems.ammo_stinger_rocket);*/
|
||||
|
||||
ignoreMappings.add("hbm:item.centrifuge_tower");
|
||||
ignoreMappings.add("hbm:item.gun_revolver_nopip_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_revolver_pip_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_calamity_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_lacunae_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_rpg_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_mp40_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_uzi_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_uboinik_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_lever_action_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_bolt_action_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_fatman_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_mirv_ammo");
|
||||
ignoreMappings.add("hbm:item.gun_stinger_ammo");
|
||||
|
||||
for(MissingMapping mapping : event.get()) {
|
||||
|
||||
|
||||
if(ignoreMappings.contains(mapping.name)) {
|
||||
mapping.ignore();
|
||||
continue;
|
||||
@ -1107,7 +1123,7 @@ public class MainRegistry {
|
||||
|
||||
if(mapping.type == GameRegistry.Type.ITEM) {
|
||||
|
||||
if(remapItems.containsKey(mapping.name)) {
|
||||
if(remapItems.get(mapping.name) != null) {
|
||||
mapping.remap(remapItems.get(mapping.name));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -60,7 +60,6 @@ import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||
|
||||
import api.hbm.energy.IEnergyConductor;
|
||||
import api.hbm.item.IButtonReceiver;
|
||||
import api.hbm.item.IClickReceiver;
|
||||
|
||||
@ -111,7 +110,6 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.client.event.sound.PlaySoundEvent17;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class ModEventHandlerClient {
|
||||
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.IBlockSideRotation;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderBlockSideRotation implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
block.setBlockBoundsForItemRender();
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
|
||||
if(!(block instanceof IBlockSideRotation)) {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
IBlockSideRotation rot = (IBlockSideRotation) block;
|
||||
|
||||
renderer.uvRotateTop = rot.getRotationFromSide(world, x, y, z, 1);
|
||||
|
||||
renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
renderer.uvRotateTop = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return IBlockSideRotation.getRenderType();
|
||||
}
|
||||
}
|
||||
231
src/main/java/com/hbm/render/block/RenderConveyorChute.java
Normal file
231
src/main/java/com/hbm/render/block/RenderConveyorChute.java
Normal file
@ -0,0 +1,231 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.network.BlockConveyorChute;
|
||||
|
||||
import api.hbm.conveyor.IConveyorBelt;
|
||||
import api.hbm.conveyor.IEnterableBlock;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderConveyorChute implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, RenderBlocks renderer) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
|
||||
meta = 2;
|
||||
|
||||
if(meta == 2) {
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateWest = 3;
|
||||
}
|
||||
if(meta == 3) {
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
}
|
||||
if(meta == 4) {
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateSouth = 3;
|
||||
}
|
||||
if(meta == 5) {
|
||||
renderer.uvRotateTop = 2;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateNorth = 3;
|
||||
}
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
renderer.setRenderBounds(0.25D, 0.0D, 0D, 0.75D, 0.25D, 1D); standardBundle(tessellator, block, meta, renderer);
|
||||
renderer.setRenderBounds(0.0D, 0.0D, 0.25D, 0.25D, 0.25D, 0.75D); standardBundle(tessellator, block, meta, renderer);
|
||||
renderer.setRenderBounds(0.75D, 0.0D, 0.25D, 1.0D, 0.25D, 0.75D); standardBundle(tessellator, block, meta, renderer);
|
||||
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateEast = 0;
|
||||
renderer.uvRotateWest = 0;
|
||||
|
||||
double minOuter = 0.0;
|
||||
double maxOuter = 1.0;
|
||||
double minInner = 0.25;
|
||||
double maxInner = 0.75;
|
||||
double glassMin = 0.1875;
|
||||
double glassMax = 0.8175;
|
||||
|
||||
renderer.setRenderBounds(minOuter, 0.0, minOuter, minInner, 1.0, minInner); standardBundle(tessellator, ModBlocks.concrete_smooth, 0, renderer);
|
||||
renderer.setRenderBounds(maxInner, 0.0, minOuter, maxOuter, 1.0, minInner); standardBundle(tessellator, ModBlocks.concrete_smooth, 0, renderer);
|
||||
renderer.setRenderBounds(minOuter, 0.0, maxInner, minInner, 1.0, maxOuter); standardBundle(tessellator, ModBlocks.concrete_smooth, 0, renderer);
|
||||
renderer.setRenderBounds(maxInner, 0.0, maxInner, maxOuter, 1.0, maxOuter); standardBundle(tessellator, ModBlocks.concrete_smooth, 0, renderer);
|
||||
|
||||
IIcon iconGlass = ModBlocks.steel_grate.getIcon(0, 0);
|
||||
renderer.setOverrideBlockTexture(iconGlass);
|
||||
|
||||
renderer.setRenderBounds(glassMin, 0.25, minInner, glassMin, 1.0, maxInner); standardBundle(tessellator, ModBlocks.steel_grate, 2, renderer);
|
||||
renderer.setRenderBounds(glassMax, 0.25, minInner, glassMax, 1.0, maxInner); standardBundle(tessellator, ModBlocks.steel_grate, 2, renderer);
|
||||
renderer.setRenderBounds(minInner, 0.25, glassMin, maxInner, 1.0, glassMin); standardBundle(tessellator, ModBlocks.steel_grate, 2, renderer);
|
||||
renderer.setRenderBounds(minInner, 0.25, glassMax, maxInner, 1.0, glassMax); standardBundle(tessellator, ModBlocks.steel_grate, 2, renderer);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
renderer.clearOverrideBlockTexture();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
private void standardBundle(Tessellator tessellator, Block block, int meta, RenderBlocks renderer) {
|
||||
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
boolean belt = false;
|
||||
|
||||
boolean nX = world.getBlock(x - 1, y, z) instanceof IConveyorBelt;
|
||||
boolean pX = world.getBlock(x + 1, y, z) instanceof IConveyorBelt;
|
||||
boolean nZ = world.getBlock(x, y, z - 1) instanceof IConveyorBelt;
|
||||
boolean pZ = world.getBlock(x, y, z + 1) instanceof IConveyorBelt;
|
||||
|
||||
|
||||
if(y > 0) {
|
||||
Block below = world.getBlock(x, y - 1, z);
|
||||
if(!(below instanceof IConveyorBelt || below instanceof IEnterableBlock)) {
|
||||
|
||||
if(meta == 2) {
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateWest = 3;
|
||||
}
|
||||
if(meta == 3) {
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 3;
|
||||
renderer.uvRotateEast = 3;
|
||||
}
|
||||
if(meta == 4) {
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.uvRotateBottom = 1;
|
||||
renderer.uvRotateSouth = 3;
|
||||
}
|
||||
if(meta == 5) {
|
||||
renderer.uvRotateTop = 2;
|
||||
renderer.uvRotateBottom = 2;
|
||||
renderer.uvRotateNorth = 3;
|
||||
}
|
||||
|
||||
renderer.setRenderBounds(0.25D, 0.0D, 0D, 0.75D, 0.25D, 1D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.0D, 0.0D, 0.25D, 0.25D, 0.25D, 0.75D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(0.75D, 0.0D, 0.25D, 1.0D, 0.25D, 0.75D); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.uvRotateBottom = 0;
|
||||
renderer.uvRotateNorth = 0;
|
||||
renderer.uvRotateSouth = 0;
|
||||
renderer.uvRotateEast = 0;
|
||||
renderer.uvRotateWest = 0;
|
||||
|
||||
belt = true;
|
||||
} else {
|
||||
|
||||
if(nX) {
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.setRenderBounds(0.0D, 0.0D, 0.25D, 0.125D, 0.25D, 0.75D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
if(pX) {
|
||||
renderer.uvRotateTop = 2;
|
||||
renderer.setRenderBounds(0.875D, 0.0D, 0.25D, 1.0D, 0.25D, 0.75D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
if(nZ) {
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.setRenderBounds(0.25D, 0.0D, 0.0D, 0.75D, 0.25D, 0.125D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
if(pZ) {
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.setRenderBounds(0.25D, 0.0D, 0.875D, 0.75D, 0.25D, 1.0D); renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
renderer.uvRotateTop = 0;
|
||||
}
|
||||
}
|
||||
|
||||
IIcon iconSteel = ModBlocks.concrete_smooth.getIcon(0, 0);
|
||||
IIcon iconGlass = ModBlocks.steel_grate.getIcon(0, 0);
|
||||
renderer.setOverrideBlockTexture(iconSteel);
|
||||
|
||||
double minOuter = 0.0;
|
||||
double maxOuter = 1.0;
|
||||
double minInner = 0.25;
|
||||
double maxInner = 0.75;
|
||||
|
||||
renderer.setRenderBounds(minOuter, 0.0, minOuter, minInner, 1.0, minInner); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(maxInner, 0.0, minOuter, maxOuter, 1.0, minInner); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(minOuter, 0.0, maxInner, minInner, 1.0, maxOuter); renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.setRenderBounds(maxInner, 0.0, maxInner, maxOuter, 1.0, maxOuter); renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
double glassMin = 0.1875;
|
||||
double glassMax = 0.8175;
|
||||
|
||||
renderer.setOverrideBlockTexture(iconGlass);
|
||||
if(!nX && (!belt || meta != 5)) { renderer.setRenderBounds(glassMin, belt ? 0.25 : 0.0, minInner, glassMin, 1.0, maxInner); renderer.renderStandardBlock(block, x, y, z); }
|
||||
if(!pX && (!belt || meta != 4)) { renderer.setRenderBounds(glassMax, belt ? 0.25 : 0.0, minInner, glassMax, 1.0, maxInner); renderer.renderStandardBlock(block, x, y, z); }
|
||||
if(!nZ && (!belt || meta != 3)) { renderer.setRenderBounds(minInner, belt ? 0.25 : 0.0, glassMin, maxInner, 1.0, glassMin); renderer.renderStandardBlock(block, x, y, z); }
|
||||
if(!pZ && (!belt || meta != 2)) { renderer.setRenderBounds(minInner, belt ? 0.25 : 0.0, glassMax, maxInner, 1.0, glassMax); renderer.renderStandardBlock(block, x, y, z); }
|
||||
|
||||
renderer.clearOverrideBlockTexture();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockConveyorChute.renderID;
|
||||
}
|
||||
}
|
||||
@ -45,7 +45,7 @@ public class TileEntityCraneExtractor extends TileEntityMachineBase implements I
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
int amount = 64;
|
||||
int amount = 1;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
TileEntity te = worldObj.getTileEntity(xCoord - dir.offsetX, yCoord - dir.offsetY, zCoord - dir.offsetZ);
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
{
|
||||
"animation": { }
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 286 B |
@ -0,0 +1,3 @@
|
||||
{
|
||||
"animation": { }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user