mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
RBMK crane console
This commit is contained in:
parent
6919dd038d
commit
2b36cc8e0d
@ -1035,6 +1035,7 @@ public class ModBlocks {
|
||||
public static Block rbmk_moderator;
|
||||
public static Block rbmk_outgasser;
|
||||
public static Block rbmk_console;
|
||||
public static Block rbmk_crane_console;
|
||||
public static final int guiID_rbmk_rod = 113;
|
||||
public static final int guiID_rbmk_boiler = 114;
|
||||
public static final int guiID_rbmk_control = 115;
|
||||
@ -1945,6 +1946,7 @@ public class ModBlocks {
|
||||
rbmk_moderator = new RBMKModerator().setBlockName("rbmk_moderator").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_moderator");
|
||||
rbmk_outgasser = new RBMKOutgasser().setBlockName("rbmk_outgasser").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_outgasser");
|
||||
rbmk_console = new RBMKConsole().setBlockName("rbmk_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_console");
|
||||
rbmk_crane_console = new RBMKCraneConsole().setBlockName("rbmk_crane_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_crane_console");
|
||||
rbmk_loader = new BlockGeneric(Material.iron).setBlockName("rbmk_loader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_loader");
|
||||
rbmk_steam_inlet = new RBMKInlet(Material.iron).setBlockName("rbmk_steam_inlet").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_steam_inlet");
|
||||
rbmk_steam_outlet = new RBMKOutlet(Material.iron).setBlockName("rbmk_steam_outlet").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_steam_outlet");
|
||||
@ -2795,6 +2797,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(rbmk_moderator, rbmk_moderator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_outgasser, rbmk_outgasser.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_console, rbmk_console.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_crane_console, rbmk_crane_console.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_loader, rbmk_loader.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_steam_inlet, rbmk_steam_inlet.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_steam_outlet, rbmk_steam_outlet.getUnlocalizedName());
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityCraneConsole;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class RBMKCraneConsole extends BlockDummyable {
|
||||
|
||||
public RBMKCraneConsole() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= this.offset)
|
||||
return new TileEntityCraneConsole();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {1, 0, 0, 0, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {0, 0, 0, 1, 1, 1}, this, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
|
||||
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {0, 0, 0, 1, 1, 1}, x, y, z, dir))
|
||||
return false;
|
||||
|
||||
return super.checkRequirement(world, x, y, z, dir, o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
|
||||
if(world.getBlockMetadata(x, y, z) == ForgeDirection.UP.ordinal()) {
|
||||
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 0.5F, z + 1);
|
||||
} else {
|
||||
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
if(world.getBlockMetadata(x, y, z) == ForgeDirection.UP.ordinal()) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
|
||||
} else {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -232,6 +232,7 @@ public class ClientProxy extends ServerProxy {
|
||||
//RBMK
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKControlManual.class, new RenderRBMKControlRod());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKControlAuto.class, new RenderRBMKControlRod());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneConsole.class, new RenderCraneConsole());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKConsole.class, new RenderRBMKConsole());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKAbsorber.class, new RenderRBMKLid());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKBlank.class, new RenderRBMKLid());
|
||||
|
||||
@ -1081,8 +1081,10 @@ public class ResourceManager {
|
||||
public static final IModelCustom rbmk_element = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rbmk/rbmk_element.obj"));
|
||||
public static final IModelCustom rbmk_reflector = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rbmk/rbmk_reflector.obj"));
|
||||
public static final IModelCustom rbmk_rods = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rbmk/rbmk_rods.obj"));
|
||||
public static final IModelCustom rbmk_crane_console = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/rbmk/crane_console.obj"));
|
||||
public static final IModelCustom rbmk_console = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/rbmk/rbmk_console.obj"));
|
||||
public static final IModelCustom rbmk_debris = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/rbmk/debris.obj"));
|
||||
public static final ResourceLocation rbmk_crane_console_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/crane_console.png");
|
||||
public static final ResourceLocation rbmk_console_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/rbmk_control.png");
|
||||
public static final IModelCustom hev_battery = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/battery.obj"));
|
||||
public static final IModelCustom anvil = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/anvil.obj"));
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderCraneConsole extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y, (float)z + 0.5F);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
switch(te.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
GL11.glTranslated(0.5, 0, 0);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.rbmk_crane_console_tex);
|
||||
ResourceManager.rbmk_crane_console.renderPart("Console_Coonsole");
|
||||
ResourceManager.rbmk_crane_console.renderPart("JoyStick");
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.25, 0.75);
|
||||
GL11.glRotated(Math.sin(System.currentTimeMillis() * 0.01 % 360) * 180 / Math.PI * 0.125 + 45, 1, 0, 0);
|
||||
GL11.glTranslated(0, -1.25, -0.75);
|
||||
ResourceManager.rbmk_crane_console.renderPart("Meter1");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.25, 0.25);
|
||||
GL11.glRotated(System.currentTimeMillis() / 16 % 360, -1, 0, 0);
|
||||
GL11.glTranslated(0, -1.25, -0.25);
|
||||
ResourceManager.rbmk_crane_console.renderPart("Meter2");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
bindTexture(ResourceManager.ks23_tex);
|
||||
ResourceManager.rbmk_crane_console.renderPart("Shotgun");
|
||||
bindTexture(ResourceManager.mini_nuke_tex);
|
||||
ResourceManager.rbmk_crane_console.renderPart("MiniNuke");
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
GL11.glColor3f(0F, 1F, 0F);
|
||||
ResourceManager.rbmk_crane_console.renderPart("Lamp1");
|
||||
GL11.glColor3f(1F, 1F, 0F);
|
||||
ResourceManager.rbmk_crane_console.renderPart("Lamp2");
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@ -97,9 +97,6 @@ public class RenderRBMKConsole extends TileEntitySpecialRenderer {
|
||||
this.drawDot(tess, x, y, z, (float) level, 0F, (float) level);
|
||||
}
|
||||
|
||||
private void drawSquare(Tessellator tess, double x, double y, double z, float r, float g, float b) {
|
||||
}
|
||||
|
||||
private void drawDot(Tessellator tess, double x, double y, double z, float r, float g, float b) {
|
||||
|
||||
double width = 0.03125D;
|
||||
|
||||
@ -255,6 +255,7 @@ public class TileMappings {
|
||||
map.put(TileEntityRBMKAbsorber.class, "tileentity_rbmk_absorber");
|
||||
map.put(TileEntityRBMKModerator.class, "tileentity_rbmk_moderator");
|
||||
map.put(TileEntityRBMKOutgasser.class, "tileentity_rbmk_outgasser");
|
||||
map.put(TileEntityCraneConsole.class, "tileentity_rbmk_crane_console");
|
||||
map.put(TileEntityRBMKConsole.class, "tileentity_rbmk_console");
|
||||
map.put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet");
|
||||
map.put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet");
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityCraneConsole extends TileEntity {
|
||||
|
||||
}
|
||||
6631
src/main/resources/assets/hbm/models/rbmk/crane_console.obj
Normal file
6631
src/main/resources/assets/hbm/models/rbmk/crane_console.obj
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user