More clips, glitch functionality, AMS textures, manual designator
|
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 371 B |
BIN
assets/hbm/textures/entity/creeper_tainted.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 362 B After Width: | Height: | Size: 360 B |
BIN
assets/hbm/textures/items/pc_mo8_backup.png
Normal file
|
After Width: | Height: | Size: 184 B |
|
Before Width: | Height: | Size: 375 KiB After Width: | Height: | Size: 298 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 13 KiB |
@ -817,12 +817,12 @@ public class ModBlocks {
|
||||
dummy_port_pumpjack = new DummyBlockPumpjack(Material.iron).setBlockName("dummy_port_pumpjack").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
dummy_block_turbofan = new DummyBlockTurbofan(Material.iron).setBlockName("dummy_block_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_turbofan = new DummyBlockTurbofan(Material.iron).setBlockName("dummy_port_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_block_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_port_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_ams_emitter = new DummyBlockAMSEmitter(Material.iron).setBlockName("dummy_block_ams_emitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_ams_emitter = new DummyBlockAMSEmitter(Material.iron).setBlockName("dummy_port_ams_emitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_ams_base = new DummyBlockAMSBase(Material.iron).setBlockName("dummy_block_ams_base").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_ams_base = new DummyBlockAMSBase(Material.iron).setBlockName("dummy_port_ams_base").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_block_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_port_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_port_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_block_ams_emitter = new DummyBlockAMSEmitter(Material.iron).setBlockName("dummy_block_ams_emitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_port_ams_emitter = new DummyBlockAMSEmitter(Material.iron).setBlockName("dummy_port_ams_emitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_block_ams_base = new DummyBlockAMSBase(Material.iron).setBlockName("dummy_block_ams_base").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_port_ams_base = new DummyBlockAMSBase(Material.iron).setBlockName("dummy_port_ams_base").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_block_radgen = new DummyBlockRadGen(Material.iron).setBlockName("dummy_block_radgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_radgen = new DummyBlockRadGen(Material.iron).setBlockName("dummy_port_radgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ public class LaunchPad extends BlockContainer implements IBomb {
|
||||
TileEntityLaunchPad entity = (TileEntityLaunchPad) p_149695_1_.getTileEntity(x, y, z);
|
||||
//
|
||||
{
|
||||
if(entity.slots[1] != null && (entity.slots[1].getItem() == ModItems.designator || entity.slots[1].getItem() == ModItems.designator_range) && entity.slots[1].stackTagCompound != null)
|
||||
if(entity.slots[1] != null && (entity.slots[1].getItem() == ModItems.designator || entity.slots[1].getItem() == ModItems.designator_range || entity.slots[1].getItem() == ModItems.designator_manual) && entity.slots[1].stackTagCompound != null)
|
||||
{
|
||||
int xCoord = entity.slots[1].stackTagCompound.getInteger("xCoord");
|
||||
int zCoord = entity.slots[1].stackTagCompound.getInteger("zCoord");
|
||||
|
||||
@ -85,7 +85,7 @@ public class BlockOre extends Block {
|
||||
}
|
||||
if(this == ModBlocks.block_meteor_treasure)
|
||||
{
|
||||
switch(rand.nextInt(35)) {
|
||||
switch(rand.nextInt(36)) {
|
||||
case 0: return ModItems.coil_advanced_alloy;
|
||||
case 1: return ModItems.plate_advanced_alloy;
|
||||
case 2: return ModItems.powder_desh_mix;
|
||||
@ -121,6 +121,7 @@ public class BlockOre extends Block {
|
||||
case 32: return ModItems.gun_mirv_ammo;
|
||||
case 33: return ModItems.gun_defabricator_ammo;
|
||||
case 34: return ModItems.gun_osipr_ammo2;
|
||||
case 35: return ModItems.glitch;
|
||||
}
|
||||
}
|
||||
if(this == ModBlocks.ore_rare)
|
||||
|
||||
@ -1119,6 +1119,8 @@ public class GUIHandler implements IGuiHandler {
|
||||
{
|
||||
case ModItems.guiID_item_folder:
|
||||
return new GUIScreenTemplateFolder(player);
|
||||
case ModItems.guiID_item_designator:
|
||||
return new GUIScreenDesignator(player);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
227
com/hbm/inventory/gui/GUIScreenDesignator.java
Normal file
@ -0,0 +1,227 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemAssemblyTemplate.EnumAssemblyTemplate;
|
||||
import com.hbm.items.tool.ItemCassette;
|
||||
import com.hbm.items.tool.ItemCassette.TrackType;
|
||||
import com.hbm.items.tool.ItemChemistryTemplate;
|
||||
import com.hbm.items.tool.ItemFluidIdentifier;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.ItemDesignatorPacket;
|
||||
import com.hbm.packet.ItemFolderPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIScreenDesignator extends GuiScreen {
|
||||
|
||||
protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_designator.png");
|
||||
protected int xSize = 176;
|
||||
protected int ySize = 178;
|
||||
protected int guiLeft;
|
||||
protected int guiTop;
|
||||
int shownX;
|
||||
int shownZ;
|
||||
int currentPage = 0;
|
||||
List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
List<FolderButton> buttons = new ArrayList<FolderButton>();
|
||||
private final EntityPlayer player;
|
||||
|
||||
public GUIScreenDesignator(EntityPlayer player) {
|
||||
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public void drawScreen(int mouseX, int mouseY, float f)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
this.guiLeft = (this.width - this.xSize) / 2;
|
||||
this.guiTop = (this.height - this.ySize) / 2;
|
||||
|
||||
shownX = 0;
|
||||
shownZ = 0;
|
||||
ItemStack stack = player.getHeldItem();
|
||||
|
||||
if(stack != null && stack.getItem() == ModItems.designator_manual && stack.hasTagCompound()) {
|
||||
shownX = stack.stackTagCompound.getInteger("xCoord");
|
||||
shownZ = stack.stackTagCompound.getInteger("zCoord");
|
||||
}
|
||||
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
private void updateButtons() {
|
||||
buttons.clear();
|
||||
|
||||
buttons.add(new FolderButton(guiLeft + 25, guiTop + 26, 0, 0, 0, 1, null));
|
||||
buttons.add(new FolderButton(guiLeft + 52, guiTop + 26, 1, 0, 0, 5, null));
|
||||
buttons.add(new FolderButton(guiLeft + 79, guiTop + 26, 2, 0, 0, 10, null));
|
||||
buttons.add(new FolderButton(guiLeft + 106, guiTop + 26, 3, 0, 0, 50, null));
|
||||
buttons.add(new FolderButton(guiLeft + 133, guiTop + 26, 4, 0, 0, 100, null));
|
||||
|
||||
buttons.add(new FolderButton(guiLeft + 25, guiTop + 62, 5, 1, 0, 1, null));
|
||||
buttons.add(new FolderButton(guiLeft + 52, guiTop + 62, 6, 1, 0, 5, null));
|
||||
buttons.add(new FolderButton(guiLeft + 79, guiTop + 62, 7, 1, 0, 10, null));
|
||||
buttons.add(new FolderButton(guiLeft + 106, guiTop + 62, 8, 1, 0, 50, null));
|
||||
buttons.add(new FolderButton(guiLeft + 133, guiTop + 62, 9, 1, 0, 100, null));
|
||||
|
||||
buttons.add(new FolderButton(guiLeft + 133, guiTop + 44, 10, 2, 0, 0, "Set coord to current X position..."));
|
||||
|
||||
buttons.add(new FolderButton(guiLeft + 25, guiTop + 26 + 72, 0, 0, 1, 1, null));
|
||||
buttons.add(new FolderButton(guiLeft + 52, guiTop + 26 + 72, 1, 0, 1, 5, null));
|
||||
buttons.add(new FolderButton(guiLeft + 79, guiTop + 26 + 72, 2, 0, 1, 10, null));
|
||||
buttons.add(new FolderButton(guiLeft + 106, guiTop + 26 + 72, 3, 0, 1, 50, null));
|
||||
buttons.add(new FolderButton(guiLeft + 133, guiTop + 26 + 72, 4, 0, 1, 100, null));
|
||||
|
||||
buttons.add(new FolderButton(guiLeft + 25, guiTop + 62 + 72, 5, 1, 1, 1, null));
|
||||
buttons.add(new FolderButton(guiLeft + 52, guiTop + 62 + 72, 6, 1, 1, 5, null));
|
||||
buttons.add(new FolderButton(guiLeft + 79, guiTop + 62 + 72, 7, 1, 1, 10, null));
|
||||
buttons.add(new FolderButton(guiLeft + 106, guiTop + 62 + 72, 8, 1, 1, 50, null));
|
||||
buttons.add(new FolderButton(guiLeft + 133, guiTop + 62 + 72, 9, 1, 1, 100, null));
|
||||
|
||||
buttons.add(new FolderButton(guiLeft + 133, guiTop + 44 + 72, 10, 2, 1, 0, "Set coord to current Z position..."));
|
||||
}
|
||||
|
||||
protected void mouseClicked(int i, int j, int k) {
|
||||
try {
|
||||
for(FolderButton b : buttons)
|
||||
if(b.isMouseOnButton(i, j))
|
||||
b.executeAction();
|
||||
} catch (Exception ex) { }
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
|
||||
//this.fontRendererObj.drawString(I18n.format((currentPage + 1) + "/" + (getPageCount() + 1)),
|
||||
// guiLeft + this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format((currentPage + 1) + "/" + (getPageCount() + 1))) / 2, guiTop + 10, 4210752);
|
||||
|
||||
for(FolderButton b : buttons)
|
||||
if(b.isMouseOnButton(i, j))
|
||||
b.drawString(i, j);
|
||||
|
||||
String x = String.valueOf(shownX);
|
||||
String z = String.valueOf(shownZ);
|
||||
this.fontRendererObj.drawString("X: " + x,
|
||||
guiLeft + this.xSize / 2 - this.fontRendererObj.getStringWidth("X: " + x) / 2, guiTop + 50, 4210752);
|
||||
this.fontRendererObj.drawString("Z: " + z,
|
||||
guiLeft + this.xSize / 2 - this.fontRendererObj.getStringWidth("Z: " + z) / 2, guiTop + 50 + 18 * 4, 4210752);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
for(FolderButton b : buttons)
|
||||
b.drawButton(b.isMouseOnButton(i, j));
|
||||
}
|
||||
|
||||
protected void keyTyped(char p_73869_1_, int p_73869_2_)
|
||||
{
|
||||
if (p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode())
|
||||
{
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void updateScreen() {
|
||||
if(player.getHeldItem() == null || player.getHeldItem().getItem() != ModItems.designator_manual)
|
||||
player.closeScreen();
|
||||
}
|
||||
|
||||
class FolderButton {
|
||||
|
||||
int xPos;
|
||||
int yPos;
|
||||
int type;
|
||||
int operator;
|
||||
int value;
|
||||
int reference;
|
||||
String info;
|
||||
|
||||
public FolderButton(int x, int y, int t, int o, int r, int v, String i) {
|
||||
xPos = x;
|
||||
yPos = y;
|
||||
type = t;
|
||||
operator = o;
|
||||
value = v;
|
||||
reference = r;
|
||||
info = i;
|
||||
}
|
||||
|
||||
public void updateButton(int mouseX, int mouseY) {
|
||||
}
|
||||
|
||||
public boolean isMouseOnButton(int mouseX, int mouseY) {
|
||||
return xPos <= mouseX && xPos + 18 > mouseX && yPos < mouseY && yPos + 18 >= mouseY;
|
||||
}
|
||||
|
||||
public void drawButton(boolean b) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(xPos, yPos, b ? 176 + 18 : 176, type * 18, 18, 18);
|
||||
}
|
||||
|
||||
public void drawString(int x, int y) {
|
||||
if(info == null || info.isEmpty())
|
||||
return;
|
||||
|
||||
String s = info;
|
||||
|
||||
func_146283_a(Arrays.asList(new String[] { s }), x, y);
|
||||
}
|
||||
|
||||
public void executeAction() {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
PacketDispatcher.wrapper.sendToServer(new ItemDesignatorPacket(this.operator, this.value, this.reference));
|
||||
|
||||
int result = 0;
|
||||
|
||||
if(operator == 0)
|
||||
result += value;
|
||||
if(operator == 1)
|
||||
result -= value;
|
||||
if(operator == 2) {
|
||||
if(reference == 0)
|
||||
shownX = (int)Math.round(player.posX);
|
||||
else
|
||||
shownZ = (int)Math.round(player.posZ);
|
||||
return;
|
||||
}
|
||||
|
||||
if(reference == 0)
|
||||
shownX += result;
|
||||
else
|
||||
shownZ += result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -597,6 +597,7 @@ public class ModItems {
|
||||
|
||||
public static Item designator;
|
||||
public static Item designator_range;
|
||||
public static Item designator_manual;
|
||||
public static Item linker;
|
||||
public static Item oil_detector;
|
||||
public static Item geiger_counter;
|
||||
@ -1122,8 +1123,9 @@ public class ModItems {
|
||||
public static Item ln2_10;
|
||||
public static Item nothing;
|
||||
public static Item void_anim;
|
||||
|
||||
|
||||
public static final int guiID_item_folder = 99;
|
||||
public static final int guiID_item_designator = 100;
|
||||
|
||||
public static void initializeItem()
|
||||
{
|
||||
@ -1680,6 +1682,7 @@ public class ModItems {
|
||||
|
||||
designator = new ItemDesingator().setUnlocalizedName("designator").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":designator");
|
||||
designator_range = new ItemDesingatorRange().setUnlocalizedName("designator_range").setFull3D().setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":designator_range_alt");
|
||||
designator_manual = new ItemDesingatorManual().setUnlocalizedName("designator_manual").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":designator_manual");
|
||||
missile_generic = new Item().setUnlocalizedName("missile_generic").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_generic");
|
||||
missile_anti_ballistic = new Item().setUnlocalizedName("missile_anti_ballistic").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_anti_ballistic");
|
||||
missile_incendiary = new Item().setUnlocalizedName("missile_incendiary").setMaxStackSize(1).setCreativeTab(MainRegistry.tabNuke).setTextureName(RefStrings.MODID + ":missile_incendiary");
|
||||
@ -2891,6 +2894,7 @@ public class ModItems {
|
||||
//Computer Tools
|
||||
GameRegistry.registerItem(designator, designator.getUnlocalizedName());
|
||||
GameRegistry.registerItem(designator_range, designator_range.getUnlocalizedName());
|
||||
GameRegistry.registerItem(designator_manual, designator_manual.getUnlocalizedName());
|
||||
GameRegistry.registerItem(turret_control, turret_control.getUnlocalizedName());
|
||||
GameRegistry.registerItem(turret_chip, turret_chip.getUnlocalizedName());
|
||||
GameRegistry.registerItem(linker, linker.getUnlocalizedName());
|
||||
|
||||
@ -2,11 +2,23 @@ package com.hbm.items.special;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.effect.EntityVortex;
|
||||
import com.hbm.entity.missile.EntityMIRV;
|
||||
import com.hbm.entity.projectile.EntityBoxcar;
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemGlitch extends Item {
|
||||
@ -23,6 +35,140 @@ public class ItemGlitch extends Item {
|
||||
|
||||
stack.damageItem(5, player);
|
||||
|
||||
if(!world.isRemote)
|
||||
switch(itemRand.nextInt(31)) {
|
||||
case 0:
|
||||
player.addChatMessage(new ChatComponentText("Sorry nothing."));
|
||||
break;
|
||||
case 1:
|
||||
player.addChatMessage(new ChatComponentText("Prometheus was punished by the gods by giving the gift of knowledge to man. He was cast into the bowels of the earth and pecked by birds."));
|
||||
break;
|
||||
case 2:
|
||||
player.attackEntityFrom(ModDamageSource.radiation, 1000);
|
||||
break;
|
||||
case 3:
|
||||
player.attackEntityFrom(ModDamageSource.boxcar, 1000);
|
||||
break;
|
||||
case 4:
|
||||
player.attackEntityFrom(ModDamageSource.blackhole, 1000);
|
||||
break;
|
||||
case 5:
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.block_meteor_treasure.getItemDropped(0, itemRand, 0)));
|
||||
break;
|
||||
case 6:
|
||||
for(int i = 0; i < 3; i++)
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.block_meteor_treasure.getItemDropped(0, itemRand, 0)));
|
||||
break;
|
||||
case 7:
|
||||
for(int i = 0; i < 10; i++)
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.block_meteor_treasure.getItemDropped(0, itemRand, 0)));
|
||||
break;
|
||||
case 8:
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_container, 10));
|
||||
player.addChatMessage(new ChatComponentText("Oh, and by the way: The polaroid shifts reality. Things can be different if the polaroid is broken."));
|
||||
break;
|
||||
case 9:
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.nuke_advanced_kit, 1));
|
||||
break;
|
||||
case 10:
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.nuke_starter_kit, 1));
|
||||
break;
|
||||
case 11:
|
||||
EntityBoxcar pip = new EntityBoxcar(world);
|
||||
pip.posX = player.posX;
|
||||
pip.posY = player.posY + 50;
|
||||
pip.posZ = player.posZ;
|
||||
world.spawnEntityInWorld(pip);
|
||||
break;
|
||||
case 12:
|
||||
for(int i = 0; i < 10; i++) {
|
||||
EntityBoxcar pippo = new EntityBoxcar(world);
|
||||
pippo.posX = player.posX + itemRand.nextGaussian() * 25;
|
||||
pippo.posY = player.posY + 50;
|
||||
pippo.posZ = player.posZ + itemRand.nextGaussian() * 25;
|
||||
world.spawnEntityInWorld(pippo);
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_pip));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.bottle_sparkle));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.geiger_counter));
|
||||
player.addChatMessage(new ChatComponentText("Congratz, you're the wasteland hero now, now throw yourself into some fire or something for this weird achievement. Get going already, I'm not even being paid to tell you this."));
|
||||
break;
|
||||
case 14:
|
||||
player.inventory.dropAllItems();
|
||||
ExplosionChaos.burn(world, (int)player.posX, (int)player.posY, (int)player.posZ, 5);
|
||||
break;
|
||||
case 15:
|
||||
for(int i = 0; i < 36; i++)
|
||||
player.inventory.addItemStackToInventory(new ItemStack(Blocks.dirt, 64));
|
||||
break;
|
||||
case 16:
|
||||
player.addChatMessage(new ChatComponentText("v yvxr lbhe nggvghqr!"));
|
||||
break;
|
||||
case 17:
|
||||
player.addChatMessage(new ChatComponentText("89% of magic tricks are not magic. Technically, they are sorcery."));
|
||||
break;
|
||||
case 18:
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_lever_action));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_lever_action_ammo, 12));
|
||||
player.addChatMessage(new ChatComponentText("Here ya go."));
|
||||
break;
|
||||
case 19:
|
||||
player.addChatMessage(new ChatComponentText("Indigo - Purple - Pink - Indigo"));
|
||||
break;
|
||||
case 20:
|
||||
player.addChatMessage(new ChatComponentText("These colors are everywhere. Everywhere."));
|
||||
break;
|
||||
case 21:
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.missile_nuclear));
|
||||
player.addChatMessage(new ChatComponentText("73616d706c652074657874!"));
|
||||
break;
|
||||
case 22:
|
||||
player.addChatMessage(new ChatComponentText("Budget cuts, no effect for you."));
|
||||
break;
|
||||
case 23:
|
||||
player.addChatMessage(new ChatComponentText("oof"));
|
||||
break;
|
||||
case 24:
|
||||
player.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 9));
|
||||
player.addChatMessage(new ChatComponentText("Tank!"));
|
||||
break;
|
||||
case 25:
|
||||
player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 60 * 20, 9));
|
||||
player.addChatMessage(new ChatComponentText("More devastating than a falling boxcar!"));
|
||||
break;
|
||||
case 26:
|
||||
player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 60 * 20, 9));
|
||||
player.addChatMessage(new ChatComponentText("Ha!"));
|
||||
break;
|
||||
case 27:
|
||||
EntityVortex vortex = new EntityVortex(world, 2.5F);
|
||||
vortex.posX = player.posX;
|
||||
vortex.posY = player.posY - 15;
|
||||
vortex.posZ = player.posZ;
|
||||
world.spawnEntityInWorld(vortex);
|
||||
break;
|
||||
case 28:
|
||||
EntityMIRV mirv = new EntityMIRV(world);
|
||||
mirv.posX = player.posX;
|
||||
mirv.posY = player.posY + 100;
|
||||
mirv.posZ = player.posZ;
|
||||
world.spawnEntityInWorld(mirv);
|
||||
player.addChatMessage(new ChatComponentText("Watch your head..."));
|
||||
break;
|
||||
case 29:
|
||||
ExplosionLarge.spawnBurst(world, player.posX, player.posY, player.posZ, 27, 3);
|
||||
player.addChatMessage(new ChatComponentText("Bam!"));
|
||||
break;
|
||||
case 30:
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.plate_dineutronium));
|
||||
player.addChatMessage(new ChatComponentText("Stare at it. No really, stare at it until you understand. Stare at it more. Stop reading this text, STARE AT IT!"));
|
||||
break;
|
||||
}
|
||||
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
44
com/hbm/items/tool/ItemDesingatorManual.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemDesingatorManual extends Item {
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
|
||||
if(world.isRemote)
|
||||
player.openGui(MainRegistry.instance, ModItems.guiID_item_designator, world, 0, 0, 0);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreated(ItemStack p_77622_1_, World p_77622_2_, EntityPlayer p_77622_3_) {
|
||||
p_77622_1_.stackTagCompound = new NBTTagCompound();
|
||||
p_77622_1_.stackTagCompound.setInteger("xCoord", 0);
|
||||
p_77622_1_.stackTagCompound.setInteger("zCoord", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
if(stack.stackTagCompound != null)
|
||||
{
|
||||
list.add("Target Coordinates:");
|
||||
list.add("X: " + String.valueOf(stack.stackTagCompound.getInteger("xCoord")));
|
||||
list.add("Z: " + String.valueOf(stack.stackTagCompound.getInteger("zCoord")));
|
||||
} else {
|
||||
list.add("Please select a target.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,7 @@ import com.hbm.main.MainRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.ArrowNockEvent;
|
||||
|
||||
92
com/hbm/packet/ItemDesignatorPacket.java
Normal file
@ -0,0 +1,92 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemAssemblyTemplate;
|
||||
import com.hbm.items.tool.ItemCassette;
|
||||
import com.hbm.items.tool.ItemChemistryTemplate;
|
||||
import com.hbm.items.tool.ItemFluidIdentifier;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ItemDesignatorPacket implements IMessage {
|
||||
|
||||
//0: Add
|
||||
//1: Subtract
|
||||
//2: Set
|
||||
int operator;
|
||||
int value;
|
||||
int reference;
|
||||
|
||||
public ItemDesignatorPacket()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ItemDesignatorPacket(int operator, int value, int reference)
|
||||
{
|
||||
this.operator = operator;
|
||||
this.value = value;
|
||||
this.reference = reference;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
operator = buf.readInt();
|
||||
value = buf.readInt();
|
||||
reference = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(operator);
|
||||
buf.writeInt(value);
|
||||
buf.writeInt(reference);
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<ItemDesignatorPacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(ItemDesignatorPacket m, MessageContext ctx) {
|
||||
|
||||
EntityPlayer p = ctx.getServerHandler().playerEntity;
|
||||
|
||||
ItemStack stack = p.getHeldItem();
|
||||
|
||||
if(stack != null && stack.getItem() == ModItems.designator_manual) {
|
||||
if(!stack.hasTagCompound())
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
int x = stack.stackTagCompound.getInteger("xCoord");
|
||||
int z = stack.stackTagCompound.getInteger("zCoord");
|
||||
|
||||
int result = 0;
|
||||
|
||||
if(m.operator == 0)
|
||||
result += m.value;
|
||||
if(m.operator == 1)
|
||||
result -= m.value;
|
||||
if(m.operator == 2) {
|
||||
if(m.reference == 0)
|
||||
stack.stackTagCompound.setInteger("xCoord", (int)Math.round(p.posX));
|
||||
else
|
||||
stack.stackTagCompound.setInteger("zCoord", (int)Math.round(p.posZ));
|
||||
return null;
|
||||
}
|
||||
|
||||
if(m.reference == 0)
|
||||
stack.stackTagCompound.setInteger("xCoord", x + result);
|
||||
else
|
||||
stack.stackTagCompound.setInteger("zCoord", z + result);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -55,6 +55,8 @@ public class PacketDispatcher {
|
||||
wrapper.registerMessage(AuxGaugePacket.Handler.class, AuxGaugePacket.class, i++, Side.CLIENT);
|
||||
//Siren packet for looped sounds
|
||||
wrapper.registerMessage(TESirenPacket.Handler.class, TESirenPacket.class, i++, Side.CLIENT);
|
||||
//Signals server to change ItemStack's
|
||||
wrapper.registerMessage(ItemDesignatorPacket.Handler.class, ItemDesignatorPacket.class, i++, Side.SERVER);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ public class ModelBoltAction extends ModelBase {
|
||||
setRotation(LeverMid, 0F, 0F, 0F);
|
||||
Trigger = new ModelRenderer(this, 88, 30);
|
||||
Trigger.addBox(-1F, 0F, 0F, 1, 3, 1);
|
||||
Trigger.setRotationPoint(12.5F, 9F, -2.5F);
|
||||
Trigger.setRotationPoint(12.5F, 9F, -0.5F);
|
||||
Trigger.setTextureSize(64, 32);
|
||||
Trigger.mirror = true;
|
||||
setRotation(Trigger, 0F, 0F, 0.3490659F);
|
||||
|
||||
@ -36,7 +36,7 @@ public class RenderAMSLimiter extends TileEntitySpecialRenderer {
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
bindTexture(ResourceManager.universal);
|
||||
bindTexture(ResourceManager.ams_limiter_tex);
|
||||
|
||||
if(((TileEntityAMSLimiter)tileEntity).locked)
|
||||
ResourceManager.ams_limiter_destroyed.renderAll();
|
||||
@ -68,7 +68,7 @@ public class RenderAMSLimiter extends TileEntitySpecialRenderer {
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
bindTexture(ResourceManager.universal);
|
||||
// bindTexture(ResourceManager.universal);
|
||||
|
||||
TileEntityAMSLimiter limiter = (TileEntityAMSLimiter)tileEntity;
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ public class TileEntityLaunchPad extends TileEntity implements ISidedInventory,
|
||||
public final long maxPower = 100000;
|
||||
|
||||
private static final int[] slots_top = new int[] {0};
|
||||
private static final int[] slots_bottom = new int[] {2};
|
||||
private static final int[] slots_side = new int[] {1};
|
||||
private static final int[] slots_bottom = new int[] { 0, 1, 2};
|
||||
private static final int[] slots_side = new int[] {0};
|
||||
public int state = 0;
|
||||
|
||||
private String customName;
|
||||
|
||||
@ -88,7 +88,12 @@ public abstract class TileEntityTurretBase extends TileEntity {
|
||||
if(e instanceof EntityPlayer && ((EntityPlayer)e).getUniqueID().toString().equals(uuid))
|
||||
return false;
|
||||
|
||||
Vec3 turret = Vec3.createVectorHelper(xCoord + 0.5, yCoord + 1, zCoord + 0.5);
|
||||
Vec3 turret;
|
||||
if(this instanceof TileEntityTurretSpitfire)
|
||||
turret = Vec3.createVectorHelper(xCoord + 0.5, yCoord + 1.5, zCoord + 0.5);
|
||||
else
|
||||
turret = Vec3.createVectorHelper(xCoord + 0.5, yCoord + 1, zCoord + 0.5);
|
||||
|
||||
Vec3 entity = Vec3.createVectorHelper(e.posX, e.posY + e.getEyeHeight(), e.posZ);
|
||||
Vec3 side = Vec3.createVectorHelper(entity.xCoord - turret.xCoord, entity.yCoord - turret.yCoord, entity.zCoord - turret.zCoord);
|
||||
side = side.normalize();
|
||||
|
||||