mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
Merge branch 'HbmMods:master' into rulang3
This commit is contained in:
commit
148132435d
@ -972,6 +972,7 @@ public class ModBlocks {
|
||||
public static Block machine_autosaw;
|
||||
public static Block machine_thresher;
|
||||
|
||||
public static Block machine_rockmill;
|
||||
public static Block machine_mining_laser;
|
||||
public static Block barricade; // a sand bag that drops nothing, for automated walling purposes
|
||||
|
||||
@ -2192,6 +2193,7 @@ public class ModBlocks {
|
||||
machine_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_ore_slopper = new MachineOreSlopper().setBlockName("machine_ore_slopper").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_annihilator = new MachineAnnihilator().setBlockName("machine_annihilator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_rockmill = new MachineRockMill(Material.iron).setBlockName("machine_rockmill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser");
|
||||
barricade = new BlockNoDrop(Material.sand).setBlockName("barricade").setHardness(1.0F).setResistance(2.5F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":barricade");
|
||||
machine_assembly_machine = new MachineAssemblyMachine(Material.iron).setBlockName("machine_assembly_machine").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -3234,6 +3236,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_electric_furnace_off, machine_electric_furnace_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_electric_furnace_on, machine_electric_furnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_microwave, machine_microwave.getUnlocalizedName());
|
||||
register(machine_rockmill);
|
||||
register(machine_assembly_machine);
|
||||
register(machine_assembly_factory);
|
||||
register(machine_precass);
|
||||
|
||||
44
src/main/java/com/hbm/blocks/machine/MachineRockMill.java
Normal file
44
src/main/java/com/hbm/blocks/machine/MachineRockMill.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRockMill;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineRockMill extends BlockDummyable {
|
||||
|
||||
public MachineRockMill(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineRockMill();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {2, 0, 2, 2, 2, 2}; }
|
||||
@Override public int getOffset() { return 2; }
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
this.makeExtra(world, x + 2, y, z + 1);
|
||||
this.makeExtra(world, x - 2, y, z + 1);
|
||||
this.makeExtra(world, x + 2, y, z - 1);
|
||||
this.makeExtra(world, x - 2, y, z - 1);
|
||||
this.makeExtra(world, x + 1, y, z + 2);
|
||||
this.makeExtra(world, x + 1, y, z - 2);
|
||||
this.makeExtra(world, x - 1, y, z + 2);
|
||||
this.makeExtra(world, x - 1, y, z - 2);
|
||||
}
|
||||
}
|
||||
13
src/main/java/com/hbm/handler/nei/RockMillRecipeHandler.java
Normal file
13
src/main/java/com/hbm/handler/nei/RockMillRecipeHandler.java
Normal file
@ -0,0 +1,13 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.RockMillRecipes;
|
||||
|
||||
public class RockMillRecipeHandler extends NEIGenericRecipeHandler {
|
||||
|
||||
public RockMillRecipeHandler() {
|
||||
super(ModBlocks.machine_rockmill.getLocalizedName(), RockMillRecipes.INSTANCE, ModBlocks.machine_rockmill);
|
||||
}
|
||||
|
||||
@Override public String getRecipeID() { return "ntmRockMill"; }
|
||||
}
|
||||
22
src/main/java/com/hbm/inventory/recipes/RockMillRecipes.java
Normal file
22
src/main/java/com/hbm/inventory/recipes/RockMillRecipes.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||
import com.hbm.inventory.recipes.loader.GenericRecipes;
|
||||
|
||||
public class RockMillRecipes extends GenericRecipes<GenericRecipe> {
|
||||
|
||||
public static final RockMillRecipes INSTANCE = new RockMillRecipes();
|
||||
|
||||
@Override public int inputItemLimit() { return 3; }
|
||||
@Override public int inputFluidLimit() { return 1; }
|
||||
@Override public int outputItemLimit() { return 3; }
|
||||
@Override public int outputFluidLimit() { return 1; }
|
||||
|
||||
@Override public String getFileName() { return "hbmRockMill.json"; }
|
||||
@Override public GenericRecipe instantiateRecipe(String name) { return new GenericRecipe(name); }
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
// TBI
|
||||
}
|
||||
}
|
||||
@ -275,6 +275,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChimneyIndustrial.class, new RenderChimneyIndustrial());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMiningLaser.class, new RenderLaserMiner());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAnnihilator.class, new RenderAnnihilator());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRockMill.class, new RenderRockMill());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAssemblyMachine.class, new RenderAssemblyMachine());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAssemblyFactory.class, new RenderAssemblyFactory());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePrecAss.class, new RenderPrecAss());
|
||||
|
||||
@ -80,6 +80,7 @@ public class NEIRegistry {
|
||||
handlers.add(new CompressorHandler());
|
||||
handlers.add(new ParticleAcceleratorHandler());
|
||||
handlers.add(new DeuteriumHandler());
|
||||
handlers.add(new RockMillRecipeHandler());
|
||||
|
||||
//this shit comes last
|
||||
handlers.add(new FluidRecipeHandler());
|
||||
|
||||
@ -140,6 +140,9 @@ public class ResourceManager {
|
||||
//Annihilator
|
||||
public static final IModelCustom annihilator = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/annihilator.obj")).asVBO();
|
||||
|
||||
//Rock Mill
|
||||
public static final IModelCustom rock_mill = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/rockmill.obj")).asVBO();
|
||||
|
||||
//Assembler
|
||||
public static final IModelCustom assembly_machine = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/assembly_machine.obj")).asVBO();
|
||||
public static final IModelCustom assembly_factory = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/assembly_factory.obj")).asVBO();
|
||||
@ -594,11 +597,10 @@ public class ResourceManager {
|
||||
public static final ResourceLocation annihilator_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/annihilator.png");
|
||||
public static final ResourceLocation annihilator_belt_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/annihilator_belt.png");
|
||||
|
||||
//Rock Mill
|
||||
public static final ResourceLocation rock_mill_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/rockmill.png");
|
||||
|
||||
//Assembler
|
||||
public static final ResourceLocation assembler_body_tex = new ResourceLocation(RefStrings.MODID, "textures/models/assembler_base_new.png");
|
||||
public static final ResourceLocation assembler_cog_tex = new ResourceLocation(RefStrings.MODID, "textures/models/assembler_cog_new.png");
|
||||
public static final ResourceLocation assembler_slider_tex = new ResourceLocation(RefStrings.MODID, "textures/models/assembler_slider_new.png");
|
||||
public static final ResourceLocation assembler_arm_tex = new ResourceLocation(RefStrings.MODID, "textures/models/assembler_arm_new.png");
|
||||
public static final ResourceLocation assembly_machine_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/assembly_machine.png");
|
||||
public static final ResourceLocation assemfac_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/assemfac.png");
|
||||
public static final ResourceLocation assembly_factory_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/assembly_factory.png");
|
||||
@ -606,10 +608,6 @@ public class ResourceManager {
|
||||
public static final ResourceLocation precass_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/precass.png");
|
||||
|
||||
//Chemplant
|
||||
public static final ResourceLocation chemplant_body_tex = new ResourceLocation(RefStrings.MODID, "textures/models/chemplant_base_new.png");
|
||||
public static final ResourceLocation chemplant_spinner_tex = new ResourceLocation(RefStrings.MODID, "textures/models/chemplant_spinner_new.png");
|
||||
public static final ResourceLocation chemplant_piston_tex = new ResourceLocation(RefStrings.MODID, "textures/models/chemplant_piston_new.png");
|
||||
public static final ResourceLocation chemplant_fluid_tex = new ResourceLocation(RefStrings.MODID, "textures/models/lavabase_small.png");
|
||||
public static final ResourceLocation chemical_plant_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/chemical_plant.png");
|
||||
public static final ResourceLocation chemical_plant_fluid_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/chemical_plant_fluid.png");
|
||||
public static final ResourceLocation chemfac_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/chemfac.png");
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
package com.hbm.module.machine;
|
||||
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.recipes.RockMillRecipes;
|
||||
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||
import com.hbm.inventory.recipes.loader.GenericRecipes;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import api.hbm.energymk2.IEnergyHandlerMK2;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ModuleMachineRockMill extends ModuleMachineBase {
|
||||
|
||||
public ModuleMachineRockMill(int index, IEnergyHandlerMK2 battery, ItemStack[] slots) {
|
||||
super(index, battery, slots);
|
||||
this.inputSlots = new int[3];
|
||||
this.outputSlots = new int[3];
|
||||
this.inputTanks = new FluidTank[1];
|
||||
this.outputTanks = new FluidTank[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericRecipes getRecipeSet() {
|
||||
return RockMillRecipes.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupTanks(GenericRecipe recipe) {
|
||||
super.setupTanks(recipe);
|
||||
if(recipe == null) return;
|
||||
for(int i = 0; i < inputTanks.length; i++) if(recipe.inputFluid != null && recipe.inputFluid.length > i) inputTanks[i].changeTankSize(BobMathUtil.max(inputTanks[i].getFill(), recipe.inputFluid[i].fill * 2, 4_000));
|
||||
for(int i = 0; i < outputTanks.length; i++) if(recipe.outputFluid != null && recipe.outputFluid.length > i) outputTanks[i].changeTankSize(BobMathUtil.max(outputTanks[i].getFill(), recipe.outputFluid[i].fill * 2, 4_000));
|
||||
}
|
||||
|
||||
public ModuleMachineRockMill itemInput(int from) { for(int i = 0; i < inputSlots.length; i++) inputSlots[i] = from + i; return this; }
|
||||
public ModuleMachineRockMill itemOutput(int from) { for(int i = 0; i < outputSlots.length; i++) outputSlots[i] = from + i; return this; }
|
||||
public ModuleMachineRockMill fluidInput(FluidTank a) { inputTanks[0] = a; return this; }
|
||||
public ModuleMachineRockMill fluidOutput(FluidTank a) { outputTanks[0] = a; return this; }
|
||||
}
|
||||
69
src/main/java/com/hbm/render/tileentity/RenderRockMill.java
Normal file
69
src/main/java/com/hbm/render/tileentity/RenderRockMill.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRockMill;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderRockMill extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
switch(tile.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
TileEntityMachineRockMill mill = (TileEntityMachineRockMill) tile;
|
||||
|
||||
bindTexture(ResourceManager.rock_mill_tex);
|
||||
ResourceManager.rock_mill.renderPart("Base");
|
||||
if(mill.frame) ResourceManager.rock_mill.renderPart("Frame");
|
||||
|
||||
float rot = mill.prevRotation + (mill.rotation - mill.prevRotation) * interp;
|
||||
GL11.glRotatef(rot, 0, -1, 0);
|
||||
ResourceManager.rock_mill.renderPart("Wheel");
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_rockmill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
|
||||
return new ItemRenderBase() {
|
||||
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommonWithStack(ItemStack item) {
|
||||
GL11.glScaled(0.75, 0.75, 0.75);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.rock_mill_tex);
|
||||
ResourceManager.rock_mill.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}};
|
||||
}
|
||||
}
|
||||
@ -354,6 +354,7 @@ public class TileMappings {
|
||||
|
||||
put(TileEntityMachineCombustionEngine.class, "tileentity_combustion_engine");
|
||||
|
||||
put(TileEntityMachineRockMill.class, "tileentity_rock_mill");
|
||||
put(TileEntityMachineAssemblyMachine.class, "tileentity_assemblymachine");
|
||||
put(TileEntityMachineAssemblyFactory.class, "tileentity_assemblyfactory");
|
||||
put(TileEntityMachinePrecAss.class, "tileentity_precass");
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
public class TileEntityMachineRockMill extends TileEntityMachineBase {
|
||||
|
||||
public float rotation;
|
||||
public float prevRotation;
|
||||
|
||||
public boolean frame = false;
|
||||
|
||||
public TileEntityMachineRockMill() {
|
||||
super(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.machineRockMill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
} else {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
frame = !worldObj.getBlock(xCoord, yCoord + 3, zCoord).isAir(worldObj, xCoord, yCoord + 3, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2536
src/main/resources/assets/hbm/models/machines/rockmill.obj
Normal file
2536
src/main/resources/assets/hbm/models/machines/rockmill.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Loading…
x
Reference in New Issue
Block a user