0000000000

This commit is contained in:
Boblet 2024-03-04 16:44:34 +01:00
parent ec389b72f9
commit 23e58c7e1d
19 changed files with 475 additions and 34 deletions

View File

@ -26,6 +26,9 @@
* Fluid traits are now listed in a fixed order instead of being arranged randomly * Fluid traits are now listed in a fixed order instead of being arranged randomly
* Hidden fluid trait descriptions will now be added below the visible part of that trait instead of below the last visible trait * Hidden fluid trait descriptions will now be added below the visible part of that trait instead of below the last visible trait
* The methusalem turret no longer drops anything when broken * The methusalem turret no longer drops anything when broken
* Gaseous fuels now have a combusion multiplier of 1.5 instead of 1.25
* LPG now has half the base burn value, preventing an unreasonable jump in efficiency simply by liquefacting petroleum gas
* While overall slightly less efficient that petroleum gas per unit of petroleum needed, LPG is still very much desirable due to being much easier to burn at max efficiency
## Fixed ## Fixed
* Fixed the structure toggle on the world creation screen not working correctly on most world types * Fixed the structure toggle on the world creation screen not working correctly on most world types

View File

@ -1048,6 +1048,7 @@ public class ModBlocks {
public static Block machine_orbus; public static Block machine_orbus;
public static Block launch_pad; public static Block launch_pad;
public static Block launch_pad_rusted;
public static Block launch_pad_large; public static Block launch_pad_large;
public static Block machine_missile_assembly; public static Block machine_missile_assembly;
@ -2167,6 +2168,7 @@ public class ModBlocks {
tesla = new MachineTesla(Material.iron).setBlockName("tesla").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":tesla"); tesla = new MachineTesla(Material.iron).setBlockName("tesla").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":tesla");
launch_pad = new LaunchPad(Material.iron).setBlockName("launch_pad").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":launch_pad"); launch_pad = new LaunchPad(Material.iron).setBlockName("launch_pad").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":launch_pad");
launch_pad_rusted = new LaunchPadRusted(Material.iron).setBlockName("launch_pad_rusted").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":launch_pad_rusted");
launch_pad_large = new LaunchPadLarge(Material.iron).setBlockName("launch_pad_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); launch_pad_large = new LaunchPadLarge(Material.iron).setBlockName("launch_pad_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_radar = new MachineRadar(Material.iron).setBlockName("machine_radar").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":machine_radar"); machine_radar = new MachineRadar(Material.iron).setBlockName("machine_radar").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":machine_radar");
machine_radar_large = new MachineRadarLarge(Material.iron).setBlockName("machine_radar_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":block_steel"); machine_radar_large = new MachineRadarLarge(Material.iron).setBlockName("machine_radar_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
@ -3517,6 +3519,7 @@ public class ModBlocks {
//Missile Blocks //Missile Blocks
GameRegistry.registerBlock(machine_missile_assembly, machine_missile_assembly.getUnlocalizedName()); GameRegistry.registerBlock(machine_missile_assembly, machine_missile_assembly.getUnlocalizedName());
GameRegistry.registerBlock(launch_pad, launch_pad.getUnlocalizedName()); GameRegistry.registerBlock(launch_pad, launch_pad.getUnlocalizedName());
GameRegistry.registerBlock(launch_pad_rusted, launch_pad_rusted.getUnlocalizedName());
GameRegistry.registerBlock(launch_pad_large, launch_pad_large.getUnlocalizedName()); GameRegistry.registerBlock(launch_pad_large, launch_pad_large.getUnlocalizedName());
GameRegistry.registerBlock(compact_launcher, compact_launcher.getUnlocalizedName()); GameRegistry.registerBlock(compact_launcher, compact_launcher.getUnlocalizedName());
GameRegistry.registerBlock(launch_table, launch_table.getUnlocalizedName()); GameRegistry.registerBlock(launch_table, launch_table.getUnlocalizedName());

View File

@ -0,0 +1,81 @@
package com.hbm.blocks.bomb;
import com.hbm.blocks.BlockDummyable;
import com.hbm.interfaces.IBomb;
import com.hbm.tileentity.bomb.TileEntityLaunchPadRusted;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class LaunchPadRusted extends BlockDummyable implements IBomb {
public LaunchPadRusted(Material mat) {
super(mat);
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.5D, 0D, -1.5D, -0.5D, 1D, -0.5D));
this.bounding.add(AxisAlignedBB.getBoundingBox(0.5D, 0D, -1.5D, 1.5D, 1D, -0.5D));
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.5D, 0D, 0.5D, -0.5D, 1D, 1.5D));
this.bounding.add(AxisAlignedBB.getBoundingBox(0.5D, 0D, 0.5D, 1.5D, 1D, 1.5D));
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.5D, 0.5D, -1.5D, 0.5D, 1D, 1.5D));
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.5D, 0.5D, -0.5D, 1.5D, 1D, 0.5D));
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityLaunchPadRusted();
return null;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
return this.standardOpenBehavior(world, x, y, z, player, 0);
}
@Override
public int[] getDimensions() {
return new int[] {0, 0, 1, 1, 1, 1};
}
@Override
public int getOffset() {
return 1;
}
@Override
public BombReturnCode explode(World world, int x, int y, int z) {
if(!world.isRemote) {
int[] corePos = findCore(world, x, y, z);
if(corePos != null){
TileEntity core = world.getTileEntity(corePos[0], corePos[1], corePos[2]);
if(core instanceof TileEntityLaunchPadRusted){
TileEntityLaunchPadRusted entity = (TileEntityLaunchPadRusted)core;
return entity.launch();
}
}
}
return BombReturnCode.UNDEFINED;
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block blockIn){
if(!world.isRemote){
int[] corePos = findCore(world, x, y, z);
if(corePos != null){
TileEntity core = world.getTileEntity(corePos[0], corePos[1], corePos[2]);
if(core instanceof TileEntityLaunchPadRusted){
TileEntityLaunchPadRusted launchpad = (TileEntityLaunchPadRusted)core;
launchpad.updateRedstonePower(x, y, z);
}
}
}
super.onNeighborBlockChange( world, x, y, z, blockIn);
}
}

View File

@ -155,17 +155,19 @@ public class BlockSnowglobe extends BlockContainer implements IGUIProvider {
} }
public static enum SnowglobeType { public static enum SnowglobeType {
NONE( "NONE"), NONE( "NONE", null),
RIVETCITY( "Rivet City"), RIVETCITY( "Rivet City", "Welcome to Rivet City. Please wait while the bridge extends."),
TENPENNYTOWER( "Tenpenny Tower"), TENPENNYTOWER( "Tenpenny Tower", "Tenpenny Tower is the brainchild of Allistair Tenpenny, a British refugee who came to the Capital Wasteland seeking his fortune."),
LUCKY38( "Lucky 38"), LUCKY38( "Lucky 38", "My guess? Leads to a big cashout at some casino - and if the \"38\" on it is any indication... well... Lucky 38 it is."),
SIERRAMADRE( "Sierra Madre"), SIERRAMADRE( "Sierra Madre", "It's the moment you've been waiting for, the reason we're all here - the Gala Event, the Grand Opening of the Sierra Madre Casino."),
PRYDWEN( "Prydwen"); PRYDWEN( "Prydwen", "People of the Commonwealth. Do not interfere. Our intentions are peaceful. We are the Brotherhood of Steel.");
public String label; public String label;
public String inscription;
private SnowglobeType(String label) { private SnowglobeType(String label, String inscription) {
this.label = label; this.label = label;
this.inscription = inscription;
} }
} }

View File

@ -0,0 +1,37 @@
package com.hbm.inventory.container;
import com.hbm.tileentity.bomb.TileEntityLaunchPadRusted;
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 ContainerLaunchPadRusted extends Container {
private TileEntityLaunchPadRusted launchpad;
public ContainerLaunchPadRusted(InventoryPlayer invPlayer, TileEntityLaunchPadRusted tedf) {
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 154 + i * 18));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 212));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int par2) {
return null;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return launchpad.isUseableByPlayer(player);
}
}

View File

@ -621,8 +621,8 @@ public class Fluids {
registerCalculatedFuel(CRACKOIL, (baseline / 1D * flammabilityLow * demandLow * complexityCracking), 0, null); registerCalculatedFuel(CRACKOIL, (baseline / 1D * flammabilityLow * demandLow * complexityCracking), 0, null);
registerCalculatedFuel(CRACKOIL_DS, (baseline / 1D * flammabilityLow * demandLow * complexityCracking * complexityHydro), 0, null); registerCalculatedFuel(CRACKOIL_DS, (baseline / 1D * flammabilityLow * demandLow * complexityCracking * complexityHydro), 0, null);
registerCalculatedFuel(OIL_COKER, (baseline / 1D * flammabilityLow * demandLow * complexityCoker), 0, null); registerCalculatedFuel(OIL_COKER, (baseline / 1D * flammabilityLow * demandLow * complexityCoker), 0, null);
registerCalculatedFuel(GAS, (baseline / 1D * flammabilityNormal * demandVeryLow), 1.25, FuelGrade.GAS); registerCalculatedFuel(GAS, (baseline / 1D * flammabilityNormal * demandVeryLow), 1.5, FuelGrade.GAS);
registerCalculatedFuel(GAS_COKER, (baseline / 1D * flammabilityNormal * demandVeryLow * complexityCoker), 1.25, FuelGrade.GAS); registerCalculatedFuel(GAS_COKER, (baseline / 1D * flammabilityNormal * demandVeryLow * complexityCoker), 1.5, FuelGrade.GAS);
registerCalculatedFuel(HEAVYOIL, (baseline / 0.5 * flammabilityLow * demandLow * complexityRefinery), 1.25D, FuelGrade.LOW); registerCalculatedFuel(HEAVYOIL, (baseline / 0.5 * flammabilityLow * demandLow * complexityRefinery), 1.25D, FuelGrade.LOW);
registerCalculatedFuel(SMEAR, (baseline / 0.35 * flammabilityLow * demandLow * complexityRefinery * complexityFraction), 1.25D, FuelGrade.LOW); registerCalculatedFuel(SMEAR, (baseline / 0.35 * flammabilityLow * demandLow * complexityRefinery * complexityFraction), 1.25D, FuelGrade.LOW);
registerCalculatedFuel(RECLAIMED, (baseline / 0.28 * flammabilityLow * demandLow * complexityRefinery * complexityFraction * complexityChemplant), 1.25D, FuelGrade.LOW); registerCalculatedFuel(RECLAIMED, (baseline / 0.28 * flammabilityLow * demandLow * complexityRefinery * complexityFraction * complexityChemplant), 1.25D, FuelGrade.LOW);
@ -641,10 +641,10 @@ public class Fluids {
registerCalculatedFuel(LIGHTOIL_DS, (baseline / 0.15 * flammabilityNormal * demandHigh * complexityRefinery * complexityHydro), 1.5D, FuelGrade.MEDIUM); registerCalculatedFuel(LIGHTOIL_DS, (baseline / 0.15 * flammabilityNormal * demandHigh * complexityRefinery * complexityHydro), 1.5D, FuelGrade.MEDIUM);
registerCalculatedFuel(LIGHTOIL_CRACK, (baseline / 0.30 * flammabilityNormal * demandHigh * complexityRefinery * complexityCracking), 1.5D, FuelGrade.MEDIUM); registerCalculatedFuel(LIGHTOIL_CRACK, (baseline / 0.30 * flammabilityNormal * demandHigh * complexityRefinery * complexityCracking), 1.5D, FuelGrade.MEDIUM);
registerCalculatedFuel(KEROSENE, (baseline / 0.09 * flammabilityNormal * demandHigh * complexityRefinery * complexityFraction), 1.5D, FuelGrade.AERO); registerCalculatedFuel(KEROSENE, (baseline / 0.09 * flammabilityNormal * demandHigh * complexityRefinery * complexityFraction), 1.5D, FuelGrade.AERO);
registerCalculatedFuel(PETROLEUM, (baseline / 0.10 * flammabilityNormal * demandMedium * complexityRefinery), 1.25, FuelGrade.GAS); registerCalculatedFuel(PETROLEUM, (baseline / 0.10 * flammabilityNormal * demandMedium * complexityRefinery), 1.5, FuelGrade.GAS);
registerCalculatedFuel(AROMATICS, (baseline / 0.15 * flammabilityLow * demandHigh * complexityRefinery * complexityCracking), 0, null); registerCalculatedFuel(AROMATICS, (baseline / 0.15 * flammabilityLow * demandHigh * complexityRefinery * complexityCracking), 0, null);
registerCalculatedFuel(UNSATURATEDS, (baseline / 0.15 * flammabilityHigh * demandHigh * complexityRefinery * complexityCracking), 0, null); registerCalculatedFuel(UNSATURATEDS, (baseline / 0.15 * flammabilityHigh * demandHigh * complexityRefinery * complexityCracking), 0, null);
registerCalculatedFuel(LPG, (baseline / 0.05 * flammabilityNormal * demandMedium * complexityRefinery * complexityChemplant), 2.5, FuelGrade.HIGH); registerCalculatedFuel(LPG, (baseline / 0.1 * flammabilityNormal * demandMedium * complexityRefinery * complexityChemplant), 2.5, FuelGrade.HIGH);
registerCalculatedFuel(NITAN, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * 25L, 2.5, FuelGrade.HIGH); registerCalculatedFuel(NITAN, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * 25L, 2.5, FuelGrade.HIGH);
registerCalculatedFuel(BALEFIRE, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * 100L, 2.5, FuelGrade.HIGH); registerCalculatedFuel(BALEFIRE, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * 100L, 2.5, FuelGrade.HIGH);
registerCalculatedFuel(HEAVYOIL_VACUUM, (baseline / 0.4 * flammabilityLow * demandLow * complexityVacuum), 1.25D, FuelGrade.LOW); registerCalculatedFuel(HEAVYOIL_VACUUM, (baseline / 0.4 * flammabilityLow * demandLow * complexityVacuum), 1.25D, FuelGrade.LOW);
@ -656,7 +656,7 @@ public class Fluids {
registerCalculatedFuel(DIESEL_REFORM, DIESEL.getTrait(FT_Flammable.class).getHeatEnergy() * complexityReform, 2.5D, FuelGrade.HIGH); registerCalculatedFuel(DIESEL_REFORM, DIESEL.getTrait(FT_Flammable.class).getHeatEnergy() * complexityReform, 2.5D, FuelGrade.HIGH);
registerCalculatedFuel(DIESEL_CRACK_REFORM, DIESEL_CRACK.getTrait(FT_Flammable.class).getHeatEnergy() * complexityReform, 2.5D, FuelGrade.HIGH); registerCalculatedFuel(DIESEL_CRACK_REFORM, DIESEL_CRACK.getTrait(FT_Flammable.class).getHeatEnergy() * complexityReform, 2.5D, FuelGrade.HIGH);
registerCalculatedFuel(KEROSENE_REFORM, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * complexityReform, 1.5D, FuelGrade.AERO); registerCalculatedFuel(KEROSENE_REFORM, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * complexityReform, 1.5D, FuelGrade.AERO);
registerCalculatedFuel(REFORMGAS, (baseline / 0.06 * flammabilityHigh * demandLow * complexityVacuum * complexityFraction), 1.25D, FuelGrade.GAS); registerCalculatedFuel(REFORMGAS, (baseline / 0.06 * flammabilityHigh * demandLow * complexityVacuum * complexityFraction), 1.5D, FuelGrade.GAS);
//all hail the spreadsheet //all hail the spreadsheet
//the spreadsheet must not be questioned //the spreadsheet must not be questioned

View File

@ -284,7 +284,7 @@ public class GUIAnvil extends GuiContainer {
for(AStack stack : recipe.input) { for(AStack stack : recipe.input) {
if(stack instanceof ComparableStack) { if(stack instanceof ComparableStack) {
ItemStack input = ((ComparableStack) stack).toStack(); ComparableStack input = (ComparableStack) stack;
boolean hasItem = false; boolean hasItem = false;
int amount = 0; int amount = 0;
for(int i = 0; i < inventory.mainInventory.length; i++) { for(int i = 0; i < inventory.mainInventory.length; i++) {
@ -292,15 +292,15 @@ public class GUIAnvil extends GuiContainer {
if(stackItem == null) { if(stackItem == null) {
continue; continue;
} }
if(stackItem.getItem() == input.getItem() && input.getItemDamage() == stackItem.getItemDamage()) { if(input.matchesRecipe(stackItem, true)) {
hasItem = true; hasItem = true;
amount += stackItem.stackSize; amount += stackItem.stackSize;
} }
} }
if(hasItem && amount >= stack.stacksize) { if(hasItem && amount >= stack.stacksize) {
list.add(">" + input.stackSize + "x " + input.getDisplayName()); list.add(">" + input.stacksize + "x " + input.toStack().getDisplayName());
} else { } else {
list.add(EnumChatFormatting.RED + ">" + input.stackSize + "x " + input.getDisplayName()); list.add(EnumChatFormatting.RED + ">" + input.stacksize + "x " + input.toStack().getDisplayName());
} }
} else if(stack instanceof OreDictStack) { } else if(stack instanceof OreDictStack) {
OreDictStack input = (OreDictStack) stack; OreDictStack input = (OreDictStack) stack;

View File

@ -0,0 +1,84 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerLaunchPadRusted;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.bomb.TileEntityLaunchPadRusted;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUILaunchPadRusted extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/gui_launch_pad_rusted.png");
private TileEntityLaunchPadRusted launchpad;
public GUILaunchPadRusted(InventoryPlayer invPlayer, TileEntityLaunchPadRusted tedf) {
super(new ContainerLaunchPadRusted(invPlayer, tedf));
launchpad = tedf;
this.xSize = 176;
this.ySize = 236;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.launchpad.hasCustomInventoryName() ? this.launchpad.getInventoryName() : I18n.format(this.launchpad.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 4, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
/*if(launchpad.slots[0] != null) {
Consumer<TextureManager> renderer = ItemRenderMissileGeneric.renderers.get(new ComparableStack(launchpad.slots[0]).makeSingular());
if(renderer != null) {
GL11.glPushMatrix();
GL11.glTranslatef(guiLeft + 70, guiTop + 120, 100);
double scale = 1D;
if(launchpad.slots[0].getItem() instanceof ItemMissile) {
ItemMissile missile = (ItemMissile) launchpad.slots[0].getItem();
switch(missile.formFactor) {
case ABM: scale = 1.45D; break;
case MICRO: scale = 2.5D; break;
case V2: scale = 1.75D; break;
case STRONG: scale = 1.375D; break;
case HUGE: scale = 0.925D; break;
case ATLAS: scale = 0.875D; break;
case OTHER: break;
}
if(missile == ModItems.missile_stealth) scale = 1.125D;
}
GL11.glRotatef(90, 0, 1, 0);
GL11.glScaled(scale, scale, scale);
GL11.glScalef(-8, -8, -8);
GL11.glPushMatrix();
GL11.glRotatef(75, 0.0F, 1.0F, 0.0F);
RenderHelper.enableStandardItemLighting();
GL11.glPopMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
renderer.accept(Minecraft.getMinecraft().getTextureManager());
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}*/
}
}

View File

@ -1,8 +1,11 @@
package com.hbm.inventory.gui; package com.hbm.inventory.gui;
import java.util.List;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe; import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
import com.hbm.util.I18nUtil;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
@ -78,7 +81,7 @@ public class GUIScreenSnowglobe extends GuiScreen {
} }
nextLevel += 10; nextLevel += 10;
} }*/
if(this.snowglobe.type.inscription != null) { if(this.snowglobe.type.inscription != null) {
@ -87,14 +90,14 @@ public class GUIScreenSnowglobe extends GuiScreen {
nextLevel += 10; nextLevel += 10;
String[] list = this.snowglobe.type.inscription.split("\\$"); List<String> list = I18nUtil.autoBreakWithParagraphs(this.fontRendererObj, this.snowglobe.type.inscription, 280);
for(String text : list) { for(String text : list) {
this.fontRendererObj.drawStringWithShadow(text, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(text) / 2), nextLevel, 0x009900); this.fontRendererObj.drawStringWithShadow(text, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(text) / 2), nextLevel, 0x009900);
nextLevel += 10; nextLevel += 10;
} }
nextLevel += 10; nextLevel += 10;
}*/ }
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
} }

View File

@ -23,6 +23,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class AnvilRecipes { public class AnvilRecipes {
@ -753,7 +754,7 @@ public class AnvilRecipes {
new AnvilOutput(new ItemStack(ModItems.ingot_tcalloy, 1), 0.25F) new AnvilOutput(new ItemStack(ModItems.ingot_tcalloy, 1), 0.25F)
} }
).setTier(3)); ).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe( constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.deco_computer), new ComparableStack(ModBlocks.deco_computer),
new AnvilOutput[] { new AnvilOutput[] {
@ -765,6 +766,58 @@ public class AnvilRecipes {
} }
).setTier(2)); ).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.deco_crt, 1, OreDictionary.WILDCARD_VALUE),
new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.crt_display, 1)),
new AnvilOutput(new ItemStack(ModItems.scrap, 2)),
new AnvilOutput(new ItemStack(ModItems.wire_copper, 2)),
new AnvilOutput(new ItemStack(ModItems.wire_gold, 2), 0.25F),
new AnvilOutput(new ItemStack(ModItems.circuit_aluminium, 1), 0.25F)
}
).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.deco_toaster, 1, 0), //iron toaster
new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.plate_iron, 3)),
new AnvilOutput(new ItemStack(ModItems.scrap, 1)),
new AnvilOutput(new ItemStack(ModItems.coil_tungsten, 1)),
new AnvilOutput(new ItemStack(Items.bread, 1), 0.5F),
new AnvilOutput(new ItemStack(ModItems.battery_generic, 1), 0.25F),
new AnvilOutput(new ItemStack(ModItems.battery_advanced, 1), 0.1F),
new AnvilOutput(new ItemStack(ModItems.fusion_core, 1), 0.01F)
}
).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.deco_toaster, 1, 1), // steel toaster
new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.plate_steel, 3)),
new AnvilOutput(new ItemStack(ModItems.scrap, 1)),
new AnvilOutput(new ItemStack(ModItems.coil_tungsten, 2)),
new AnvilOutput(new ItemStack(Items.bread, 1), 0.5F),
new AnvilOutput(new ItemStack(ModItems.battery_lithium, 1), 0.25F),
new AnvilOutput(new ItemStack(ModItems.battery_sc_uranium, 1), 0.1F),
new AnvilOutput(new ItemStack(ModItems.fusion_core, 1), 0.05F)
}
).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.deco_toaster, 1, 2), // wooden toaster
new AnvilOutput[] {
new AnvilOutput(new ItemStack(ModItems.powder_sawdust, 4)),
new AnvilOutput(new ItemStack(ModItems.scrap, 1)),
new AnvilOutput(new ItemStack(ModItems.coil_tungsten, 4)),
new AnvilOutput(new ItemStack(Items.bread, 1), 0.5F),
new AnvilOutput(new ItemStack(ModItems.fusion_core, 1), 0.5F),
new AnvilOutput(new ItemStack(ModItems.fusion_core, 1), 0.5F),
new AnvilOutput(new ItemStack(ModItems.gem_alexandrite, 1), 0.25F),
new AnvilOutput(new ItemStack(ModItems.flame_pony, 1), 0.01F)
}
).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe( constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModBlocks.filing_cabinet), new ComparableStack(ModBlocks.filing_cabinet),
new AnvilOutput[] { new AnvilOutput[] {

View File

@ -1303,6 +1303,10 @@ public class ModItems {
public static Item bobmazon_tools; public static Item bobmazon_tools;
public static Item bobmazon_hidden; public static Item bobmazon_hidden;
public static Item launch_code_piece;
public static Item launch_code;
public static Item launch_key;
public static Item missile_assembly; public static Item missile_assembly;
public static Item missile_generic; public static Item missile_generic;
public static Item missile_anti_ballistic; public static Item missile_anti_ballistic;
@ -3929,6 +3933,9 @@ public class ModItems {
designator_range = new ItemDesingatorRange().setUnlocalizedName("designator_range").setFull3D().setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":designator_range_alt"); designator_range = new ItemDesingatorRange().setUnlocalizedName("designator_range").setFull3D().setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":designator_range_alt");
designator_manual = new ItemDesingatorManual().setUnlocalizedName("designator_manual").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":designator_manual"); designator_manual = new ItemDesingatorManual().setUnlocalizedName("designator_manual").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":designator_manual");
designator_arty_range = new ItemDesignatorArtyRange().setUnlocalizedName("designator_arty_range").setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":designator_arty_range"); designator_arty_range = new ItemDesignatorArtyRange().setUnlocalizedName("designator_arty_range").setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":designator_arty_range");
launch_code_piece = new Item().setUnlocalizedName("launch_code_piece").setMaxStackSize(1).setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":launch_code_piece");
launch_code = new Item().setUnlocalizedName("launch_code").setMaxStackSize(1).setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":launch_code");
launch_key = new Item().setUnlocalizedName("launch_key").setMaxStackSize(1).setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":launch_key");
missile_assembly = new Item().setUnlocalizedName("missile_assembly").setMaxStackSize(1).setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":missile_assembly"); missile_assembly = new Item().setUnlocalizedName("missile_assembly").setMaxStackSize(1).setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":missile_assembly");
missile_generic = new ItemMissile(MissileFormFactor.V2, MissileTier.TIER1).setUnlocalizedName("missile_generic").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_generic"); missile_generic = new ItemMissile(MissileFormFactor.V2, MissileTier.TIER1).setUnlocalizedName("missile_generic").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_generic");
missile_anti_ballistic = new ItemMissile(MissileFormFactor.ABM, MissileTier.TIER1).setUnlocalizedName("missile_anti_ballistic").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_anti_ballistic"); missile_anti_ballistic = new ItemMissile(MissileFormFactor.ABM, MissileTier.TIER1).setUnlocalizedName("missile_anti_ballistic").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_anti_ballistic");
@ -6843,9 +6850,7 @@ public class ModItems {
GameRegistry.registerItem(designator_range, designator_range.getUnlocalizedName()); GameRegistry.registerItem(designator_range, designator_range.getUnlocalizedName());
GameRegistry.registerItem(designator_manual, designator_manual.getUnlocalizedName()); GameRegistry.registerItem(designator_manual, designator_manual.getUnlocalizedName());
GameRegistry.registerItem(designator_arty_range, designator_arty_range.getUnlocalizedName()); GameRegistry.registerItem(designator_arty_range, designator_arty_range.getUnlocalizedName());
//GameRegistry.registerItem(turret_control, turret_control.getUnlocalizedName());
GameRegistry.registerItem(turret_chip, turret_chip.getUnlocalizedName()); GameRegistry.registerItem(turret_chip, turret_chip.getUnlocalizedName());
//GameRegistry.registerItem(turret_biometry, turret_biometry.getUnlocalizedName());
GameRegistry.registerItem(linker, linker.getUnlocalizedName()); GameRegistry.registerItem(linker, linker.getUnlocalizedName());
GameRegistry.registerItem(reactor_sensor, reactor_sensor.getUnlocalizedName()); GameRegistry.registerItem(reactor_sensor, reactor_sensor.getUnlocalizedName());
GameRegistry.registerItem(oil_detector, oil_detector.getUnlocalizedName()); GameRegistry.registerItem(oil_detector, oil_detector.getUnlocalizedName());
@ -6877,6 +6882,9 @@ public class ModItems {
GameRegistry.registerItem(padlock, padlock.getUnlocalizedName()); GameRegistry.registerItem(padlock, padlock.getUnlocalizedName());
GameRegistry.registerItem(padlock_reinforced, padlock_reinforced.getUnlocalizedName()); GameRegistry.registerItem(padlock_reinforced, padlock_reinforced.getUnlocalizedName());
GameRegistry.registerItem(padlock_unbreakable, padlock_unbreakable.getUnlocalizedName()); GameRegistry.registerItem(padlock_unbreakable, padlock_unbreakable.getUnlocalizedName());
GameRegistry.registerItem(launch_code_piece, launch_code_piece.getUnlocalizedName());
GameRegistry.registerItem(launch_code, launch_code.getUnlocalizedName());
GameRegistry.registerItem(launch_key, launch_key.getUnlocalizedName());
//Missiles //Missiles
//Tier 0 //Tier 0

View File

@ -3,17 +3,25 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockSnowglobe.SnowglobeType;
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe; import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.render.item.ItemRenderBase;
import com.hbm.render.loader.HFRWavefrontObject; import com.hbm.render.loader.HFRWavefrontObject;
import com.hbm.util.EnumUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
public class RenderSnowglobe extends TileEntitySpecialRenderer { public class RenderSnowglobe extends TileEntitySpecialRenderer implements IItemRendererProvider {
public static final IModelCustom snowglobe = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/trinkets/snowglobe.obj"), false).asDisplayList(); public static final IModelCustom snowglobe = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/trinkets/snowglobe.obj"), false).asDisplayList();
public static final ResourceLocation socket = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/snowglobe.png"); public static final ResourceLocation socket = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/snowglobe.png");
@ -25,21 +33,29 @@ public class RenderSnowglobe extends TileEntitySpecialRenderer {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z + 0.5); GL11.glTranslated(x + 0.5, y, z + 0.5);
GL11.glRotated(22.5D * tile.getBlockMetadata() + 90, 0, -1, 0);
TileEntitySnowglobe te = (TileEntitySnowglobe) tile;
renderSnowglobe(te.type);
GL11.glPopMatrix();
}
public static void renderSnowglobe(SnowglobeType type) {
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glRotated(22.5D * tile.getBlockMetadata() + 90, 0, -1, 0);
double scale = 0.0625D; double scale = 0.0625D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
this.bindTexture(socket); Minecraft.getMinecraft().getTextureManager().bindTexture(socket);
snowglobe.renderPart("Socket"); snowglobe.renderPart("Socket");
TileEntitySnowglobe te = (TileEntitySnowglobe) tile;
this.bindTexture(features);
switch(te.type) { Minecraft.getMinecraft().getTextureManager().bindTexture(features);
switch(type) {
case NONE: break; case NONE: break;
case RIVETCITY: snowglobe.renderPart("RivetCity"); break; case RIVETCITY: snowglobe.renderPart("RivetCity"); break;
case TENPENNYTOWER: snowglobe.renderPart("TenpennyTower"); break; case TENPENNYTOWER: snowglobe.renderPart("TenpennyTower"); break;
@ -48,7 +64,28 @@ public class RenderSnowglobe extends TileEntitySpecialRenderer {
case PRYDWEN: snowglobe.renderPart("Prydwen"); break; case PRYDWEN: snowglobe.renderPart("Prydwen"); break;
default: break; default: break;
} }
GL11.glPopMatrix(); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glShadeModel(GL11.GL_FLAT);
}
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.snowglobe);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -4, 0);
GL11.glScaled(10, 10, 10);
}
public void renderCommonWithStack(ItemStack item) {
GL11.glTranslated(0, 0.25, 0);
GL11.glScaled(3, 3, 3);
SnowglobeType type = EnumUtil.grabEnumSafely(SnowglobeType.class, item.getItemDamage());
renderSnowglobe(type);
}};
} }
} }

View File

@ -88,14 +88,12 @@ public class TileEntityLaunchPad extends TileEntityLaunchPadBase implements IEne
@Override @Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt); super.readFromNBT(nbt);
this.delay = nbt.getInteger("delay"); this.delay = nbt.getInteger("delay");
} }
@Override @Override
public void writeToNBT(NBTTagCompound nbt) { public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setInteger("delay", delay); nbt.setInteger("delay", delay);
} }

View File

@ -0,0 +1,132 @@
package com.hbm.tileentity.bomb;
import java.util.HashSet;
import java.util.Set;
import com.hbm.interfaces.IBomb.BombReturnCode;
import com.hbm.inventory.container.ContainerLaunchPadRusted;
import com.hbm.inventory.gui.GUILaunchPadRusted;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.fauxpointtwelve.BlockPos;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
public class TileEntityLaunchPadRusted extends TileEntityMachineBase implements IGUIProvider {
public int prevRedstonePower;
public int redstonePower;
public Set<BlockPos> activatedBlocks = new HashSet<>(4);
public boolean missileLoaded;
public TileEntityLaunchPadRusted() {
super(3);
}
@Override
public String getName() {
return "container.launchPadRusted";
}
@Override
public void updateEntity() {
}
public BombReturnCode launch() {
return BombReturnCode.UNDEFINED;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.redstonePower = nbt.getInteger("redstonePower");
this.prevRedstonePower = nbt.getInteger("prevRedstonePower");
NBTTagCompound activatedBlocks = nbt.getCompoundTag("activatedBlocks");
this.activatedBlocks.clear();
for(int i = 0; i < activatedBlocks.func_150296_c().size() / 3; i++) {
this.activatedBlocks.add(new BlockPos(activatedBlocks.getInteger("x" + i), activatedBlocks.getInteger("y" + i), activatedBlocks.getInteger("z" + i)));
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("redstonePower", redstonePower);
nbt.setInteger("prevRedstonePower", prevRedstonePower);
NBTTagCompound activatedBlocks = new NBTTagCompound();
int i = 0;
for(BlockPos p : this.activatedBlocks) {
activatedBlocks.setInteger("x" + i, p.getX());
activatedBlocks.setInteger("y" + i, p.getY());
activatedBlocks.setInteger("z" + i, p.getZ());
i++;
}
nbt.setTag("activatedBlocks", activatedBlocks);
}
public void updateRedstonePower(int x, int y, int z) {
BlockPos pos = new BlockPos(x, y, z);
boolean powered = worldObj.isBlockIndirectlyGettingPowered(x, y, z);
boolean contained = activatedBlocks.contains(pos);
if(!contained && powered){
activatedBlocks.add(pos);
if(redstonePower == -1){
redstonePower = 0;
}
redstonePower++;
} else if(contained && !powered){
activatedBlocks.remove(pos);
redstonePower--;
if(redstonePower == 0){
redstonePower = -1;
}
}
}
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord - 2,
yCoord,
zCoord - 2,
xCoord + 3,
yCoord + 15,
zCoord + 3
);
}
return bb;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerLaunchPadRusted(player.inventory, this);
}
@Override
@SideOnly(Side.CLIENT)
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GUILaunchPadRusted(player.inventory, this);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B