bueff strokinoff

This commit is contained in:
HbmMods 2026-06-22 22:29:29 +02:00
parent c6f78d17c9
commit 0fcb0d05c4
10 changed files with 180 additions and 9 deletions

View File

@ -1,6 +1,7 @@
package com.hbm.blocks.network.pneumatic; package com.hbm.blocks.network.pneumatic;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.network.pneumatic.TileEntityPneumoStorageImporter;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
@ -17,7 +18,7 @@ public class PneumoStorageImporter extends BlockContainer {
@Override @Override
public TileEntity createNewTileEntity(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
return null; return new TileEntityPneumoStorageImporter();
} }
@Override @Override

View File

@ -0,0 +1,15 @@
package com.hbm.inventory.container;
import com.hbm.tileentity.network.pneumatic.TileEntityPneumoStorageImporter;
import net.minecraft.entity.player.InventoryPlayer;
public class ContainerPneumoStorageImporter extends ContainerBase {
public ContainerPneumoStorageImporter(InventoryPlayer invPlayer, TileEntityPneumoStorageImporter importer) {
super(invPlayer, importer);
addSlots(importer, 0, 62, 17, 3, 3);
playerInv(invPlayer, 103);
}
}

View File

@ -0,0 +1,42 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerPneumoStorageImporter;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.network.pneumatic.TileEntityPneumoStorageImporter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUIPneumoStorageImporter extends GuiContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_pneumatic_importer.png");
private TileEntityPneumoStorageImporter importer;
public GUIPneumoStorageImporter(InventoryPlayer invPlayer, TileEntityPneumoStorageImporter importer) {
super(new ContainerPneumoStorageImporter(invPlayer, importer));
this.importer = importer;
this.xSize = 176;
this.ySize = 186;
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.importer.hasCustomInventoryName() ? this.importer.getInventoryName() : I18n.format(this.importer.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 5, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
}

View File

@ -14,7 +14,6 @@ import api.hbm.ntl.StackCache;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityPneumoStorageAccess extends TileEntityLoadedBase implements IPneumaticConnector, IGUIProvider { public class TileEntityPneumoStorageAccess extends TileEntityLoadedBase implements IPneumaticConnector, IGUIProvider {
@ -69,12 +68,6 @@ public class TileEntityPneumoStorageAccess extends TileEntityLoadedBase implemen
if(this.cache != null) this.cache.dissolveCache(); if(this.cache != null) this.cache.dissolveCache();
} }
@Override
public boolean canConnectPneumatic(ForgeDirection dir) {
ForgeDirection selfdir = ForgeDirection.getOrientation(getBlockMetadata());
return dir == selfdir.getOpposite();
}
@Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerPneumoStorageAccess(player.inventory, this); } @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerPneumoStorageAccess(player.inventory, this); }
@Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIPneumoStorageAccess(player.inventory, this); } @Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIPneumoStorageAccess(player.inventory, this); }
} }

View File

@ -0,0 +1,112 @@
package com.hbm.tileentity.network.pneumatic;
import com.hbm.inventory.container.ContainerPneumoStorageImporter;
import com.hbm.inventory.gui.GUIPneumoStorageImporter;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.tileentity.network.pneumatic.TileEntityPneumoTube.PneumaticNode;
import com.hbm.uninos.UniNodespace;
import com.hbm.uninos.networkproviders.PneumaticNetworkProvider;
import com.hbm.util.fauxpointtwelve.BlockPos;
import api.hbm.ntl.IPneumaticConnector;
import api.hbm.ntl.StackCache;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class TileEntityPneumoStorageImporter extends TileEntityMachineBase implements IPneumaticConnector, IGUIProvider {
protected PneumaticNode node;
public StackCache cache;
public int[] delay = new int[9];
public int[] SLOT_ACCESS = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8};
public TileEntityPneumoStorageImporter() {
super(9);
}
@Override
public String getName() {
return "container.pneumoStorageImporter";
}
@Override
public void setInventorySlotContents(int i, ItemStack stack) {
super.setInventorySlotContents(i, stack);
if(stack != null) this.delay[i] = Math.max(this.delay[i], 1);
}
@Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return true; }
@Override public int[] getAccessibleSlotsFromSide(int side) { return SLOT_ACCESS; }
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
if(this.node == null || this.node.expired) {
if(this.cache != null) this.cache.dissolveCache();
this.node = (PneumaticNode) UniNodespace.getNode(worldObj, xCoord, yCoord, zCoord, PneumaticNetworkProvider.THE_PROVIDER);
if(this.node == null || this.node.expired) {
this.node = (PneumaticNode) new PneumaticNode(new BlockPos(xCoord, yCoord, zCoord)).setStandardConnections(xCoord, yCoord, zCoord);
UniNodespace.createNode(worldObj, this.node);
}
}
if(this.cache == null || this.cache.hasExpired) {
this.cache = new StackCache(xCoord, yCoord, zCoord);
}
if(this.node != null && this.node.hasValidNet()) {
this.node.net.addStackCache(cache);
}
if(this.cache != null && !this.cache.hasExpired) for(int i = 0; i < 9; i++) {
if(this.delay[i] > 0) {
this.delay[i]--;
continue;
}
ItemStack stack = slots[i];
if(stack == null) continue;
int leftover = (int) this.cache.addItemsAndReturnQuantity(stack, stack.stackSize);
if(leftover == stack.stackSize) {
this.delay[i] = 100;
} else {
this.decrStackSize(i, stack.stackSize - leftover);
}
}
}
}
@Override
public void invalidate() {
super.invalidate();
if(!worldObj.isRemote && this.node != null) {
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, PneumaticNetworkProvider.THE_PROVIDER);
}
if(this.cache != null) this.cache.dissolveCache();
}
@Override
public void onChunkUnload() {
super.onChunkUnload();
if(!worldObj.isRemote && this.node != null) {
UniNodespace.destroyNode(worldObj, xCoord, yCoord, zCoord, PneumaticNetworkProvider.THE_PROVIDER);
}
if(this.cache != null) this.cache.dissolveCache();
}
@Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerPneumoStorageImporter(player.inventory, this); }
@Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIPneumoStorageImporter(player.inventory, this); }
}

View File

@ -134,7 +134,7 @@ public class PneumaticNetwork extends NodeNet {
TileEntity tile1 = source instanceof TileEntity ? (TileEntity) source : null; TileEntity tile1 = source instanceof TileEntity ? (TileEntity) source : null;
int attempts = 0; int attempts = 0;
int maxAttempts = receiverList.size(); int maxAttempts = Math.min(receiverList.size(), 5);
// try all receivers for both modes, in an attempts based system. // try all receivers for both modes, in an attempts based system.
// instead of bailing out of trying after the first failure (which means you have to wait 0.25 seconds), we just try the next one. // instead of bailing out of trying after the first failure (which means you have to wait 0.25 seconds), we just try the next one.

View File

@ -359,6 +359,8 @@ container.paSource=Teilchenquelle
container.plasmaHeater=Plasmaerhitzer container.plasmaHeater=Plasmaerhitzer
container.pneumoStorageAccess=PLS Zugangsterminal container.pneumoStorageAccess=PLS Zugangsterminal
container.pneumoStorageClutter=PLS Gerümpelkiste container.pneumoStorageClutter=PLS Gerümpelkiste
container.pneumoStorageImporter=PSN Importer
container.pneumoStorageMono=PLS Massenspeicher
container.pneumoTube=Rohrpost container.pneumoTube=Rohrpost
container.press=Befeuerte Presse container.press=Befeuerte Presse
container.puf6_tank=PuF6 Tank container.puf6_tank=PuF6 Tank
@ -4740,6 +4742,8 @@ tile.plasma_heater.name=Plasmaerhitzer
tile.plushie.name=%s Plüschfigur tile.plushie.name=%s Plüschfigur
tile.pneumatic_storage_access.name=Pneumatisches Lagersystem - Zugangsterminal tile.pneumatic_storage_access.name=Pneumatisches Lagersystem - Zugangsterminal
tile.pneumatic_storage_clutter.name=Pneumatisches Lagersystem - Gerümpelkiste tile.pneumatic_storage_clutter.name=Pneumatisches Lagersystem - Gerümpelkiste
tile.pneumatic_storage_importer.name=Pneumatisches Lagersystem - Importer
tile.pneumatic_storage_mono.name=Pneumatisches Lagersystem - Massenspeicher
tile.pneumatic_tube.name=Rohrpost tile.pneumatic_tube.name=Rohrpost
tile.pneumatic_tube.desc=Sendted Items mit Druckluft.$Rechtsklick mit Schraubenzieher aktiviert den Eingang.$Shift-Rechtskick mit Schrabuenzieher aktiviert den Ausgang.$Eingänge können konfiguriert und mit Druckluft verbunden werden.$Sendet bis zu einem Stack, vier Mal pro Sekunde. tile.pneumatic_tube.desc=Sendted Items mit Druckluft.$Rechtsklick mit Schraubenzieher aktiviert den Eingang.$Shift-Rechtskick mit Schrabuenzieher aktiviert den Ausgang.$Eingänge können konfiguriert und mit Druckluft verbunden werden.$Sendet bis zu einem Stack, vier Mal pro Sekunde.
tile.pneumatic_tube_paintable.name=Geschirmte Rohrpost (Färbbar) tile.pneumatic_tube_paintable.name=Geschirmte Rohrpost (Färbbar)

View File

@ -761,6 +761,8 @@ container.paSource=Particle Source
container.plasmaHeater=Plasma Heater container.plasmaHeater=Plasma Heater
container.pneumoStorageAccess=PSN Access Terminal container.pneumoStorageAccess=PSN Access Terminal
container.pneumoStorageClutter=PSN Clutter Storage container.pneumoStorageClutter=PSN Clutter Storage
container.pneumoStorageImporter=PSN Importer
container.pneumoStorageMono=PSN Bulk Storage
container.pneumoTube=Pneumatic Tube container.pneumoTube=Pneumatic Tube
container.press=Burner Press container.press=Burner Press
container.puf6_tank=PuF6 Tank container.puf6_tank=PuF6 Tank
@ -6000,6 +6002,8 @@ tile.plasma_heater.name=Plasma Heater
tile.plushie.name=%s Plushie tile.plushie.name=%s Plushie
tile.pneumatic_storage_access.name=Pneumatic Storage Network - Access Terminal tile.pneumatic_storage_access.name=Pneumatic Storage Network - Access Terminal
tile.pneumatic_storage_clutter.name=Pneumatic Storage Network - Clutter Storage tile.pneumatic_storage_clutter.name=Pneumatic Storage Network - Clutter Storage
tile.pneumatic_storage_importer.name=Pneumatic Storage Network - Importer
tile.pneumatic_storage_mono.name=Pneumatic Storage Network - Bulk Storage
tile.pneumatic_tube.name=Pneumatic Tube tile.pneumatic_tube.name=Pneumatic Tube
tile.pneumatic_tube.desc=Sends items using compressed air.$Right-click with screwdriver to toggle an input.$Shift right-click with screwdriver to toggle an output.$Inputs can be configured, and connected to compressed air.$Sends up to one stack, four times per second. tile.pneumatic_tube.desc=Sends items using compressed air.$Right-click with screwdriver to toggle an input.$Shift right-click with screwdriver to toggle an output.$Inputs can be configured, and connected to compressed air.$Sends up to one stack, four times per second.
tile.pneumatic_tube_paintable.name=Paintable Pneumatic Tube tile.pneumatic_tube_paintable.name=Paintable Pneumatic Tube

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB