Merge branch 'HbmMods:master' into rulang121

This commit is contained in:
Raaaaaaaaaay 2026-05-22 00:17:43 +03:00 committed by GitHub
commit e1aa9e4195
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 314 additions and 15 deletions

View File

@ -1,25 +1,38 @@
package com.hbm.blocks.network;
import com.hbm.blocks.machine.BlockMachineBase;
import com.hbm.blocks.BlockDummyable;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.network.TileEntityRadioAUTOCAL;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class RadioAUTOCAL extends BlockMachineBase {
public class RadioAUTOCAL extends BlockDummyable {
public RadioAUTOCAL() {
super(Material.iron, 0);
this.rotatable = true;
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityRadioAUTOCAL();
if(meta >= 12) return new TileEntityRadioAUTOCAL();
return null;
}
@Override public int[] getDimensions() { return new int[] {1, 0, 0, 0, 0 ,0}; }
@Override public int getOffset() { return 0; }
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(player.isSneaking()) return false;
if(world.isRemote) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null) return false;
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
}
return true;
}
@Override public int getRenderType(){ return -1; }
@Override public boolean isOpaqueCube() { return false; }
@Override public boolean renderAsNormalBlock() { return false; }
}

View File

@ -0,0 +1,64 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.network.TileEntityRadioAUTOCAL;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.ResourceLocation;
public class GUIScreenRadioAUTOCAL extends GuiScreen {
protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_rtty_autocal.png");
protected TileEntityRadioAUTOCAL autocal;
protected int xSize = 150;
protected int ySize = 90;
protected int guiLeft;
protected int guiTop;
public GUIScreenRadioAUTOCAL(TileEntityRadioAUTOCAL autocal) {
this.autocal = autocal;
}
@Override
public void initGui() {
super.initGui();
this.guiLeft = (this.width - this.xSize) / 2;
this.guiTop = (this.height - this.ySize) / 2;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
this.drawDefaultBackground();
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
GL11.glDisable(GL11.GL_LIGHTING);
this.drawGuiContainerForegroundLayer(mouseX, mouseY);
GL11.glEnable(GL11.GL_LIGHTING);
}
private void drawGuiContainerForegroundLayer(int x, int y) {
}
private void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(autocal.isOn) drawTexturedModalRect(guiLeft + 8, guiTop + 36, 150, 0, 18, 18);
if(autocal.ignoreError) drawTexturedModalRect(guiLeft + 28, guiTop + 36, 150, 18, 18, 18);
if(autocal.autoReboot) drawTexturedModalRect(guiLeft + 48, guiTop + 36, 150, 36, 18, 18);
}
@Override
protected void keyTyped(char c, int b) {
if(b == 1 || b == Minecraft.getMinecraft().gameSettings.keyBindInventory.getKeyCode()) {
Minecraft.getMinecraft().thePlayer.closeScreen();
}
}
@Override public boolean doesGuiPauseGame() { return false; }
}

View File

@ -22,7 +22,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
public class GuiScreenRadioTelex extends GuiScreen {
public class GUIScreenRadioTelex extends GuiScreen {
protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_telex.png");
protected TileEntityRadioTelex telex;
@ -37,7 +37,7 @@ public class GuiScreenRadioTelex extends GuiScreen {
protected String[] txBuffer;
protected int cursorPos = 0;
public GuiScreenRadioTelex(TileEntityRadioTelex tile) {
public GUIScreenRadioTelex(TileEntityRadioTelex tile) {
this.telex = tile;
this.txBuffer = new String[tile.txBuffer.length];

View File

@ -358,6 +358,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPistonInserter.class, new RenderPistonInserter());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConveyorPress.class, new RenderConveyorPress());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRadioTelex.class, new RenderTelex());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRadioAUTOCAL.class, new RenderAUTOCAL());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePumpSteam.class, new RenderPump());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePumpElectric.class, new RenderPump());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineArcWelder.class, new RenderArcWelder());

View File

@ -421,6 +421,7 @@ public class ResourceManager {
//TELEX
public static final IModelCustom telex = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/telex.obj"));
public static final IModelCustom autocal = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/autocal.obj"));
////Textures TEs
@ -877,6 +878,7 @@ public class ResourceManager {
//TELEX
public static final ResourceLocation telex_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/telex.png");
public static final ResourceLocation autocal_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/autocal.png");
////Obj Items

View File

@ -0,0 +1,55 @@
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 net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
public class RenderAUTOCAL 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.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
switch(tile.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;
}
bindTexture(ResourceManager.autocal_tex);
ResourceManager.autocal.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.radio_autocal);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase( ) {
public void renderInventory() {
GL11.glTranslated(0, -4, 0);
GL11.glScaled(6.25, 6.25, 6.25);
}
public void renderCommon() {
bindTexture(ResourceManager.autocal_tex);
ResourceManager.autocal.renderAll();
}};
}
}

View File

@ -480,6 +480,7 @@ public class TileMappings {
put(TileEntityRadioTorchReader.class, "tileentity_rtty_reader");
put(TileEntityRadioTorchController.class, "tileentity_rtty_controller");
put(TileEntityRadioTelex.class, "tileentity_rtty_telex");
put(TileEntityRadioAUTOCAL.class, "tileentity_rtty_autocal");
put(TileEntityDroneWaypoint.class, "tileentity_drone_waypoint");
put(TileEntityDroneCrate.class, "tileentity_drone_crate");

View File

@ -2,14 +2,22 @@ package com.hbm.tileentity.network;
import java.util.HashMap;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.gui.GUIScreenRadioAUTOCAL;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityTickingBase;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class TileEntityRadioAUTOCAL extends TileEntityTickingBase implements IControlReceiver, IGUIProvider {
public class TileEntityRadioAUTOCAL extends TileEntityTickingBase {
public boolean isOn = false;
public boolean ignoreError = false;
public boolean autoReboot = false;
public Object buffer;
public NBTTagCompound variables;
@ -32,10 +40,29 @@ public class TileEntityRadioAUTOCAL extends TileEntityTickingBase {
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeBoolean(isOn);
buf.writeBoolean(ignoreError);
buf.writeBoolean(autoReboot);
}
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
this.isOn = buf.readBoolean();
this.ignoreError = buf.readBoolean();
this.autoReboot = buf.readBoolean();
}
@Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; }
@Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIScreenRadioAUTOCAL(this); }
@Override
public boolean hasPermission(EntityPlayer player) {
return player.getDistanceSq(xCoord + 0.5, yCoord + 1, zCoord + 0.5) <= 15 * 15;
}
@Override
public void receiveControl(NBTTagCompound data) {
}
}

View File

@ -5,7 +5,7 @@ import java.util.List;
import com.hbm.handler.CompatHandler;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.gui.GuiScreenRadioTelex;
import com.hbm.inventory.gui.GUIScreenRadioTelex;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityLoadedBase;
import com.hbm.tileentity.network.RTTYSystem.RTTYChannel;
@ -234,7 +234,7 @@ public class TileEntityRadioTelex extends TileEntityLoadedBase implements IContr
@Override
@SideOnly(Side.CLIENT)
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GuiScreenRadioTelex(this);
return new GUIScreenRadioTelex(this);
}
AxisAlignedBB bb = null;

View File

@ -4762,6 +4762,7 @@ tile.pwr_port.desc=Erlaubt IO für Items und Flüssigkeiten$Platzierung: Hülle
tile.pwr_reflector.name=PWR Neutronenreflektor
tile.pwr_reflector.desc=Reflektier Neutronen auf Brennstäbe zurück$Platzierung: Hülle, für höhere Reaktivität$Gültiger Block für Hülle
tile.radar_screen.name=Radarbildschirm
tile.radio_autocal.name=AUTOCAL-Rechenautomat
tile.radio_telex.name=Telex-Maschine
tile.radio_torch_controller.name=Redstone-over-Radio Controller
tile.radio_torch_controller.desc=Empfängt Steuersignale und gibt$sie an die verbundene Maschine weiter

View File

@ -6028,6 +6028,7 @@ tile.pwr_reflector.name=PWR Neutron Reflector
tile.pwr_reflector.desc=Reflects neutrons back to fuel rods$Placement: Grid, for increased reactivity$Valid casing material
tile.rad_lava_block.name=Volcanic Lava
tile.radar_screen.name=Radar Screen
tile.radio_autocal.name=AUTOCAL Automatic Calculator
tile.radio_telex.name=Telex Machine
tile.radio_torch_controller.name=Redstone-over-Radio Controller
tile.radio_torch_controller.desc=Can receive command signals and relays$them to the connected machine

View File

@ -0,0 +1,134 @@
# Blender v2.79 (sub 0) OBJ File: 'autocal.blend'
# www.blender.org
o Plane
v 0.500000 0.125000 0.375000
v 0.500000 0.125000 -0.375000
v 0.500000 1.500000 0.375000
v 0.500000 1.500000 -0.375000
v -0.500000 0.125000 0.375000
v 0.500000 0.000000 0.500000
v 0.500000 0.000000 -0.500000
v -0.500000 0.125000 -0.375000
v -0.500000 1.500000 0.375000
v 0.500000 2.000000 0.500000
v 0.500000 2.000000 -0.500000
v -0.500000 1.500000 -0.375000
v -0.500000 0.000000 -0.500000
v -0.500000 0.000000 0.500000
v -0.500000 2.000000 -0.500000
v -0.500000 2.000000 0.500000
v 0.437500 0.125000 0.375000
v 0.437500 0.125000 -0.375000
v 0.437500 1.500000 0.375000
v 0.437500 1.500000 -0.375000
v -0.437500 0.125000 -0.375000
v -0.437500 0.125000 0.375000
v -0.437500 1.500000 -0.375000
v -0.437500 1.500000 0.375000
v 0.501000 1.671875 0.375000
v 0.501000 1.578125 0.375000
v 0.501000 1.671875 -0.375000
v 0.501000 1.578125 -0.375000
vt 0.428571 0.000000
vt 0.285714 0.250000
vt 0.285714 0.000000
vt 0.285714 0.750000
vt 0.428571 1.000000
vt 0.285714 1.000000
vt 0.580357 0.640625
vt 0.687500 0.625000
vt 0.687500 0.640625
vt 0.821429 0.625000
vt 0.812500 0.281250
vt 0.821429 0.281250
vt 0.687500 0.265625
vt 0.580357 0.281250
vt 0.580357 0.265625
vt 0.303571 0.281250
vt 0.428571 0.250000
vt 0.410714 0.281250
vt 0.410714 0.625000
vt 0.303571 0.625000
vt 0.428571 0.750000
vt 0.571429 0.250000
vt 0.571429 0.750000
vt 0.142857 0.750000
vt 0.017857 0.281250
vt 0.142857 0.250000
vt 0.125000 0.281250
vt 0.125000 0.625000
vt 0.000000 0.750000
vt 0.017857 0.625000
vt 0.000000 0.250000
vt 0.705357 0.625000
vt 0.705357 0.281250
vt 0.687500 0.281250
vt 0.580357 0.625000
vt 0.696429 0.281250
vt 0.696429 0.625000
vt 0.571429 0.281250
vt 0.571429 0.625000
vt 0.696429 0.625000
vt 0.696429 0.281250
vt 0.812500 0.265625
vt 0.705357 0.265625
vt 0.705357 0.640625
vt 0.812500 0.625000
vt 0.812500 0.640625
vt 0.428571 0.750000
vt 1.000000 0.875000
vt 0.428571 0.875000
vt 1.000000 0.750000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn -1.0000 0.0000 0.0000
s off
f 13/1/1 6/2/1 14/3/1
f 10/4/2 15/5/2 16/6/2
f 12/7/1 24/8/1 9/9/1
f 4/10/3 18/11/3 2/12/3
f 5/13/2 21/14/2 8/15/2
f 1/16/4 7/17/4 2/18/4
f 4/19/4 10/4/4 3/20/4
f 4/19/4 7/17/4 11/21/4
f 3/20/4 6/2/4 1/16/4
f 11/21/5 13/22/5 15/23/5
f 16/24/3 6/2/3 10/4/3
f 8/25/6 14/26/6 5/27/6
f 9/28/6 15/29/6 12/30/6
f 12/30/6 13/31/6 8/25/6
f 9/28/6 14/26/6 16/24/6
f 18/11/4 19/32/4 17/33/4
f 22/34/6 23/35/6 21/14/6
f 1/36/5 19/32/5 3/37/5
f 8/38/3 23/35/3 12/39/3
f 9/40/5 22/34/5 5/41/5
f 2/42/2 17/33/2 1/43/2
f 3/44/1 20/45/1 4/46/1
f 26/47/4 27/48/4 25/49/4
f 13/1/1 7/17/1 6/2/1
f 10/4/2 11/21/2 15/5/2
f 12/7/1 23/35/1 24/8/1
f 4/10/3 20/45/3 18/11/3
f 5/13/2 22/34/2 21/14/2
f 1/16/4 6/2/4 7/17/4
f 4/19/4 11/21/4 10/4/4
f 4/19/4 2/18/4 7/17/4
f 3/20/4 10/4/4 6/2/4
f 11/21/5 7/17/5 13/22/5
f 16/24/3 14/26/3 6/2/3
f 8/25/6 13/31/6 14/26/6
f 9/28/6 16/24/6 15/29/6
f 12/30/6 15/29/6 13/31/6
f 9/28/6 5/27/6 14/26/6
f 18/11/4 20/45/4 19/32/4
f 22/34/6 24/8/6 23/35/6
f 1/36/5 17/33/5 19/32/5
f 8/38/3 21/14/3 23/35/3
f 9/40/5 24/8/5 22/34/5
f 2/42/2 18/11/2 17/33/2
f 3/44/1 19/32/1 20/45/1
f 26/47/4 28/50/4 27/48/4

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB