mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
missing star control pieces, snowglobes, broken turret
This commit is contained in:
parent
047c25aa4e
commit
b2b0c79bb9
@ -1125,6 +1125,7 @@ public class ModBlocks {
|
||||
public static Block turret_arty;
|
||||
public static Block turret_himars;
|
||||
public static Block turret_sentry;
|
||||
public static Block turret_sentry_damaged;
|
||||
|
||||
public static Block rbmk_rod;
|
||||
public static Block rbmk_rod_mod;
|
||||
@ -2199,6 +2200,7 @@ public class ModBlocks {
|
||||
turret_arty = new TurretArty(Material.iron).setBlockName("turret_arty").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
turret_himars = new TurretHIMARS(Material.iron).setBlockName("turret_himars").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
turret_sentry = new TurretSentry().setBlockName("turret_sentry").setHardness(5.0F).setResistance(5.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
turret_sentry_damaged = new TurretSentryDamaged().setBlockName("turret_sentry_damaged").setHardness(5.0F).setResistance(5.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_rust");
|
||||
|
||||
rbmk_rod = new RBMKRod(false).setBlockName("rbmk_rod").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_element");
|
||||
rbmk_rod_mod = new RBMKRod(true).setBlockName("rbmk_rod_mod").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_element_mod");
|
||||
@ -3016,6 +3018,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(turret_arty, turret_arty.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(turret_himars, turret_himars.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(turret_sentry, turret_sentry.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(turret_sentry_damaged, turret_sentry_damaged.getUnlocalizedName());
|
||||
|
||||
//Wall-mounted Explosives
|
||||
GameRegistry.registerBlock(charge_dynamite, ItemBlockBase.class, charge_dynamite.getUnlocalizedName());
|
||||
|
||||
@ -191,9 +191,9 @@ public class BlockBobble extends BlockContainer implements IGUIProvider {
|
||||
NOS( "Dr Nostalgia", "Dr Nostalgia", "SSG and Vortex models", "Take a picture, I'ma pose, paparazzi$I've been drinking, moving like a zombie", true, ScrapType.BOARD_TRANSISTOR),
|
||||
DRILLGON( "Drillgon200", "Drillgon200", "1.12 Port", null, false, ScrapType.CPU_LOGIC),
|
||||
CIRNO( "Cirno", "Cirno", "the only multi layered skin i had", "No brain. Head empty.", true, ScrapType.BOARD_BLANK),
|
||||
MICROWAVE( "Microwave", "Microwave", "OC Compatibility", "they call me the food heater", true, ScrapType.BRIDGE_BIOS),
|
||||
PEEP( "Peep", "LePeeperSauvage", "Coilgun, Leadburster and Congo Lake models, BDCL QC", "Fluffy ears can't hide in ash, nor snow.", true, ScrapType.CPU_CLOCK),
|
||||
MELLOW( "MELLOWARPEGGIATION", "Mellow", "Industrial lighting, animation tools", "Make something cool now, ask for permission later.", true, ScrapType.CPU_LOGIC);
|
||||
MICROWAVE( "Microwave", "Microwave", "OC Compatibility", "they call me the food heater", true, ScrapType.BOARD_CONVERTER),
|
||||
PEEP( "Peep", "LePeeperSauvage", "Coilgun, Leadburster and Congo Lake models, BDCL QC", "Fluffy ears can't hide in ash, nor snow.", true, ScrapType.CARD_BOARD),
|
||||
MELLOW( "MELLOWARPEGGIATION", "Mellow", "Industrial lighting, animation tools", "Make something cool now, ask for permission later.", true, ScrapType.CARD_PROCESSOR);
|
||||
|
||||
public String name; //the title of the tooltip
|
||||
public String label; //the name engraved in the socket
|
||||
|
||||
@ -3,8 +3,9 @@ package com.hbm.blocks.generic;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.inventory.gui.GUIScreenSnowglobe;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.wiaj.WorldInAJar;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -12,11 +13,12 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@ -28,7 +30,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSnowglobe extends BlockContainer {
|
||||
public class BlockSnowglobe extends BlockContainer implements IGUIProvider {
|
||||
|
||||
public BlockSnowglobe() {
|
||||
super(Material.glass);
|
||||
@ -153,23 +155,28 @@ public class BlockSnowglobe extends BlockContainer {
|
||||
}
|
||||
|
||||
public static enum SnowglobeType {
|
||||
NONE("NONE", new WorldInAJar(1, 1, 1)),
|
||||
TEST("Test", getTestJar());
|
||||
NONE( "NONE"),
|
||||
RIVETCITY( "Rivet City"),
|
||||
TENPENNYTOWER( "Tenpenny Tower"),
|
||||
LUCKY38( "Lucky 38"),
|
||||
SIERRAMADRE( "Sierra Madre"),
|
||||
PRYDWEN( "Prydwen");
|
||||
|
||||
public String label;
|
||||
public WorldInAJar scene;
|
||||
|
||||
private SnowglobeType(String label, WorldInAJar scene) {
|
||||
private SnowglobeType(String label) {
|
||||
this.label = label;
|
||||
this.scene = scene;
|
||||
}
|
||||
}
|
||||
|
||||
private static WorldInAJar getTestJar() {
|
||||
WorldInAJar world = new WorldInAJar(3, 3, 3);
|
||||
for(int x = 0; x < 3; x++) for(int z = 0; z < 3; z++) world.setBlock(x, 0, z, Blocks.brick_block, 0);
|
||||
world.setBlock(1, 1, 1, Blocks.gold_block, 0);
|
||||
world.setBlock(1, 2, 1, Blocks.gold_block, 0);
|
||||
return world;
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIScreenSnowglobe((TileEntitySnowglobe) world.getTileEntity(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package com.hbm.blocks.turret;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.tileentity.turret.TileEntityTurretHowardDamaged;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -25,4 +28,9 @@ public class TurretHowardDamaged extends TurretBaseNT {
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float fX, float fY, float fZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
43
src/main/java/com/hbm/blocks/turret/TurretSentryDamaged.java
Normal file
43
src/main/java/com/hbm/blocks/turret/TurretSentryDamaged.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.hbm.blocks.turret;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.tileentity.turret.TileEntityTurretSentryDamaged;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TurretSentryDamaged extends BlockContainer {
|
||||
|
||||
public TurretSentryDamaged() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityTurretSentryDamaged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
113
src/main/java/com/hbm/inventory/gui/GUIScreenSnowglobe.java
Normal file
113
src/main/java/com/hbm/inventory/gui/GUIScreenSnowglobe.java
Normal file
@ -0,0 +1,113 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
|
||||
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIScreenSnowglobe extends GuiScreen {
|
||||
|
||||
TileEntitySnowglobe snowglobe;
|
||||
|
||||
public GUIScreenSnowglobe(TileEntitySnowglobe bobble) {
|
||||
this.snowglobe = bobble;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:block.bobble"), 1.0F));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
|
||||
this.drawDefaultBackground();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
double sizeX = 300;
|
||||
double sizeY = 150;
|
||||
double left = (this.width - sizeX) / 2;
|
||||
double top = (this.height - sizeY) / 2;
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
tess.setColorRGBA_F(0F, 0.2F, 0F, 0.8F);
|
||||
tess.addVertex(left + sizeX, top, this.zLevel);
|
||||
tess.addVertex(left, top, this.zLevel);
|
||||
tess.addVertex(left, top + sizeY, this.zLevel);
|
||||
tess.addVertex(left + sizeX, top + sizeY, this.zLevel);
|
||||
tess.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
int nextLevel = (int)top + 10;
|
||||
|
||||
String bobbleTitle = "Nuclear Tech Commemorative Snowglobe";
|
||||
this.fontRendererObj.drawStringWithShadow(bobbleTitle, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(bobbleTitle) / 2), nextLevel, 0x00ff00);
|
||||
|
||||
nextLevel += 10;
|
||||
|
||||
String bobbleName = this.snowglobe.type.label;
|
||||
this.fontRendererObj.drawStringWithShadow(bobbleName, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(bobbleName) / 2), nextLevel, 0x009900);
|
||||
|
||||
nextLevel += 20;
|
||||
|
||||
/*if(this.snowglobe.type.contribution != null) {
|
||||
|
||||
String title = "Has contributed";
|
||||
this.fontRendererObj.drawStringWithShadow(title, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(title) / 2), nextLevel, 0x00ff00);
|
||||
|
||||
nextLevel += 10;
|
||||
|
||||
|
||||
String[] list = this.snowglobe.type.contribution.split("\\$");
|
||||
for(String text : list) {
|
||||
this.fontRendererObj.drawStringWithShadow(text, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(text) / 2), nextLevel, 0x009900);
|
||||
nextLevel += 10;
|
||||
}
|
||||
|
||||
nextLevel += 10;
|
||||
}
|
||||
|
||||
if(this.snowglobe.type.inscription != null) {
|
||||
|
||||
String title = "On the bottom is the following inscription:";
|
||||
this.fontRendererObj.drawStringWithShadow(title, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(title) / 2), nextLevel, 0x00ff00);
|
||||
|
||||
nextLevel += 10;
|
||||
|
||||
String[] list = this.snowglobe.type.inscription.split("\\$");
|
||||
for(String text : list) {
|
||||
this.fontRendererObj.drawStringWithShadow(text, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(text) / 2), nextLevel, 0x009900);
|
||||
nextLevel += 10;
|
||||
}
|
||||
|
||||
nextLevel += 10;
|
||||
}*/
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int key) {
|
||||
if(key == 1 || key == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,7 @@ public class ItemCircuitStarComponent extends ItemEnumMulti {
|
||||
public static enum CircuitComponentType {
|
||||
CHIPSET,
|
||||
CPU,
|
||||
RAM
|
||||
RAM,
|
||||
CARD
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ public class ItemPlasticScrap extends ItemEnumMulti {
|
||||
//GENERAL BOARD
|
||||
BOARD_BLANK,
|
||||
BOARD_TRANSISTOR,
|
||||
BOARD_CONVERTER,
|
||||
|
||||
//CHIPSET
|
||||
BRIDGE_NORTH,
|
||||
@ -36,6 +37,10 @@ public class ItemPlasticScrap extends ItemEnumMulti {
|
||||
MEM_16K_A,
|
||||
MEM_16K_B,
|
||||
MEM_16K_C,
|
||||
MEM_16K_D
|
||||
MEM_16K_D,
|
||||
|
||||
//EXTENSION CARD
|
||||
CARD_BOARD,
|
||||
CARD_PROCESSOR
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,6 +209,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretArty.class, new RenderTurretArty());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretHIMARS.class, new RenderTurretHIMARS());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretSentry.class, new RenderTurretSentry());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretSentryDamaged.class, new RenderTurretSentry());
|
||||
//mines
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLandmine.class, new RenderLandmine());
|
||||
//machines
|
||||
|
||||
@ -1153,11 +1153,18 @@ public class CraftingManager {
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.MEM_16K_D)
|
||||
});
|
||||
|
||||
addShapelessAuto(ModItems.circuit_star_component.stackFromEnum(CircuitComponentType.CARD), new Object[] {
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.CARD_BOARD),
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.CARD_PROCESSOR)
|
||||
});
|
||||
|
||||
addShapelessAuto(new ItemStack(ModItems.circuit_star), new Object[] {
|
||||
ModItems.circuit_star_component.stackFromEnum(CircuitComponentType.CHIPSET),
|
||||
ModItems.circuit_star_component.stackFromEnum(CircuitComponentType.CPU),
|
||||
ModItems.circuit_star_component.stackFromEnum(CircuitComponentType.RAM),
|
||||
ModItems.circuit_star_component.stackFromEnum(CircuitComponentType.CARD),
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.BOARD_TRANSISTOR),
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.BOARD_CONVERTER),
|
||||
ModItems.circuit_star_piece.stackFromEnum(ScrapType.BOARD_BLANK)
|
||||
});
|
||||
|
||||
|
||||
@ -216,9 +216,9 @@ public class ModEventHandlerClient {
|
||||
((ILookOverlay) world.getBlock(mop.blockX, mop.blockY, mop.blockZ)).printHook(event, world, mop.blockX, mop.blockY, mop.blockZ);
|
||||
}
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
/*List<String> text = new ArrayList();
|
||||
text.add("Meta: " + world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ));
|
||||
ILookOverlay.printGeneric(event, "DEBUG", 0xffff00, 0x4040000, text);
|
||||
ILookOverlay.printGeneric(event, "DEBUG", 0xffff00, 0x4040000, text);*/
|
||||
|
||||
} else if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
|
||||
Entity entity = mop.entityHit;
|
||||
|
||||
@ -424,6 +424,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation turret_arty_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/arty.png");
|
||||
public static final ResourceLocation turret_himars_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/himars.png");
|
||||
public static final ResourceLocation turret_sentry_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/sentry.png");
|
||||
public static final ResourceLocation turret_sentry_damaged_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/sentry_damaged.png");
|
||||
|
||||
public static final ResourceLocation himars_standard_tex = new ResourceLocation(RefStrings.MODID, "textures/models/projectiles/himars_standard.png");
|
||||
public static final ResourceLocation himars_single_tex = new ResourceLocation(RefStrings.MODID, "textures/models/projectiles/himars_single.png");
|
||||
|
||||
@ -5,24 +5,19 @@ import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.blocks.generic.BlockSnowglobe.TileEntitySnowglobe;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.wiaj.WorldInAJar;
|
||||
import com.hbm.render.loader.HFRWavefrontObject;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
public class RenderSnowglobe extends TileEntitySpecialRenderer {
|
||||
|
||||
public static final IModelCustom snowglobe = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/trinkets/snowglobe.obj"));
|
||||
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 features = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/snowglobe_features.png");
|
||||
public static RenderBlocks renderer = new RenderBlocks();
|
||||
|
||||
@Override
|
||||
@ -42,49 +37,18 @@ public class RenderSnowglobe extends TileEntitySpecialRenderer {
|
||||
snowglobe.renderPart("Socket");
|
||||
|
||||
TileEntitySnowglobe te = (TileEntitySnowglobe) tile;
|
||||
this.bindTexture(features);
|
||||
|
||||
if(te.type.scene != null) {
|
||||
|
||||
WorldInAJar world = te.type.scene;
|
||||
renderer.blockAccess = world;
|
||||
|
||||
double size = Math.max(world.sizeX, world.sizeZ);
|
||||
scale = 4D / size;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
GL11.glTranslated(0, 1, 0);
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
GL11.glTranslated(world.sizeX * -0.5, 0, world.sizeZ * -0.5);
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
bindTexture(TextureMap.locationBlocksTexture);
|
||||
Minecraft.getMinecraft().entityRenderer.disableLightmap(interp);
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
tess.setColorOpaque_F(1F, 1F, 1F);
|
||||
|
||||
for(int a = 0; a < world.sizeX; a++) {
|
||||
for(int b = 0; b < world.sizeY; b++) {
|
||||
for(int c = 0; c < world.sizeZ; c++) {
|
||||
Block block = world.getBlock(a, b, c);
|
||||
renderer.renderBlockByRenderType(block, a, b, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tess.draw();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
switch(te.type) {
|
||||
case NONE: break;
|
||||
case RIVETCITY: snowglobe.renderPart("RivetCity"); break;
|
||||
case TENPENNYTOWER: snowglobe.renderPart("TenpennyTower"); break;
|
||||
case LUCKY38: snowglobe.renderPart("Lucky38_Plane"); break;
|
||||
case SIERRAMADRE: snowglobe.renderPart("SierraMadre"); break;
|
||||
case PRYDWEN: snowglobe.renderPart("Prydwen"); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().entityRenderer.enableLightmap(interp);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretSentry;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretSentryDamaged;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
@ -26,8 +27,14 @@ public class RenderTurretSentry extends TileEntitySpecialRenderer implements IIt
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
boolean damaged = te instanceof TileEntityTurretSentryDamaged;
|
||||
|
||||
bindTexture(ResourceManager.turret_sentry_tex);
|
||||
if(damaged)
|
||||
bindTexture(ResourceManager.turret_sentry_damaged_tex);
|
||||
else
|
||||
bindTexture(ResourceManager.turret_sentry_tex);
|
||||
|
||||
ResourceManager.turret_sentry.renderPart("Base");
|
||||
|
||||
double yaw = -Math.toDegrees(turret.lastRotationYaw + (turret.rotationYaw - turret.lastRotationYaw) * interp);
|
||||
@ -48,7 +55,13 @@ public class RenderTurretSentry extends TileEntitySpecialRenderer implements IIt
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 0, (turret.lastBarrelRightPos + (turret.barrelRightPos - turret.lastBarrelRightPos) * interp) * -0.5);
|
||||
if(damaged) {
|
||||
GL11.glTranslated(0, 1.5, 0.5);
|
||||
GL11.glRotated(25, 1, 0, 0);
|
||||
GL11.glTranslated(0, -1.5, -0.5);
|
||||
} else {
|
||||
GL11.glTranslated(0, 0, (turret.lastBarrelRightPos + (turret.barrelRightPos - turret.lastBarrelRightPos) * interp) * -0.5);
|
||||
}
|
||||
ResourceManager.turret_sentry.renderPart("BarrelR");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
@ -267,6 +267,7 @@ public class TileMappings {
|
||||
put(TileEntityTurretArty.class, "tileentity_turret_arty");
|
||||
put(TileEntityTurretHIMARS.class, "tileentity_turret_himars");
|
||||
put(TileEntityTurretSentry.class, "tileentity_turret_sentry");
|
||||
put(TileEntityTurretSentryDamaged.class, "tileentity_turret_sentry_damaged");
|
||||
}
|
||||
|
||||
private static void putMachines() {
|
||||
|
||||
@ -26,12 +26,12 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityTurretSentry extends TileEntityTurretBaseNT implements IGUIProvider {
|
||||
|
||||
private boolean didJustShootLeft = false;
|
||||
private boolean retractingLeft = false;
|
||||
protected boolean didJustShootLeft = false;
|
||||
protected boolean retractingLeft = false;
|
||||
public double barrelLeftPos = 0;
|
||||
public double lastBarrelLeftPos = 0;
|
||||
private boolean didJustShootRight = false;
|
||||
private boolean retractingRight = false;
|
||||
protected boolean didJustShootRight = false;
|
||||
protected boolean retractingRight = false;
|
||||
public double barrelRightPos = 0;
|
||||
public double lastBarrelRightPos = 0;
|
||||
|
||||
|
||||
@ -0,0 +1,106 @@
|
||||
package com.hbm.tileentity.turret;
|
||||
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class TileEntityTurretSentryDamaged extends TileEntityTurretSentry {
|
||||
|
||||
@Override
|
||||
public boolean hasPower() { //does not need power
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOn() { //is always on
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTurretYawSpeed() {
|
||||
return 3D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTurretPitchSpeed() {
|
||||
return 2D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasThermalVision() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean entityAcceptableTarget(Entity e) { //will fire at any living entity
|
||||
|
||||
if(e instanceof EntityPlayer && ((EntityPlayer)e).capabilities.isCreativeMode)
|
||||
return false;
|
||||
|
||||
return e instanceof EntityLivingBase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFiringTick() {
|
||||
|
||||
timer++;
|
||||
|
||||
if(timer % 10 == 0) {
|
||||
|
||||
BulletConfiguration conf = BulletConfigSyncingUtil.pullConfig(BulletConfigSyncingUtil.R5_NORMAL);
|
||||
|
||||
if(conf != null) {
|
||||
|
||||
Vec3 pos = this.getTurretPos();
|
||||
Vec3 vec = Vec3.createVectorHelper(0, 0, 0);
|
||||
Vec3 side = Vec3.createVectorHelper(0, 0, 0);
|
||||
|
||||
this.cachedCasingConfig = conf.spentCasing;
|
||||
|
||||
if(shotSide) {
|
||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.sentry_fire", 2.0F, 1.0F);
|
||||
this.spawnBullet(conf);
|
||||
|
||||
vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
|
||||
vec.rotateAroundZ((float) -this.rotationPitch);
|
||||
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
|
||||
|
||||
side = Vec3.createVectorHelper(0.125 * (shotSide ? 1 : -1), 0, 0);
|
||||
side.rotateAroundY((float) -(this.rotationYaw));
|
||||
|
||||
} else {
|
||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.sentry_fire", 2.0F, 0.75F);
|
||||
if(usesCasings()) {
|
||||
if(this.casingDelay() == 0) {
|
||||
spawnCasing();
|
||||
} else {
|
||||
casingDelay = this.casingDelay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "vanillaExt");
|
||||
data.setString("mode", "largeexplode");
|
||||
data.setFloat("size", 1F);
|
||||
data.setByte("count", (byte) 1);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord + vec.xCoord + side.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord + side.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
|
||||
if(shotSide) {
|
||||
this.didJustShootLeft = true;
|
||||
} else {
|
||||
this.didJustShootRight = true;
|
||||
}
|
||||
shotSide = !shotSide;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1499,10 +1499,12 @@ item.circuit_raw.name=Schaltkreisrohling
|
||||
item.circuit_red_copper.name=Fortgeschrittener Schaltkreis
|
||||
item.circuit_schrabidium.name=Leistungsstarker Schaltkreis
|
||||
item.circuit_star.name=StarControl Schalttafel
|
||||
item.circuit_star_component.card.name=StarControl Erweiterungskarte
|
||||
item.circuit_star_component.chipset.name=StarControl Chipset
|
||||
item.circuit_star_component.cpu.name=StarControl CPU
|
||||
item.circuit_star_component.ram.name=StarControl RAM
|
||||
item.circuit_star_piece.board_blank.name=SC - Leiterplatte
|
||||
item.circuit_star_piece.board_converter.name=SC - Spammungswandler
|
||||
item.circuit_star_piece.board_transistor.name=SC - Transistoren
|
||||
item.circuit_star_piece.bridge_bios.name=SC- BIOS-Chip
|
||||
item.circuit_star_piece.bridge_bus.name=SC - BUS
|
||||
@ -1511,6 +1513,8 @@ item.circuit_star_piece.bridge_cmos.name=SC - CMOS-RAM
|
||||
item.circuit_star_piece.bridge_io.name=SC - IO-Chip
|
||||
item.circuit_star_piece.bridge_north.name=SC - Northbridge
|
||||
item.circuit_star_piece.bridge_south.name=SC - Southbridge
|
||||
item.circuit_star_piece.card_board.name=SC - Erweiterungskarten-Board
|
||||
item.circuit_star_piece.card_processor.name=SC - Erweiterungskarten-Prozessor
|
||||
item.circuit_star_piece.cpu_cache.name=SC - CPU-Cache
|
||||
item.circuit_star_piece.cpu_clock.name=SC - CPU-Clock
|
||||
item.circuit_star_piece.cpu_ext.name=SC - Arsenhalbleiter-Erweiterung
|
||||
@ -4582,6 +4586,7 @@ tile.turret_rocket.name=Raketengeschütz
|
||||
tile.turret_richard.name=Raketenwerfergeschütz "Richard"
|
||||
tile.turret_spitfire.name=Geschütz für das ich noch keinen Namen habe [WIP]
|
||||
tile.turret_sentry.name=Selbstschussanlage "Brown"
|
||||
tile.turret_sentry_damaged.name=Selbstschussanlage "Edwin"
|
||||
tile.turret_tau.name=Tauonengeschütz
|
||||
tile.turret_tauon.name=XVL1456-Prototypengeschütz "Tauon"
|
||||
tile.vacuum.name=Vakuum
|
||||
|
||||
@ -2198,10 +2198,12 @@ item.circuit_red_copper.name=Advanced Circuit
|
||||
item.circuit_schrabidium.name=High Performance Circuit
|
||||
item.circuit_star.name=StarControl Circuit Board
|
||||
item.circuit_star.desc=Currently unused, for it lacks an operating system.
|
||||
item.circuit_star_component.card.name=StarControl Extension Card
|
||||
item.circuit_star_component.chipset.name=StarControl Chipset
|
||||
item.circuit_star_component.cpu.name=StarControl CPU
|
||||
item.circuit_star_component.ram.name=StarControl RAM
|
||||
item.circuit_star_piece.board_blank.name=SC - Printed Circuit Board
|
||||
item.circuit_star_piece.board_converter.name=SC - Voltage Converter
|
||||
item.circuit_star_piece.board_transistor.name=SC - Transistors
|
||||
item.circuit_star_piece.bridge_bios.name=SC- BIOS Chip
|
||||
item.circuit_star_piece.bridge_bus.name=SC - BUS
|
||||
@ -2210,6 +2212,8 @@ item.circuit_star_piece.bridge_cmos.name=SC - CMOS RAM
|
||||
item.circuit_star_piece.bridge_io.name=SC - IO Chip
|
||||
item.circuit_star_piece.bridge_north.name=SC - North Bridge
|
||||
item.circuit_star_piece.bridge_south.name=SC - South Bridge
|
||||
item.circuit_star_piece.card_board.name=SC - Extension Card Board
|
||||
item.circuit_star_piece.card_processor.name=SC - Extension Card Processor
|
||||
item.circuit_star_piece.cpu_cache.name=SC - CPU Cache
|
||||
item.circuit_star_piece.cpu_clock.name=SC - CPU Clock
|
||||
item.circuit_star_piece.cpu_ext.name=SC - Arsenic Semi Conductor Extension
|
||||
@ -5594,6 +5598,7 @@ tile.turret_rocket.name=Rocket Turret
|
||||
tile.turret_richard.name=Rocket Launcher Turret "Richard"
|
||||
tile.turret_spitfire.name=Turret I have no name for right now [WIP]
|
||||
tile.turret_sentry.name=Sentry Turret "Brown"
|
||||
tile.turret_sentry_damaged.name=Sentry Turret "Edwin"
|
||||
tile.turret_tau.name=Tauon Turret
|
||||
tile.turret_tauon.name=XVL1456 Prototype Turret "Tauon"
|
||||
tile.vacuum.name=Vacuum
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 294 B |
Binary file not shown.
|
After Width: | Height: | Size: 174 B |
Binary file not shown.
|
After Width: | Height: | Size: 230 B |
Binary file not shown.
|
After Width: | Height: | Size: 175 B |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Loading…
x
Reference in New Issue
Block a user