radbox gui, radrec block, new consumables, broadcast save structure
@ -360,6 +360,9 @@ container.reactorSmall=Atomreaktor
|
||||
|
||||
tile.broadcaster_pc.name=Korrupter Sender
|
||||
|
||||
tile.radiobox.name=RTG-Betriebener Hochleistungs-UKW-Sender
|
||||
tile.radiorec.name=UKW Radio
|
||||
|
||||
tile.red_pylon.name=Strommasten
|
||||
item.wiring_red_copper.name=Kabeltrommel
|
||||
|
||||
@ -1217,6 +1220,9 @@ item.syringe_metal_empty.name=Metallspritze
|
||||
item.syringe_metal_stimpak.name=Stimpak
|
||||
item.syringe_metal_medx.name=Med-X
|
||||
item.syringe_metal_psycho.name=Psycho
|
||||
item.syringe_metal_super.name=Super Stimpak
|
||||
item.med_bag.name=Ärztetasche
|
||||
item.radaway.name=Radaway
|
||||
item.pill_iodine.name=Iodpille
|
||||
item.plan_c.name=Plan C
|
||||
item.med_ipecac.name=Ipecac-Sirup
|
||||
|
||||
@ -360,6 +360,9 @@ container.reactorSmall=Nuclear Reactor
|
||||
|
||||
tile.broadcaster_pc.name=Corrupted Broadcaster
|
||||
|
||||
tile.radiobox.name=RTG-Powered High-Gain FM Transmitter
|
||||
tile.radiorec.name=FM Radio
|
||||
|
||||
tile.red_pylon.name=Electricity Pole
|
||||
item.wiring_red_copper.name=Cable Drum
|
||||
|
||||
@ -1082,7 +1085,7 @@ tile.frozen_planks.name=Frozen Planks
|
||||
tile.tape_recorder.name=Tape Recorder
|
||||
tile.steel_poles.name=Steel Pole
|
||||
tile.pole_top.name=Antenna Top
|
||||
tile.pole_satellite_receiver.name=Satellite Receiver
|
||||
tile.pole_satellite_receiver.name=Satellite Dish
|
||||
tile.steel_wall.name=Steel Wall
|
||||
tile.steel_corner.name=Steel Wall Corner
|
||||
tile.steel_roof.name=Flat Steel Roof
|
||||
@ -1217,6 +1220,9 @@ item.syringe_metal_empty.name=Metal Syringe
|
||||
item.syringe_metal_stimpak.name=Stimpak
|
||||
item.syringe_metal_medx.name=Med-X
|
||||
item.syringe_metal_psycho.name=Psycho
|
||||
item.syringe_metal_super.name=Super Stimpak
|
||||
item.med_bag.name=Doctor's Bag
|
||||
item.radaway.name=Radaway
|
||||
item.pill_iodine.name=Iodine Pill
|
||||
item.plan_c.name=Plan C
|
||||
item.med_ipecac.name=Ipecac Syrup
|
||||
|
||||
BIN
assets/hbm/textures/blocks/radiobox.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
assets/hbm/textures/blocks/radiorec.png
Normal file
|
After Width: | Height: | Size: 396 B |
BIN
assets/hbm/textures/gui/gui_radiobox.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/hbm/textures/items/med_bag.png
Normal file
|
After Width: | Height: | Size: 374 B |
BIN
assets/hbm/textures/items/radaway.png
Normal file
|
After Width: | Height: | Size: 338 B |
BIN
assets/hbm/textures/items/syringe_metal_super.png
Normal file
|
After Width: | Height: | Size: 406 B |
BIN
assets/hbm/textures/models/ModelRadioReceiver.png
Normal file
|
After Width: | Height: | Size: 898 B |
@ -457,6 +457,12 @@ public class ModBlocks {
|
||||
public static Block machine_spp_bottom;
|
||||
public static Block machine_spp_top;
|
||||
|
||||
public static Block radiobox;
|
||||
public static final int guiID_radiobox = 66;
|
||||
|
||||
public static Block radiorec;
|
||||
public static final int guiID_radiorec = 67;
|
||||
|
||||
public static Block turret_light;
|
||||
public static Block turret_heavy;
|
||||
public static Block turret_rocket;
|
||||
@ -881,6 +887,9 @@ public class ModBlocks {
|
||||
|
||||
machine_spp_bottom = new SPPBottom(Material.iron).setBlockName("machine_spp_bottom").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_spp_top = new SPPTop(Material.iron).setBlockName("machine_spp_top").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
radiobox = new Radiobox(Material.iron).setBlockName("radiobox").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":radiobox");
|
||||
radiorec = new RadioRec(Material.iron).setBlockName("radiorec").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":radiorec");
|
||||
|
||||
cheater_virus = new CheaterVirus(Material.iron).setBlockName("cheater_virus").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":cheater_virus");
|
||||
cheater_virus_seed = new CheaterVirusSeed(Material.iron).setBlockName("cheater_virus_seed").setHardness(Float.POSITIVE_INFINITY).setResistance(Float.POSITIVE_INFINITY).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":cheater_virus_seed");
|
||||
@ -1217,6 +1226,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_combine_factory, machine_combine_factory.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_satlinker, machine_satlinker.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(radiorec, radiorec.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(radiobox, radiobox.getUnlocalizedName());
|
||||
|
||||
//ReiX Machines
|
||||
//GameRegistry.registerBlock(machine_reix_mainframe, machine_reix_mainframe.getUnlocalizedName());
|
||||
|
||||
113
com/hbm/blocks/machine/RadioRec.java
Normal file
@ -0,0 +1,113 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityRadioRec;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RadioRec extends BlockContainer {
|
||||
|
||||
public RadioRec(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityRadioRec();
|
||||
}
|
||||
|
||||
@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(4*f, 0.0F, 1*f, 12*f, 10*f, 15*f);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(1*f, 0.0F, 4*f, 15*f, 10*f, 12*f);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(4*f, 0.0F, 1*f, 12*f, 10*f, 15*f);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(1*f, 0.0F, 4*f, 15*f, 10*f, 12*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(4*f, 0.0F, 1*f, 12*f, 10*f, 15*f);
|
||||
break;
|
||||
case 2:
|
||||
this.setBlockBounds(1*f, 0.0F, 4*f, 15*f, 10*f, 12*f);
|
||||
break;
|
||||
case 5:
|
||||
this.setBlockBounds(4*f, 0.0F, 1*f, 12*f, 10*f, 15*f);
|
||||
break;
|
||||
case 3:
|
||||
this.setBlockBounds(1*f, 0.0F, 4*f, 15*f, 10*f, 12*f);
|
||||
break;
|
||||
}
|
||||
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
}
|
||||
155
com/hbm/blocks/machine/Radiobox.java
Normal file
@ -0,0 +1,155 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDiFurnace;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.TileEntityRadiobox;
|
||||
|
||||
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.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class Radiobox extends BlockContainer {
|
||||
|
||||
public Radiobox(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int i) {
|
||||
return new TileEntityRadiobox();
|
||||
}
|
||||
|
||||
@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, 2, 2);
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
if(i == 2)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
if(i == 3)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
|
||||
if(itemStack.hasDisplayName())
|
||||
{
|
||||
((TileEntityDiFurnace)world.getTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
@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())
|
||||
{
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(meta <= 5) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta + 4, 2);
|
||||
world.playSoundEffect(x, y, z, "hbm:block.reactorStart", 1.0F, 1.0F);
|
||||
} else {
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta - 4, 2);
|
||||
world.playSoundEffect(x, y, z, "hbm:block.reactorStart", 1.0F, 0.85F);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_radiobox, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@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:
|
||||
case 8:
|
||||
this.setBlockBounds(11*f, 1*f, 4*f, 16*f, 15*f, 12*f);
|
||||
break;
|
||||
case 2:
|
||||
case 6:
|
||||
this.setBlockBounds(4*f, 1*f, 11*f, 12*f, 15*f, 16*f);
|
||||
break;
|
||||
case 5:
|
||||
case 9:
|
||||
this.setBlockBounds(0*f, 1*f, 4*f, 5*f, 15*f, 12*f);
|
||||
break;
|
||||
case 3:
|
||||
case 7:
|
||||
this.setBlockBounds(4*f, 1*f, 0*f, 12*f, 15*f, 5*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:
|
||||
case 8:
|
||||
this.setBlockBounds(11*f, 1*f, 4*f, 16*f, 15*f, 12*f);
|
||||
break;
|
||||
case 2:
|
||||
case 6:
|
||||
this.setBlockBounds(4*f, 1*f, 11*f, 12*f, 15*f, 16*f);
|
||||
break;
|
||||
case 5:
|
||||
case 9:
|
||||
this.setBlockBounds(0*f, 1*f, 4*f, 5*f, 15*f, 12*f);
|
||||
break;
|
||||
case 3:
|
||||
case 7:
|
||||
this.setBlockBounds(4*f, 1*f, 0*f, 12*f, 15*f, 5*f);
|
||||
break;
|
||||
}
|
||||
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,18 +1,22 @@
|
||||
package com.hbm.entity.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.explosion.NukeEnvironmentalEffect;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityFalloutRain extends Entity {
|
||||
|
||||
public int maxAge = 1000;
|
||||
public int age;
|
||||
public float scale = 0;
|
||||
|
||||
public EntityFalloutRain(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
@ -20,7 +24,6 @@ public class EntityFalloutRain extends Entity {
|
||||
this.ignoreFrustumCheck = true;
|
||||
this.isImmuneToFire = true;
|
||||
this.age = 0;
|
||||
scale = 0;
|
||||
}
|
||||
|
||||
public EntityFalloutRain(World p_i1582_1_, int maxAge) {
|
||||
@ -64,6 +67,18 @@ public class EntityFalloutRain extends Entity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<Object> list = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(posX - getScale(), 0, posZ - getScale(), posX + getScale(), 256, posZ + getScale()));
|
||||
|
||||
for(Object o : list) {
|
||||
if(o instanceof EntityLivingBase) {
|
||||
EntityLivingBase entity = (EntityLivingBase) o;
|
||||
|
||||
if(Math.sqrt(Math.pow(entity.posX - posX, 2) + Math.pow(entity.posZ - posZ, 2)) <= getScale()) {
|
||||
Library.applyRadiation(entity, 30, 9, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.age >= this.maxAge)
|
||||
|
||||
@ -65,6 +65,7 @@ import com.hbm.tileentity.machine.TileEntityMachineTeleporter;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
||||
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
||||
import com.hbm.tileentity.machine.TileEntityRadiobox;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorMultiblock;
|
||||
import com.hbm.tileentity.machine.TileEntityReiXMainframe;
|
||||
import com.hbm.tileentity.machine.TileEntityRtgFurnace;
|
||||
@ -658,6 +659,15 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_radiobox:
|
||||
{
|
||||
if(entity instanceof TileEntityRadiobox)
|
||||
{
|
||||
return new ContainerRadiobox(player.inventory, (TileEntityRadiobox) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -1244,6 +1254,15 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_radiobox:
|
||||
{
|
||||
if(entity instanceof TileEntityRadiobox)
|
||||
{
|
||||
return new GUIRadiobox(player.inventory, (TileEntityRadiobox) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//CLIENTONLY GUIS
|
||||
|
||||
22
com/hbm/inventory/container/ContainerRadiobox.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityRadiobox;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerRadiobox extends Container {
|
||||
|
||||
private TileEntityRadiobox radio;
|
||||
|
||||
public ContainerRadiobox(InventoryPlayer invPlayer, TileEntityRadiobox tedf) { }
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
289
com/hbm/inventory/gui/GUIRadiobox.java
Normal file
@ -0,0 +1,289 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.inventory.container.ContainerMachineReactorSmall;
|
||||
import com.hbm.inventory.container.ContainerRadiobox;
|
||||
import com.hbm.inventory.gui.GUIScreenTemplateFolder.FolderButton;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemCassette;
|
||||
import com.hbm.items.tool.ItemFluidIdentifier;
|
||||
import com.hbm.items.tool.ItemCassette.TrackType;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
import com.hbm.packet.ItemFolderPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
|
||||
import com.hbm.tileentity.machine.TileEntityRadiobox;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.client.C17PacketCustomPayload;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIRadiobox extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_radiobox.png");
|
||||
private TileEntityRadiobox diFurnace;
|
||||
|
||||
private int type;
|
||||
private int music;
|
||||
|
||||
private GuiTextField freqField;
|
||||
private GuiTextField messageField;
|
||||
|
||||
List<RadioButton> buttons = new ArrayList<RadioButton>();
|
||||
|
||||
|
||||
public GUIRadiobox(InventoryPlayer invPlayer, TileEntityRadiobox tedf) {
|
||||
super(new ContainerRadiobox(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 90;
|
||||
|
||||
this.type = diFurnace.type;
|
||||
this.music = diFurnace.music;
|
||||
}
|
||||
|
||||
public void initGui() {
|
||||
|
||||
super.initGui();
|
||||
|
||||
buttons.add(new RadioButton(guiLeft + 25, guiTop + 16, 0, "Save"));
|
||||
buttons.add(new RadioButton(guiLeft + 61, guiTop + 16, 1, "Cycle"));
|
||||
buttons.add(new RadioButton(guiLeft + 25, guiTop + 52, 2, "1"));
|
||||
buttons.add(new RadioButton(guiLeft + 61, guiTop + 52, 3, "2"));
|
||||
buttons.add(new RadioButton(guiLeft + 97, guiTop + 52, 4, "3"));
|
||||
buttons.add(new RadioButton(guiLeft + 133, guiTop + 52, 5, "4"));
|
||||
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.freqField = new GuiTextField(this.fontRendererObj, guiLeft + 100, guiTop + 21, 48, 12);
|
||||
this.freqField.setTextColor(-1);
|
||||
this.freqField.setDisabledTextColour(-1);
|
||||
this.freqField.setEnableBackgroundDrawing(false);
|
||||
this.freqField.setMaxStringLength(5);
|
||||
this.freqField.setText(String.valueOf(diFurnace.freq));
|
||||
|
||||
this.messageField = new GuiTextField(this.fontRendererObj, guiLeft + 28, guiTop + 57, 120, 12);
|
||||
this.messageField.setTextColor(-1);
|
||||
this.messageField.setDisabledTextColour(-1);
|
||||
this.messageField.setEnableBackgroundDrawing(false);
|
||||
this.messageField.setMaxStringLength(20);
|
||||
if(diFurnace.message != null)
|
||||
this.messageField.setText(diFurnace.message);
|
||||
|
||||
if(diFurnace.freq == 0) {
|
||||
double d = 100 + diFurnace.getWorldObj().rand.nextInt(900);
|
||||
d += (diFurnace.getWorldObj().rand.nextInt(10) * 0.1D);
|
||||
this.freqField.setText(String.valueOf(d));
|
||||
}
|
||||
|
||||
rectify();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int i, int j, float f) {
|
||||
super.drawScreen(i, j, f);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
this.freqField.drawTextBox();
|
||||
this.messageField.drawTextBox();
|
||||
|
||||
for(RadioButton b : buttons)
|
||||
if(b.isMouseOnButton(i, j))
|
||||
b.drawString(i, j);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = I18n.format("container.radiobox");
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(freqField.isFocused())
|
||||
drawTexturedModalRect(guiLeft + 97, guiTop + 16, 0, 184 + 18, 54, 18);
|
||||
else
|
||||
drawTexturedModalRect(guiLeft + 97, guiTop + 16, 0, 184, 54, 18);
|
||||
|
||||
if(messageField.getVisible()) {
|
||||
if(messageField.isFocused())
|
||||
drawTexturedModalRect(guiLeft + 25, guiTop + 52, 0, 220 + 18, 126, 18);
|
||||
else
|
||||
drawTexturedModalRect(guiLeft + 25, guiTop + 52, 0, 220, 126, 18);
|
||||
}
|
||||
|
||||
//if(type == 2)
|
||||
for(RadioButton b : buttons)
|
||||
b.drawButton();
|
||||
}
|
||||
|
||||
public void updateScreen() {
|
||||
|
||||
if(type == 2 && messageField.getVisible())
|
||||
messageField.setVisible(false);
|
||||
|
||||
if(type != 2 && !messageField.getVisible())
|
||||
messageField.setVisible(true);
|
||||
}
|
||||
|
||||
protected void keyTyped(char p_73869_1_, int p_73869_2_)
|
||||
{
|
||||
if (this.freqField.textboxKeyTyped(p_73869_1_, p_73869_2_)) { }
|
||||
else if(this.messageField.textboxKeyTyped(p_73869_1_, p_73869_2_)) { }
|
||||
else {
|
||||
super.keyTyped(p_73869_1_, p_73869_2_);
|
||||
}
|
||||
}
|
||||
|
||||
protected void rectify() {
|
||||
String s = freqField.getText();
|
||||
|
||||
if(NumberUtils.isNumber(s)) {
|
||||
double d = Double.parseDouble(s);
|
||||
d = Math.max(100, Math.min(999.9, d));
|
||||
d = truncateDecimal(d, 1).doubleValue();
|
||||
s = String.valueOf(d);
|
||||
} else {
|
||||
s = "100.0";
|
||||
}
|
||||
|
||||
freqField.setText(s);
|
||||
}
|
||||
|
||||
private BigDecimal truncateDecimal(double x, int numberofDecimals)
|
||||
{
|
||||
if (x > 0) {
|
||||
return new BigDecimal(String.valueOf(x)).setScale(numberofDecimals, BigDecimal.ROUND_FLOOR);
|
||||
} else {
|
||||
return new BigDecimal(String.valueOf(x)).setScale(numberofDecimals, BigDecimal.ROUND_CEILING);
|
||||
}
|
||||
}
|
||||
|
||||
protected void mouseClicked(int i, int j, int k)
|
||||
{
|
||||
super.mouseClicked(i, j, k);
|
||||
this.freqField.mouseClicked(i, j, k);
|
||||
this.messageField.mouseClicked(i, j, k);
|
||||
|
||||
//if(type == 2)
|
||||
for(RadioButton b : buttons)
|
||||
if(b.isMouseOnButton(i, j))
|
||||
b.executeAction();
|
||||
}
|
||||
|
||||
protected void cycleType() {
|
||||
this.type++;
|
||||
if(type >= 3)
|
||||
type -=3;
|
||||
}
|
||||
|
||||
|
||||
class RadioButton {
|
||||
|
||||
int xPos;
|
||||
int yPos;
|
||||
int buttonType;
|
||||
String info;
|
||||
|
||||
//0: save
|
||||
//1: type
|
||||
//2: music 1
|
||||
//3: music 2
|
||||
//4: music 3
|
||||
//5: music 4
|
||||
|
||||
public RadioButton(int x, int y, int t, String i) {
|
||||
xPos = x;
|
||||
yPos = y;
|
||||
buttonType = t;
|
||||
info = i;
|
||||
}
|
||||
|
||||
public boolean isMouseOnButton(int mouseX, int mouseY) {
|
||||
return xPos <= mouseX && xPos + 18 > mouseX && yPos < mouseY && yPos + 18 >= mouseY;
|
||||
}
|
||||
|
||||
public void drawButton() {
|
||||
|
||||
if(buttonType > 1 && type != 2)
|
||||
return;
|
||||
|
||||
switch(buttonType) {
|
||||
case 0:
|
||||
drawTexturedModalRect(xPos, yPos, 176 + 18 * 0, 18 * 0, 18, 18); break;
|
||||
case 1:
|
||||
drawTexturedModalRect(xPos, yPos, 176 + 18 * (type + 1), 18 * 0, 18, 18); break;
|
||||
case 2:
|
||||
drawTexturedModalRect(xPos, yPos, 176 + 18 * 0, 18 * (music == 0 ? 2 : 1), 18, 18); break;
|
||||
case 3:
|
||||
drawTexturedModalRect(xPos, yPos, 176 + 18 * 1, 18 * (music == 1 ? 2 : 1), 18, 18); break;
|
||||
case 4:
|
||||
drawTexturedModalRect(xPos, yPos, 176 + 18 * 2, 18 * (music == 2 ? 2 : 1), 18, 18); break;
|
||||
case 5:
|
||||
drawTexturedModalRect(xPos, yPos, 176 + 18 * 3, 18 * (music == 3 ? 2 : 1), 18, 18); break;
|
||||
}
|
||||
}
|
||||
|
||||
public void drawString(int x, int y) {
|
||||
if(info == null || info.isEmpty())
|
||||
return;
|
||||
|
||||
if(buttonType > 1 && type != 2)
|
||||
return;
|
||||
|
||||
String s = info;
|
||||
|
||||
if(buttonType == 1) {
|
||||
switch(type) {
|
||||
case 0: s = "Morse"; break;
|
||||
case 1: s = "Vocals"; break;
|
||||
case 2: s = "Recordings"; break;
|
||||
}
|
||||
}
|
||||
|
||||
func_146283_a(Arrays.asList(new String[] { s }), x, y);
|
||||
}
|
||||
|
||||
public void executeAction() {
|
||||
|
||||
if(buttonType > 1 && type != 2)
|
||||
return;
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
|
||||
switch(buttonType) {
|
||||
case 0: rectify(); break;
|
||||
case 1: cycleType(); break;
|
||||
case 2: music = 0; break;
|
||||
case 3: music = 1; break;
|
||||
case 4: music = 2; break;
|
||||
case 5: music = 3; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -515,6 +515,9 @@ public class ModItems {
|
||||
public static Item syringe_metal_stimpak;
|
||||
public static Item syringe_metal_medx;
|
||||
public static Item syringe_metal_psycho;
|
||||
public static Item syringe_metal_super;
|
||||
public static Item radaway;
|
||||
public static Item med_bag;
|
||||
public static Item pill_iodine;
|
||||
public static Item plan_c;
|
||||
public static Item stealth_boy;
|
||||
@ -1716,6 +1719,9 @@ public class ModItems {
|
||||
syringe_metal_stimpak = new ItemSyringe().setUnlocalizedName("syringe_metal_stimpak").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_stimpak");
|
||||
syringe_metal_medx = new ItemSyringe().setUnlocalizedName("syringe_metal_medx").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_medx");
|
||||
syringe_metal_psycho = new ItemSyringe().setUnlocalizedName("syringe_metal_psycho").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_psycho");
|
||||
syringe_metal_super = new ItemSyringe().setUnlocalizedName("syringe_metal_super").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_super");
|
||||
med_bag = new ItemSyringe().setUnlocalizedName("med_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":med_bag");
|
||||
radaway = new ItemSyringe().setUnlocalizedName("radaway").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":radaway");
|
||||
pill_iodine = new ItemPill(0).setUnlocalizedName("pill_iodine").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_iodine");
|
||||
plan_c = new ItemPill(0).setUnlocalizedName("plan_c").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plan_c");
|
||||
stealth_boy = new ItemStarterKit().setUnlocalizedName("stealth_boy").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":stealth_boy");
|
||||
@ -3489,6 +3495,9 @@ public class ModItems {
|
||||
GameRegistry.registerItem(syringe_metal_stimpak, syringe_metal_stimpak.getUnlocalizedName());
|
||||
GameRegistry.registerItem(syringe_metal_medx, syringe_metal_medx.getUnlocalizedName());
|
||||
GameRegistry.registerItem(syringe_metal_psycho, syringe_metal_psycho.getUnlocalizedName());
|
||||
GameRegistry.registerItem(syringe_metal_super, syringe_metal_super.getUnlocalizedName());
|
||||
GameRegistry.registerItem(med_bag, med_bag.getUnlocalizedName());
|
||||
GameRegistry.registerItem(radaway, radaway.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pill_iodine, pill_iodine.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plan_c, plan_c.getUnlocalizedName());
|
||||
GameRegistry.registerItem(stealth_boy, stealth_boy.getUnlocalizedName());
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.hbm.items.food;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemFood;
|
||||
@ -34,6 +36,7 @@ public class ItemPill extends ItemFood {
|
||||
player.removePotionEffect(Potion.poison.id);
|
||||
player.removePotionEffect(Potion.weakness.id);
|
||||
player.removePotionEffect(Potion.wither.id);
|
||||
player.removePotionEffect(HbmPotion.radiation.id);
|
||||
}
|
||||
|
||||
if(this == ModItems.plan_c) {
|
||||
@ -42,5 +45,16 @@ public class ItemPill extends ItemFood {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
if(this == ModItems.pill_iodine) {
|
||||
list.add("Removes negative effects");
|
||||
}
|
||||
if(this == ModItems.plan_c) {
|
||||
list.add("Deadly");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -156,6 +158,57 @@ public class ItemSyringe extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModItems.syringe_metal_super)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
player.heal(25);
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 0));
|
||||
|
||||
stack.stackSize--;
|
||||
|
||||
if (stack.stackSize <= 0)
|
||||
{
|
||||
return new ItemStack(ModItems.syringe_metal_empty);
|
||||
}
|
||||
|
||||
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty)))
|
||||
{
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModItems.med_bag)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
player.setHealth(player.getMaxHealth());
|
||||
|
||||
player.removePotionEffect(Potion.blindness.id);
|
||||
player.removePotionEffect(Potion.confusion.id);
|
||||
player.removePotionEffect(Potion.digSlowdown.id);
|
||||
player.removePotionEffect(Potion.hunger.id);
|
||||
player.removePotionEffect(Potion.moveSlowdown.id);
|
||||
player.removePotionEffect(Potion.poison.id);
|
||||
player.removePotionEffect(Potion.weakness.id);
|
||||
player.removePotionEffect(Potion.wither.id);
|
||||
player.removePotionEffect(HbmPotion.radiation.id);
|
||||
|
||||
stack.stackSize--;
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModItems.radaway)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
player.removePotionEffect(HbmPotion.radiation.id);
|
||||
|
||||
stack.stackSize--;
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@ -315,6 +368,26 @@ public class ItemSyringe extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModItems.syringe_metal_super)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
entity.heal(25);
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 0));
|
||||
|
||||
stack.stackSize--;
|
||||
|
||||
if(entityPlayer instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer)entityPlayer;
|
||||
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.syringe_metal_empty)))
|
||||
{
|
||||
player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.syringe_metal_empty, 1, 0), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this == ModItems.euphemium_stopper)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
@ -327,4 +400,39 @@ public class ItemSyringe extends Item {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
if(this == ModItems.syringe_antidote) {
|
||||
list.add("Removes all potion effects");
|
||||
}
|
||||
if(this == ModItems.syringe_awesome) {
|
||||
list.add("Every good effect for 50 seconds");
|
||||
}
|
||||
if(this == ModItems.syringe_metal_medx) {
|
||||
list.add("Resistance III for 4 minutes");
|
||||
}
|
||||
if(this == ModItems.syringe_metal_psycho) {
|
||||
list.add("Resistance I for 2 minutes");
|
||||
list.add("Strength I for 2 minutes");
|
||||
}
|
||||
if(this == ModItems.syringe_metal_stimpak) {
|
||||
list.add("Heals 2.5 hearts");
|
||||
}
|
||||
if(this == ModItems.syringe_metal_super) {
|
||||
list.add("Heals 25 hearts");
|
||||
list.add("Slowness I for 10 seconds");
|
||||
}
|
||||
if(this == ModItems.syringe_poison) {
|
||||
list.add("Deadly");
|
||||
}
|
||||
if(this == ModItems.med_bag) {
|
||||
list.add("Full heal, regardless of max health");
|
||||
list.add("Removes negative effects");
|
||||
}
|
||||
if(this == ModItems.radaway) {
|
||||
list.add("Removes radiation effect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,6 +226,9 @@ public class Library {
|
||||
if(!(e instanceof EntityLivingBase))
|
||||
return;
|
||||
|
||||
if(radDura == 0)
|
||||
return;
|
||||
|
||||
EntityLivingBase entity = (EntityLivingBase)e;
|
||||
|
||||
if(entity instanceof EntityPlayer) {
|
||||
@ -235,6 +238,10 @@ public class Library {
|
||||
return;
|
||||
|
||||
if(checkForGasMask(player)) {
|
||||
|
||||
if(maskDura == 0)
|
||||
return;
|
||||
|
||||
entity.addPotionEffect(new PotionEffect(HbmPotion.radiation.id, maskDura * 20, maskLevel));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -305,6 +305,8 @@ public class ClientProxy extends ServerProxy
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecoBlock.class, new RenderDecoBlock());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBroadcaster.class, new RenderDecoBlock());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRadioRec.class, new RenderDecoBlock());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRadiobox.class, new RenderDecoBlock());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecoBlockAlt.class, new RenderDecoBlockAlt());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecoBlockAltG.class, new RenderDecoBlockAlt());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecoBlockAltW.class, new RenderDecoBlockAlt());
|
||||
|
||||
@ -844,6 +844,17 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.syringe_metal_psycho, 1), new Object[] { " N ", "NSN", " N ", 'N', Items.glowstone_dust, 'S', ModItems.syringe_metal_empty });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.pill_iodine, 8), new Object[] { "IF", 'I', ModItems.powder_iodine, 'F', ModItems.fluorite });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.plan_c, 1), new Object[] { "PFP", 'P', ModItems.powder_poison, 'F', ModItems.fluorite });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.med_bag, 1), new Object[] { "LLL", "SIS", "LLL", 'L', Items.leather, 'S', ModItems.syringe_metal_stimpak, 'I', ModItems.syringe_antidote });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.med_bag, 1), new Object[] { "LLL", "SIS", "LLL", 'L', Items.leather, 'S', ModItems.syringe_metal_stimpak, 'I', ModItems.pill_iodine });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.med_bag, 1), new Object[] { "LL", "SI", "LL", 'L', Items.leather, 'S', ModItems.syringe_metal_super, 'I', ModItems.radaway });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.med_bag, 1), new Object[] { "LLL", "SIS", "LLL", 'L', ModItems.plate_polymer, 'S', ModItems.syringe_metal_stimpak, 'I', ModItems.syringe_antidote });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.med_bag, 1), new Object[] { "LLL", "SIS", "LLL", 'L', ModItems.plate_polymer, 'S', ModItems.syringe_metal_stimpak, 'I', ModItems.pill_iodine });
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.med_bag, 1), new Object[] { "LL", "SI", "LL", 'L', ModItems.plate_polymer, 'S', ModItems.syringe_metal_super, 'I', ModItems.radaway });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.syringe_metal_super, 1), new Object[] { " N ", "PSP", "L L", 'N', ModItems.bottle_nuka, 'P', "plateSteel", 'S', ModItems.syringe_metal_stimpak, 'L', Items.leather }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.syringe_metal_super, 1), new Object[] { " N ", "PSP", "L L", 'N', ModItems.bottle_nuka, 'P', "plateSteel", 'S', ModItems.syringe_metal_stimpak, 'L', ModItems.plate_polymer }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.syringe_metal_super, 1), new Object[] { " N ", "PSP", "L L", 'N', ModItems.bottle_cherry, 'P', "plateSteel", 'S', ModItems.syringe_metal_stimpak, 'L', Items.leather }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.syringe_metal_super, 1), new Object[] { " N ", "PSP", "L L", 'N', ModItems.bottle_cherry, 'P', "plateSteel", 'S', ModItems.syringe_metal_stimpak, 'L', ModItems.plate_polymer }));
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.radaway, 1), new Object[] { "S", "M", "W", 'S', ModItems.plate_polymer, 'M', ModBlocks.mush, 'W', Items.potionitem });
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stealth_boy, 1), new Object[] { " B", "LI", "LC", 'B', Item.getItemFromBlock(Blocks.stone_button), 'L', Items.leather, 'I', "ingotSteel", 'C', ModItems.circuit_red_copper }));
|
||||
|
||||
@ -1216,6 +1227,7 @@ public class CraftingManager {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_transformer), new Object[] { "SDS", "MCM", "MCM", 'S', ModItems.ingot_starmetal, 'D', "ingotDesh", 'M', ModBlocks.fusion_conductor, 'C', ModItems.circuit_targeting_tier6 }));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.bottle_sparkle), new Object[] { ModItems.bottle_quantum, Items.carrot, Items.gold_nugget });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.grenade_nuke), new Object[] { "CGC", "CGC", "PAP", 'C', ModBlocks.det_charge, 'G', ModItems.grenade_mk2, 'P', "plateAdvanced", 'A', Blocks.anvil }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.radiobox), new Object[] { "-C-", "8OI", "EUE", '-', ModItems.plate_polymer, 'C', ModItems.circuit_targeting_tier4, '8', ModItems.coil_gold, 'O', ModItems.pellet_rtg, 'I', ModItems.fuse, 'E', "plateSteel", 'U', ModItems.rtg_unit }));
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.paper, 1), new Object[] { new ItemStack(ModItems.assembly_template, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.paper, 1), new Object[] { new ItemStack(ModItems.chemistry_template, 1, OreDictionary.WILDCARD_VALUE) });
|
||||
|
||||
@ -274,6 +274,8 @@ import com.hbm.tileentity.machine.TileEntityMachineTransformer;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineTurbofan;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineUF6Tank;
|
||||
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
||||
import com.hbm.tileentity.machine.TileEntityRadioRec;
|
||||
import com.hbm.tileentity.machine.TileEntityRadiobox;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorMultiblock;
|
||||
import com.hbm.tileentity.machine.TileEntityRtgFurnace;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineSatLinker;
|
||||
@ -657,6 +659,8 @@ public class MainRegistry
|
||||
GameRegistry.registerTileEntity(TileEntityMachineSatLinker.class, "tileentity_satlinker");
|
||||
GameRegistry.registerTileEntity(TileEntityMachineReactorSmall.class, "tileentity_small_reactor");
|
||||
GameRegistry.registerTileEntity(TileEntityVaultDoor.class, "tileentity_vault_door");
|
||||
GameRegistry.registerTileEntity(TileEntityRadiobox.class, "tileentity_radio_broadcaster");
|
||||
GameRegistry.registerTileEntity(TileEntityRadioRec.class, "tileentity_radio_receiver");
|
||||
|
||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||
|
||||
@ -1,67 +1,61 @@
|
||||
// Date: 14.08.2018 11:02:47
|
||||
// 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 ModelRadio extends ModelBase {
|
||||
// fields
|
||||
ModelRenderer Box;
|
||||
ModelRenderer Plate;
|
||||
ModelRenderer Lever;
|
||||
|
||||
public ModelRadio() {
|
||||
textureWidth = 32;
|
||||
textureHeight = 32;
|
||||
|
||||
Box = new ModelRenderer(this, 0, 0);
|
||||
Box.addBox(0F, 0F, 0F, 8, 14, 4);
|
||||
Box.setRotationPoint(-4F, 9F, -12F);
|
||||
Box.setTextureSize(32, 32);
|
||||
Box.mirror = true;
|
||||
setRotation(Box, 0F, 0F, 0F);
|
||||
Plate = new ModelRenderer(this, 0, 18);
|
||||
Plate.addBox(0F, 0F, 0F, 7, 13, 1);
|
||||
Plate.setRotationPoint(-3.5F, 9.5F, -12.5F);
|
||||
Plate.setTextureSize(32, 32);
|
||||
Plate.mirror = true;
|
||||
setRotation(Plate, 0F, 0F, 0F);
|
||||
Lever = new ModelRenderer(this, 16, 18);
|
||||
Lever.addBox(0F, -1F, -1F, 2, 8, 2);
|
||||
Lever.setRotationPoint(4F, 16F, -10F);
|
||||
Lever.setTextureSize(32, 32);
|
||||
Lever.mirror = true;
|
||||
setRotation(Lever, 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);
|
||||
Box.render(f5);
|
||||
Plate.render(f5);
|
||||
Lever.render(f5);
|
||||
}
|
||||
|
||||
package net.minecraft.src;
|
||||
public void renderModel(float f5, int deg) {
|
||||
Box.render(f5);
|
||||
Plate.render(f5);
|
||||
Lever.rotateAngleX = -(float)(deg / 180F * Math.PI);
|
||||
Lever.render(f5);
|
||||
}
|
||||
|
||||
public class ModelModelRadio extends ModelBase
|
||||
{
|
||||
//fields
|
||||
ModelRenderer Box;
|
||||
ModelRenderer Plate;
|
||||
ModelRenderer Lever;
|
||||
|
||||
public ModelModelRadio()
|
||||
{
|
||||
textureWidth = 32;
|
||||
textureHeight = 32;
|
||||
|
||||
Box = new ModelRenderer(this, 0, 0);
|
||||
Box.addBox(0F, 0F, 0F, 8, 14, 4);
|
||||
Box.setRotationPoint(-4F, 9F, -12F);
|
||||
Box.setTextureSize(32, 32);
|
||||
Box.mirror = true;
|
||||
setRotation(Box, 0F, 0F, 0F);
|
||||
Plate = new ModelRenderer(this, 0, 18);
|
||||
Plate.addBox(0F, 0F, 0F, 7, 13, 1);
|
||||
Plate.setRotationPoint(-3.5F, 9.5F, -12.5F);
|
||||
Plate.setTextureSize(32, 32);
|
||||
Plate.mirror = true;
|
||||
setRotation(Plate, 0F, 0F, 0F);
|
||||
Lever = new ModelRenderer(this, 16, 18);
|
||||
Lever.addBox(0F, -1F, -1F, 2, 8, 2);
|
||||
Lever.setRotationPoint(4F, 16F, -10F);
|
||||
Lever.setTextureSize(32, 32);
|
||||
Lever.mirror = true;
|
||||
setRotation(Lever, 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);
|
||||
Box.render(f5);
|
||||
Plate.render(f5);
|
||||
Lever.render(f5);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.ModelRadio;
|
||||
import com.hbm.render.model.ModelSteelBeam;
|
||||
import com.hbm.render.model.ModelSteelCorner;
|
||||
import com.hbm.render.model.ModelSteelRoof;
|
||||
@ -24,6 +25,8 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
|
||||
private static final ResourceLocation texture4 = new ResourceLocation(RefStrings.MODID + ":" + "textures/models/SteelBeam.png");
|
||||
private static final ResourceLocation texture5 = new ResourceLocation(RefStrings.MODID + ":" + "textures/models/SteelScaffold.png");
|
||||
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 ModelSteelWall model1;
|
||||
private ModelSteelCorner model2;
|
||||
@ -31,6 +34,7 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
|
||||
private ModelSteelBeam model4;
|
||||
private ModelSteelScaffold model5;
|
||||
private ModelBroadcaster model6;
|
||||
private ModelRadio model7;
|
||||
|
||||
public RenderDecoBlock() {
|
||||
this.model1 = new ModelSteelWall();
|
||||
@ -39,6 +43,7 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
|
||||
this.model4 = new ModelSteelBeam();
|
||||
this.model5 = new ModelSteelScaffold();
|
||||
this.model6 = new ModelBroadcaster();
|
||||
this.model7 = new ModelRadio();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -117,6 +122,41 @@ public class RenderDecoBlock extends TileEntitySpecialRenderer {
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
}
|
||||
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.radiorec)
|
||||
{
|
||||
this.bindTexture(texture8);
|
||||
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.radiobox)
|
||||
{
|
||||
this.bindTexture(texture7);
|
||||
switch(tileentity.getBlockMetadata())
|
||||
{
|
||||
case 4:
|
||||
case 8:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 2:
|
||||
case 6:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 5:
|
||||
case 9:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 3:
|
||||
case 7:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
}
|
||||
GL11.glTranslatef(0, 0, 1);
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.steel_wall)
|
||||
@ -131,6 +171,10 @@ 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.radiobox)
|
||||
this.model7.renderModel(0.0625F, tileentity.getBlockMetadata() > 5 ? 160 : 20);
|
||||
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.radiorec)
|
||||
this.model6.renderModel(0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord) == ModBlocks.boxcar) {
|
||||
|
||||
53
com/hbm/saveddata/BroadcastSaveStructure.java
Normal file
@ -0,0 +1,53 @@
|
||||
package com.hbm.saveddata;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class BroadcastSaveStructure {
|
||||
|
||||
public int broadcastID;
|
||||
public BroadcastType broadcastType;
|
||||
public int posX;
|
||||
public int posZ;
|
||||
|
||||
public BroadcastSaveStructure() { }
|
||||
|
||||
public BroadcastSaveStructure(int id, BroadcastType type) {
|
||||
broadcastID = id;
|
||||
broadcastType = type;
|
||||
}
|
||||
|
||||
public enum BroadcastType {
|
||||
|
||||
DEMO;
|
||||
|
||||
public static BroadcastType getEnum(int i) {
|
||||
if(i < BroadcastType.values().length)
|
||||
return BroadcastType.values()[i];
|
||||
else
|
||||
return BroadcastType.DEMO;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
return Arrays.asList(BroadcastType.values()).indexOf(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt, int index) {
|
||||
broadcastID = nbt.getInteger("bc_" + index + "_id");
|
||||
broadcastType = BroadcastType.getEnum(nbt.getInteger("bc_" + index + "_type"));
|
||||
posX = nbt.getInteger("bc_" + index + "_x");
|
||||
posZ = nbt.getInteger("bc_" + index + "_z");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbt, int index) {
|
||||
nbt.setInteger("bc_" + index + "_id", broadcastID);
|
||||
nbt.setInteger("bc_" + index + "_type", broadcastType.getID());
|
||||
nbt.setInteger("bc_" + index + "_x", posX);
|
||||
nbt.setInteger("bc_" + index + "_z", posZ);
|
||||
}
|
||||
|
||||
}
|
||||
64
com/hbm/saveddata/BroadcastSavedData.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.hbm.saveddata;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
|
||||
public class BroadcastSavedData extends WorldSavedData {
|
||||
|
||||
public int bcCount;
|
||||
|
||||
public List<BroadcastSaveStructure> broadcasts = new ArrayList();
|
||||
|
||||
private World worldObj;
|
||||
|
||||
public BroadcastSavedData(String p_i2141_1_) {
|
||||
super(p_i2141_1_);
|
||||
}
|
||||
|
||||
public BroadcastSavedData(World p_i1678_1_)
|
||||
{
|
||||
super("broadcasts");
|
||||
this.worldObj = p_i1678_1_;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
public boolean isIdTaken(int id) {
|
||||
|
||||
return getBroadcastFromId(id) != null;
|
||||
}
|
||||
|
||||
public BroadcastSaveStructure getBroadcastFromId(int id) {
|
||||
|
||||
for(BroadcastSaveStructure bc : broadcasts)
|
||||
if(bc.broadcastID == id)
|
||||
return bc;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
bcCount = nbt.getInteger("bcCount");
|
||||
|
||||
for(int i = 0; i < bcCount; i++) {
|
||||
BroadcastSaveStructure struct = new BroadcastSaveStructure();
|
||||
struct.readFromNBT(nbt, i);
|
||||
|
||||
broadcasts.add(struct);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger("bcCount", broadcasts.size());
|
||||
|
||||
for(int i = 0; i < broadcasts.size(); i++) {
|
||||
broadcasts.get(i).writeToNBT(nbt, i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
7
com/hbm/tileentity/machine/TileEntityRadioRec.java
Normal file
@ -0,0 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityRadioRec extends TileEntity {
|
||||
|
||||
}
|
||||
23
com/hbm/tileentity/machine/TileEntityRadiobox.java
Normal file
@ -0,0 +1,23 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEAssemblerPacket;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityRadiobox extends TileEntity {
|
||||
|
||||
public double freq;
|
||||
public int type;
|
||||
public String message;
|
||||
public int music;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
//PacketDispatcher.wrapper.sendToAll(new TEAssemblerPacket(xCoord, yCoord, zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||