just throw a continental breakfast at my face

This commit is contained in:
Boblet 2025-10-09 16:57:31 +02:00
parent a0670eb700
commit db3f58b4cd
9 changed files with 144 additions and 12 deletions

View File

@ -8,6 +8,9 @@
* The multi ID now changes metadata based on the selected fluid type, allowing it to be usable for crafting pre-defined pipes
* The multi ID fluid selector now displays fluid traits in addition to the name when hovering over an icon
* Added more values to the data table returned by RBMK consoles via OC integration
* The conveyor ejector now has a "only take maximum possible" toggle
* Enabling this means that, if stack ejection upgrades are installed, only stacks that meet the limit can be ejected
* Items with a lower maximum stacksize will be ejected regardless
## Fixed
* Fixed the T-51b set not having radiation resistance

View File

@ -26,13 +26,13 @@ public class ContainerCraneExtractor extends ContainerBase {
}
//buffer
addSlots(extractor,9,8,17,3,3);
addSlots(extractor, 9, 8, 17, 3, 3);
//upgrades
this.addSlotToContainer(new SlotUpgrade(extractor, 18, 152, 23));
this.addSlotToContainer(new SlotUpgrade(extractor, 19, 152, 47));
playerInv(invPlayer, 8, 103, 161);
playerInv(invPlayer, 26, 103, 161);
}

View File

@ -12,7 +12,6 @@ import com.hbm.packet.toserver.NBTControlPacket;
import com.hbm.tileentity.network.TileEntityCraneExtractor;
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.inventory.Slot;
@ -29,7 +28,7 @@ public class GUICraneExtractor extends GuiInfoContainer {
super(new ContainerCraneExtractor(invPlayer, tedf));
ejector = tedf;
this.xSize = 176;
this.xSize = 212;
this.ySize = 185;
}
@ -46,15 +45,25 @@ public class GUICraneExtractor extends GuiInfoContainer {
}
}
}
if(guiLeft + 187 <= x && guiLeft + 187 + 18 > x && guiTop + 34 < y && guiTop + 34 + 18 >= y) {
this.func_146283_a(Arrays.asList(new String[] { "Only take maximum possible: " + (ejector.maxEject ? EnumChatFormatting.GREEN + "ON" : EnumChatFormatting.RED + "OFF") }), x, y);
}
}
@Override
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft + 128 <= x && guiLeft + 128 + 14 > x && guiTop + 30 < y && guiTop + 30 + 26 >= y) {
if(guiLeft + 187 <= x && guiLeft + 187 + 18 > x && guiTop + 34 < y && guiTop + 34 + 18 >= y) {
click();
NBTTagCompound data = new NBTTagCompound();
data.setBoolean("maxEject", true);
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, ejector.xCoord, ejector.yCoord, ejector.zCoord));
}
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
if(guiLeft + 128 <= x && guiLeft + 128 + 14 > x && guiTop + 30 < y && guiTop + 30 + 26 >= y) {
click();
NBTTagCompound data = new NBTTagCompound();
data.setBoolean("whitelist", true);
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, ejector.xCoord, ejector.yCoord, ejector.zCoord));
@ -74,10 +83,12 @@ public class GUICraneExtractor extends GuiInfoContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(ejector.maxEject) drawTexturedModalRect(guiLeft + 187, guiTop + 34, 212, 0, 18, 18);
if(ejector.isWhitelist) {
drawTexturedModalRect(guiLeft + 139, guiTop + 33, 176, 0, 3, 6);
drawTexturedModalRect(guiLeft + 139, guiTop + 33, 212, 18, 3, 6);
} else {
drawTexturedModalRect(guiLeft + 139, guiTop + 47, 176, 0, 3, 6);
drawTexturedModalRect(guiLeft + 139, guiTop + 47, 212, 18, 3, 6);
}
}
}

View File

@ -1,5 +1,7 @@
package com.hbm.inventory.gui;
import java.util.Arrays;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerCraneInserter;
@ -13,6 +15,7 @@ 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.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
public class GUICraneInserter extends GuiInfoContainer {
@ -27,6 +30,15 @@ public class GUICraneInserter extends GuiInfoContainer {
this.xSize = 176;
this.ySize = 185;
}
@Override
public void drawScreen(int x, int y, float interp) {
super.drawScreen(x, y, interp);
if(guiLeft + 151 <= x && guiLeft + 151 + 18 > x && guiTop + 34 < y && guiTop + 34 + 18 >= y) {
this.func_146283_a(Arrays.asList(new String[] { "Destroy overflow: " + (inserter.destroyer ? EnumChatFormatting.GREEN + "ON" : EnumChatFormatting.RED + "OFF") }), x, y);
}
}
@Override
protected void mouseClicked(int x, int y, int i) {

View File

@ -1480,6 +1480,7 @@ public class ModItems {
public static Item gun_double_barrel_sacred_dragon;
public static Item gun_n_i_4_n_i;
public static Item gun_charge_thrower;
public static Item gun_drill;
public static Item ammo_standard;
public static Item ammo_secret;
@ -6417,6 +6418,7 @@ public class ModItems {
GameRegistry.registerItem(gun_fireext, gun_fireext.getUnlocalizedName());
GameRegistry.registerItem(gun_charge_thrower, gun_charge_thrower.getUnlocalizedName());
GameRegistry.registerItem(gun_drill, gun_drill.getUnlocalizedName());
GameRegistry.registerItem(ammo_standard, ammo_standard.getUnlocalizedName());
GameRegistry.registerItem(ammo_secret, ammo_secret.getUnlocalizedName());

View File

@ -24,6 +24,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.impl.ItemGunChargeThrower;
import com.hbm.items.weapon.sedna.impl.ItemGunDrill;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
@ -275,6 +276,17 @@ public class XFactoryTool {
.setupStandardConfiguration()
.anim(LAMBDA_CT_ANIMS).orchestra(Orchestras.ORCHESTRA_CHARGE_THROWER)
).setUnlocalizedName("gun_charge_thrower");
ModItems.gun_drill = new ItemGunDrill(WeaponQuality.UTILITY, new GunConfig()
.dura(3_000).draw(10).inspect(55).reloadChangeType(true).hideCrosshair(false).crosshair(Crosshair.L_CIRCUMFLEX)
.rec(new Receiver(0)
.dmg(10F).delay(4).dry(10).auto(true).spread(0F).spreadHipfire(0F).reload(60).jam(0).sound("hbm:weapon.fire.grenade", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 1).addConfigs(ct_hook, ct_mortar, ct_mortar_charge))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire())
.setupStandardConfiguration()
//.anim(LAMBDA_CT_ANIMS).orchestra(Orchestras.ORCHESTRA_CHARGE_THROWER)
).setUnlocalizedName("gun_drill");
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_CT = (stack, ctx) -> {

View File

@ -0,0 +1,78 @@
package com.hbm.items.weapon.sedna.impl;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import api.hbm.energymk2.IBatteryItem;
import api.hbm.fluidmk2.IFillableItem;
import net.minecraft.item.ItemStack;
public class ItemGunDrill extends ItemGunBaseNT implements IFillableItem, IBatteryItem {
public ItemGunDrill(WeaponQuality quality, GunConfig... cfg) {
super(quality, cfg);
}
@Override
public boolean acceptsFluid(FluidType type, ItemStack stack) {
return false;
}
@Override
public int tryFill(FluidType type, int amount, ItemStack stack) {
return 0;
}
@Override public boolean providesFluid(FluidType type, ItemStack stack) { return false; }
@Override
public int tryEmpty(FluidType type, int amount, ItemStack stack) {
return 0;
}
@Override
public FluidType getFirstFluidType(ItemStack stack) {
return null;
}
@Override
public int getFill(ItemStack stack) {
return 0;
}
@Override
public void chargeBattery(ItemStack stack, long i) {
}
@Override
public void setCharge(ItemStack stack, long i) {
}
@Override
public void dischargeBattery(ItemStack stack, long i) {
}
@Override
public long getCharge(ItemStack stack) {
return 0;
}
@Override
public long getMaxCharge(ItemStack stack) {
return 0;
}
@Override
public long getChargeRate() {
return 0;
}
@Override
public long getDischargeRate() {
return 0;
}
}

View File

@ -31,6 +31,7 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGUIProvider, IControlReceiverFilter {
public boolean isWhitelist = false;
public boolean maxEject = false;
public ModulePatternMatcher matcher;
public TileEntityCraneExtractor() {
@ -113,8 +114,10 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
int index = access == null ? i : access[i];
ItemStack stack = inv.getStackInSlot(index);
if(stack != null && (sided == null || sided.canExtractItem(index, stack, inputSide.getOpposite().ordinal()))){
if(stack != null && (sided == null || sided.canExtractItem(index, stack, inputSide.getOpposite().ordinal()))) {
int maxTarget = Math.min(amount, stack.getMaxStackSize());
if(this.maxEject && stack.stackSize < maxTarget) continue;
boolean match = this.matchesFilter(stack);
if((isWhitelist && match) || (!isWhitelist && !match)) {
@ -146,6 +149,9 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
if(stack != null){
stack = stack.copy();
int toSend = Math.min(amount, stack.stackSize);
int maxTarget = Math.min(amount, stack.getMaxStackSize());
if(this.maxEject && stack.stackSize < maxTarget) continue;
decrStackSize(i, toSend);
stack.stackSize = toSend;
@ -169,7 +175,7 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
moving.setItemStack(stack);
worldObj.spawnEntityInWorld(moving);
if (belt instanceof IEnterableBlock) {
if(belt instanceof IEnterableBlock) {
IEnterableBlock enterable = (IEnterableBlock) belt;
if(enterable.canItemEnter(worldObj, xCoord + outputSide.offsetX, yCoord + outputSide.offsetY, zCoord + outputSide.offsetZ, outputSide.getOpposite(), moving)) {
@ -183,6 +189,7 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeBoolean(isWhitelist);
buf.writeBoolean(maxEject);
this.matcher.serialize(buf);
}
@ -190,6 +197,7 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
isWhitelist = buf.readBoolean();
maxEject = buf.readBoolean();
this.matcher.deserialize(buf);
}
@ -250,6 +258,7 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.isWhitelist = nbt.getBoolean("isWhitelist");
this.maxEject = nbt.getBoolean("maxEject");
this.matcher.readFromNBT(nbt);
}
@ -257,6 +266,7 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setBoolean("isWhitelist", this.isWhitelist);
nbt.setBoolean("maxEject", this.maxEject);
this.matcher.writeToNBT(nbt);
}
@ -270,14 +280,18 @@ public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGU
if(data.hasKey("whitelist")) {
this.isWhitelist = !this.isWhitelist;
}
if(data.hasKey("maxEject")) {
this.maxEject = !this.maxEject;
}
if(data.hasKey("slot")){
setFilterContents(data);
}
this.markDirty();
}
@Override
public int[] getFilterSlots() {
return new int[]{0,9};
return new int[] {0, 9};
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB