mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge branch 'HbmMods:master' into Optimization
This commit is contained in:
commit
a39dbeb2ec
@ -6,6 +6,8 @@
|
||||
* Updated CMB brick texture
|
||||
* The ICF machine block now renders with its 3d model in the creative inventory
|
||||
* "Toggle backpack" keybind is now called "toggle jetpack" to reduce confusion
|
||||
* The xenium resonator can now teleport players using the radar linker
|
||||
* Inserters now have a toggleable destroyer mode which will delete items that cannot be inserted or cached instead of spilling them
|
||||
|
||||
## Fixed
|
||||
* Fixed pumpjack gauges not syncing properly
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5061
|
||||
mod_build_number=5082
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
|
||||
@ -82,10 +82,13 @@ public class CraneInserter extends BlockCraneBase implements IEnterableBlock {
|
||||
addToInventory(inv, access, toAdd, outputDirection.getOpposite().ordinal());
|
||||
}
|
||||
|
||||
TileEntityCraneInserter inserter = null;
|
||||
|
||||
if(toAdd.stackSize > 0) {
|
||||
addToInventory((TileEntityCraneInserter) world.getTileEntity(x, y, z), null, toAdd, outputDirection.getOpposite().ordinal());
|
||||
inserter = (TileEntityCraneInserter) world.getTileEntity(x, y, z);
|
||||
addToInventory(inserter, null, toAdd, outputDirection.getOpposite().ordinal());
|
||||
}
|
||||
if(toAdd.stackSize > 0) {
|
||||
if(toAdd.stackSize > 0 && inserter != null && !inserter.destroyer) {
|
||||
EntityItem drop = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, toAdd.copy());
|
||||
world.spawnEntityInWorld(drop);
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ public class ContainerCraneInserter extends Container {
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 7; j++) {
|
||||
this.addSlotToContainer(new Slot(inserter, j + i * 7, 26 + j * 18, 17 + i * 18));
|
||||
this.addSlotToContainer(new Slot(inserter, j + i * 7, 8 + j * 18, 17 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,11 +4,15 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCraneInserter;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.network.TileEntityCraneInserter;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUICraneInserter extends GuiInfoContainer {
|
||||
@ -23,11 +27,23 @@ public class GUICraneInserter extends GuiInfoContainer {
|
||||
this.xSize = 176;
|
||||
this.ySize = 185;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 151 <= x && guiLeft + 151 + 18 > x && guiTop + 34 < y && guiTop + 34 + 18 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("destroyer", true);
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, inserter.xCoord, inserter.yCoord, inserter.zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.inserter.hasCustomInventoryName() ? this.inserter.getInventoryName() : I18n.format(this.inserter.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2 - 18, 5, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@ -36,5 +52,8 @@ public class GUICraneInserter extends GuiInfoContainer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(inserter.destroyer)
|
||||
drawTexturedModalRect(guiLeft + 151, guiTop + 34, 176, 0, 18, 18);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ public class ItemDiscord extends Item {
|
||||
|
||||
MovingObjectPosition pos = Library.rayTrace(player, 100, 1);
|
||||
|
||||
if(pos.typeOfHit == MovingObjectType.BLOCK) {
|
||||
if(pos != null && pos.typeOfHit == MovingObjectType.BLOCK) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.lib;
|
||||
public class RefStrings {
|
||||
public static final String MODID = "hbm";
|
||||
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
||||
public static final String VERSION = "1.0.27 BETA (5061)";
|
||||
public static final String VERSION = "1.0.27 BETA (5082)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -2,7 +2,6 @@ package com.hbm.tileentity.network;
|
||||
|
||||
import api.hbm.conveyor.IConveyorBelt;
|
||||
import com.hbm.entity.item.EntityMovingItem;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerCraneExtractor;
|
||||
import com.hbm.inventory.gui.GUICraneExtractor;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -26,7 +25,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGUIProvider, IControlReceiver, IControlReceiverFilter {
|
||||
public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGUIProvider, IControlReceiverFilter {
|
||||
|
||||
public boolean isWhitelist = false;
|
||||
public ModulePatternMatcher matcher;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.network;
|
||||
|
||||
import com.hbm.blocks.network.CraneInserter;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerCraneInserter;
|
||||
import com.hbm.inventory.gui.GUICraneInserter;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
@ -8,18 +9,22 @@ import com.hbm.util.InventoryUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCraneInserter extends TileEntityCraneBase implements IGUIProvider {
|
||||
public class TileEntityCraneInserter extends TileEntityCraneBase implements IGUIProvider, IControlReceiver {
|
||||
|
||||
public boolean destroyer = true;
|
||||
public static final int[] access = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
|
||||
|
||||
public TileEntityCraneInserter() {
|
||||
@ -82,9 +87,23 @@ public class TileEntityCraneInserter extends TileEntityCraneBase implements IGUI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.networkPackNT(15);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeBoolean(destroyer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
destroyer = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return access;
|
||||
@ -110,4 +129,26 @@ public class TileEntityCraneInserter extends TileEntityCraneBase implements IGUI
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUICraneInserter(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.destroyer = nbt.getBoolean("destroyer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setBoolean("destroyer", this.destroyer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return Vec3.createVectorHelper(xCoord - player.posX, yCoord - player.posY, zCoord - player.posZ).lengthVector() < 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
if(data.hasKey("destroyer")) this.destroyer = !this.destroyer;
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,4 +36,4 @@ public net.minecraft.world.gen.ChunkProviderFlat field_82702_h # ha
|
||||
public net.minecraft.world.gen.ChunkProviderServer field_73248_b # chunksToUnload
|
||||
|
||||
# ItemRenderer
|
||||
public net.minecraft.client.renderer.ItemRenderer.field_78453_b # itemToRender
|
||||
public net.minecraft.client.renderer.ItemRenderer field_78453_b # itemToRender
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.8 KiB |
Loading…
x
Reference in New Issue
Block a user