Merge branch 'HbmMods:master' into master

This commit is contained in:
Raaaaaaaaaay 2026-01-30 14:31:00 +02:00 committed by GitHub
commit 84e718cd97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 203 additions and 95 deletions

View File

@ -20,6 +20,8 @@
* Increased the power draw on the osmiridium welding recipe
* Bullet casings now make sounds when falling to the ground
* Most ammo types now have QMAW pages, including information on whether or not they are a war crime
* Both assembly and chemical factories now have four special ports that only allow items inserted to go into one recipe group
* All models using the HFR wavefront loader can now be hot-swapped via resource reload (F3 + T)
# Fixed
* Potentially fixed yet another issue regarding crates
@ -34,3 +36,5 @@
* Fixed arc furnace IO slots stacking items with incompatible NBT
* Fixed a bounding box issue with casing particles, causing them to slide sideways on the first tick, making trajectories weird
* Fixed some turrets not using the more modern casing spawner system which allows casings to have a smoke trail
* Fixed incorrect tooltip on the upgrade stat screen for assembly factories
* Fixed crash caused by RBMK overpressure meltdown mechanic

View File

@ -72,8 +72,9 @@ public class MachineAssemblyFactory extends BlockDummyable implements ITooltipPr
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
if(!(te instanceof TileEntityMachineAssemblyFactory)) return;
TileEntityMachineAssemblyFactory assemfac = (TileEntityMachineAssemblyFactory) te;
DirPos[] cool = assemfac.getCoolPos();
DirPos[] io = assemfac.getIOPos();
for(DirPos dirPos : cool) if(dirPos.compare(x + dirPos.getDir().offsetX, y, z + dirPos.getDir().offsetZ)) {
List<String> text = new ArrayList();
@ -84,5 +85,15 @@ public class MachineAssemblyFactory extends BlockDummyable implements ITooltipPr
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
break;
}
for(int i = 0; i < io.length; i++) {
DirPos port = io[i];
if(port.compare(x + port.getDir().offsetX, y, z + port.getDir().offsetZ)) {
List<String> text = new ArrayList();
text.add(EnumChatFormatting.YELLOW + "-> " + EnumChatFormatting.RESET + "Recipe field [" + (i + 1) + "]");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
break;
}
}
}
}

View File

@ -74,6 +74,7 @@ public class MachineChemicalFactory extends BlockDummyable implements ITooltipPr
TileEntityMachineChemicalFactory chemfac = (TileEntityMachineChemicalFactory) te;
DirPos[] cool = chemfac.getCoolPos();
DirPos[] io = chemfac.getIOPos();
for(DirPos dirPos : cool) if(dirPos.compare(x + dirPos.getDir().offsetX, y, z + dirPos.getDir().offsetZ)) {
List<String> text = new ArrayList();
@ -84,5 +85,15 @@ public class MachineChemicalFactory extends BlockDummyable implements ITooltipPr
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
break;
}
for(int i = 0; i < io.length; i++) {
DirPos port = io[i];
if(port.compare(x + port.getDir().offsetX, y, z + port.getDir().offsetZ)) {
List<String> text = new ArrayList();
text.add(EnumChatFormatting.YELLOW + "-> " + EnumChatFormatting.RESET + "Recipe field [" + (i + 1) + "]");
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
break;
}
}
}
}

View File

@ -61,6 +61,7 @@ import com.hbm.render.item.ItemRenderMissileGeneric.RenderMissileType;
import com.hbm.render.item.block.ItemRenderBlock;
import com.hbm.render.item.block.ItemRenderDecoBlock;
import com.hbm.render.item.weapon.*;
import com.hbm.render.loader.HFRModelReloader;
import com.hbm.render.loader.HmfModelLoader;
import com.hbm.render.model.ModelPigeon;
import com.hbm.render.tileentity.*;
@ -162,7 +163,9 @@ public class ClientProxy extends ServerProxy {
Jars.initJars();
((IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager()).registerReloadListener(new QMAWLoader());
IReloadableResourceManager resourceMan = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager();
resourceMan.registerReloadListener(new QMAWLoader());
resourceMan.registerReloadListener(new HFRModelReloader());
if(GeneralConfig.enableSoundExtension) {
SoundSystemConfig.setNumberNormalChannels(GeneralConfig.normalSoundChannels);

View File

@ -332,6 +332,8 @@ public class ResourceManager {
//PheoDoors
public static final ResourceLocation pheo_fire_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/fire_door.png");
public static final ResourceLocation pheo_fire_door_black_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/fire_door_black.png");
public static final ResourceLocation pheo_fire_door_orange_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/fire_door_orange.png");
public static IModelCustomNamed pheo_fire_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/fire_door.obj")).asVBO();
public static final ResourceLocation pheo_airlock_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/airlock_door.png");
public static IModelCustomNamed pheo_airlock_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/pheodoors/airlock_door.obj")).asVBO();

View File

@ -1,5 +1,6 @@
package com.hbm.render.anim;
import com.hbm.interfaces.NotableComments;
import com.hbm.util.Clock;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
@ -7,6 +8,7 @@ import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
@NotableComments
public class HbmAnimations {
//in flans mod and afaik also MW, there's an issue that there is only one

View File

@ -12,6 +12,7 @@ import com.hbm.items.weapon.ItemAmmoHIMARS.HIMARSRocket;
import com.hbm.main.ResourceManager;
import com.hbm.render.tileentity.RenderBobble;
import com.hbm.render.tileentity.RenderDemonLamp;
import com.hbm.util.Clock;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
@ -623,7 +624,11 @@ public class ItemRenderLibrary {
GL11.glScaled(3.5, 3.5, 3.5);
}
public void renderCommon() {
bindTexture(ResourceManager.pheo_fire_door_tex);
int index = (int) ((Clock.get_ms() % 3000) / 1000);
Minecraft.getMinecraft().getTextureManager().bindTexture(
index == 2 ? ResourceManager.pheo_fire_door_orange_tex :
index == 1 ? ResourceManager.pheo_fire_door_black_tex :
ResourceManager.pheo_fire_door_tex);
GL11.glRotated(90, 0, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.pheo_fire_door.renderAll();

View File

@ -0,0 +1,34 @@
package com.hbm.render.loader;
import java.io.IOException;
import java.util.Map.Entry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.IResource;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.client.resources.IResourceManagerReloadListener;
public class HFRModelReloader implements IResourceManagerReloadListener {
@Override
public void onResourceManagerReload(IResourceManager resourceManager) {
for(HFRWavefrontObject obj : HFRWavefrontObject.allModels) {
try {
obj.destroy();
IResource resource = Minecraft.getMinecraft().getResourceManager().getResource(obj.resource);
obj.loadObjModel(resource.getInputStream());
// MainRegistry.logger.info("Reloading OBJ " + obj.resource.getResourcePath());
} catch(IOException e) { }
}
for(Entry<HFRWavefrontObjectVBO, HFRWavefrontObject> entry : HFRWavefrontObject.allVBOs.entrySet()) {
HFRWavefrontObjectVBO vbo = entry.getKey();
HFRWavefrontObject obj = entry.getValue();
vbo.destroy();
vbo.load(obj);
// MainRegistry.logger.info("Reloading VBO " + obj.resource.getResourcePath());
}
}
}

View File

@ -5,6 +5,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -22,6 +24,11 @@ import net.minecraftforge.client.model.obj.TextureCoordinate;
import net.minecraftforge.client.model.obj.Vertex;
public class HFRWavefrontObject implements IModelCustomNamed {
/** For resource reloading */
public static LinkedHashSet<HFRWavefrontObject> allModels = new LinkedHashSet();
public static LinkedHashMap<HFRWavefrontObjectVBO, HFRWavefrontObject> allVBOs = new LinkedHashMap();
private static Pattern vertexPattern = Pattern.compile("(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)");
private static Pattern vertexNormalPattern = Pattern.compile("(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)");
private static Pattern textureCoordinatePattern = Pattern.compile("(vt( (\\-){0,1}\\d+\\.\\d+){2,3} *\\n)|(vt( (\\-){0,1}\\d+(\\.\\d+)?){2,3} *$)");
@ -40,10 +47,12 @@ public class HFRWavefrontObject implements IModelCustomNamed {
public ArrayList<TextureCoordinate> textureCoordinates = new ArrayList<TextureCoordinate>();
public ArrayList<S_GroupObject> groupObjects = new ArrayList<S_GroupObject>();
private S_GroupObject currentGroupObject;
public ResourceLocation resource;
private String fileName;
private boolean smoothing = true;
public HFRWavefrontObject(ResourceLocation resource) throws ModelFormatException {
this.resource = resource;
this.fileName = resource.toString();
try {
@ -52,6 +61,8 @@ public class HFRWavefrontObject implements IModelCustomNamed {
} catch(IOException e) {
throw new ModelFormatException("IO Exception reading model format", e);
}
this.allModels.add(this);
}
public HFRWavefrontObject(ResourceLocation resource, boolean smoothing) throws ModelFormatException {
@ -59,12 +70,15 @@ public class HFRWavefrontObject implements IModelCustomNamed {
this.smoothing = smoothing;
}
public HFRWavefrontObject(String filename, InputStream inputStream) throws ModelFormatException {
this.fileName = filename;
loadObjModel(inputStream);
public void destroy() {
vertices.clear();
vertexNormals.clear();
textureCoordinates.clear();
groupObjects.clear();
currentGroupObject = null;
}
private void loadObjModel(InputStream inputStream) throws ModelFormatException {
public void loadObjModel(InputStream inputStream) throws ModelFormatException {
BufferedReader reader = null;
String currentLine = null;
@ -492,7 +506,9 @@ public class HFRWavefrontObject implements IModelCustomNamed {
return names;
}
public WavefrontObjVBO asVBO() {
return new WavefrontObjVBO(this);
public HFRWavefrontObjectVBO asVBO() {
HFRWavefrontObjectVBO vbo = new HFRWavefrontObjectVBO(this);
this.allVBOs.put(vbo, this);
return vbo;
}
}

View File

@ -10,7 +10,7 @@ import org.lwjgl.opengl.*;
import net.minecraftforge.client.model.obj.TextureCoordinate;
import net.minecraftforge.client.model.obj.Vertex;
public class WavefrontObjVBO implements IModelCustomNamed {
public class HFRWavefrontObjectVBO implements IModelCustomNamed {
class VBOBufferData {
@ -27,7 +27,11 @@ public class WavefrontObjVBO implements IModelCustomNamed {
static int VERTEX_SIZE = 3;
static int UV_SIZE = 3;
public WavefrontObjVBO(HFRWavefrontObject obj) {
public HFRWavefrontObjectVBO(HFRWavefrontObject obj) {
load(obj);
}
public void load(HFRWavefrontObject obj) {
for(S_GroupObject g : obj.groupObjects) {
VBOBufferData data = new VBOBufferData();
data.name = g.name;
@ -74,6 +78,19 @@ public class WavefrontObjVBO implements IModelCustomNamed {
groups.add(data);
}
}
// truth be told, i have no fucking idea what i'm doing
// i know the VBO sends data to the GPU to be saved there directly which is where the optimization comes from in the first place
// so logically, if we want to get rid of this, we need to blow the data up
// documentation on GL15 functions seems nonexistant so fuck it we ball i guess
public void destroy() {
for(VBOBufferData data : groups) {
GL15.glDeleteBuffers(data.vertexHandle);
GL15.glDeleteBuffers(data.uvHandle);
GL15.glDeleteBuffers(data.normalHandle);
}
groups.clear();
}
@Override
public String getType() {

View File

@ -17,7 +17,10 @@ public class RenderFireDoor implements IRenderDoors {
@Override
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_fire_door_tex);
Minecraft.getMinecraft().getTextureManager().bindTexture(
door.getSkinIndex() == 2 ? ResourceManager.pheo_fire_door_orange_tex :
door.getSkinIndex() == 1 ? ResourceManager.pheo_fire_door_black_tex :
ResourceManager.pheo_fire_door_tex);
double maxRaise = 2.75;
double raise = 0;

View File

@ -119,6 +119,8 @@ public abstract class DoorDecl {
return null;
}
@Override public int getSkinCount() { return 3; }
@Override public int timeToOpen() { return 160; }
@Override public int[][] getDoorOpenRanges() { return new int[][] { { -1, 0, 0, 3, 4, 1 } }; }
@Override public int[] getDimensions() { return new int[] { 2, 0, 0, 0, 2, 1 }; }
@ -139,15 +141,6 @@ public abstract class DoorDecl {
return super.getBlockBound(x, y, z, open, forCollision);
}
}
@Deprecated
@Override
@SideOnly(Side.CLIENT)
public ResourceLocation getTextureForPart(int skinIndex, String partName) { return null; }
@Deprecated
@Override
@SideOnly(Side.CLIENT)
public IModelCustomNamed getModel() { return null; }
};
public static final DoorDecl SLIDE_DOOR = new DoorDecl() {
@ -412,45 +405,6 @@ public abstract class DoorDecl {
return null;
}
@Override
@SideOnly(Side.CLIENT)
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
if("bolt".equals(partName)) {
set(trans, 0, 0, 0.4F * Library.smoothstep(getNormTime(openTicks, 0, 30), 0, 1));
} else {
set(trans, 0, 0, 0);
}
};
@Override
@SideOnly(Side.CLIENT)
public void getOrigin(String partName, float[] orig) {
if("door".equals(partName) || "bolt".equals(partName)) {
set(orig, 0.125F, 1.5F, 1.18F);
return;
} else if("spinny_upper".equals(partName)) {
set(orig, 0.041499F, 2.43569F, -0.587849F);
return;
} else if("spinny_lower".equals(partName)) {
set(orig, 0.041499F, 0.571054F, -0.587849F);
return;
}
super.getOrigin(partName, orig);
};
@Override
@SideOnly(Side.CLIENT)
public void getRotation(String partName, float openTicks, float[] rot) {
if(partName.startsWith("spinny")) {
set(rot, Library.smoothstep(getNormTime(openTicks, 0, 30), 0, 1) * 360, 0, 0);
return;
} else if("door".equals(partName) || "bolt".equals(partName)) {
set(rot, 0, Library.smoothstep(getNormTime(openTicks, 30, 60), 0, 1) * -134, 0);
return;
}
super.getRotation(partName, openTicks, rot);
};
@Override
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open, boolean forCollision) {
if(!open) {
@ -510,12 +464,6 @@ public abstract class DoorDecl {
super.getRotation(partName, openTicks, rot);
};
@Override
@SideOnly(Side.CLIENT)
public boolean doesRender(String partName, boolean child) {
return true;
};
@Override public int timeToOpen() { return 60; };
@Override public int[][] getDoorOpenRanges() { return new int[][] { { 1, 0, 1, -3, 3, 0 }, { 0, 0, 1, -3, 3, 0 }, { -1, 0, 1, -3, 3, 0 } }; }
@Override public float getDoorRangeOpenTime(int ticks, int idx) { return getNormTime(ticks, 20, 20); };
@ -570,12 +518,6 @@ public abstract class DoorDecl {
super.getRotation(partName, openTicks, rot);
};
@Override
@SideOnly(Side.CLIENT)
public boolean doesRender(String partName, boolean child) {
return true;
};
@Override public int timeToOpen() { return 60; };
@Override public int[][] getDoorOpenRanges() { return new int[][] { { 2, 0, 1, -3, 3, 0 }, { 1, 0, 2, -5, 3, 0 }, { 0, 0, 2, -5, 3, 0 }, { -1, 0, 2, -5, 3, 0 }, { -2, 0, 1, -3, 3, 0 } }; }
@Override public float getDoorRangeOpenTime(int ticks, int idx) { return getNormTime(ticks, 20, 20); };
@ -627,11 +569,10 @@ public abstract class DoorDecl {
};
// Format: x, y, z, tangent amount 1 (how long the door would be if it moved
// up), tangent amount 2 (door places blocks in this direction), axis (0-x,
// 1-y, 2-z)
/** Format: x, y, z, tangent amount 1 (how long the door would be if it moved
up), tangent amount 2 (door places blocks in this direction), axis (0-x,
1-y, 2-z) */
public abstract int[][] getDoorOpenRanges();
public abstract int[] getDimensions();
public int getBlockOffset() { return 0; }
@ -664,23 +605,16 @@ public abstract class DoorDecl {
@SideOnly(Side.CLIENT) public AnimatedModel getAnimatedModel() { return null; }
@SideOnly(Side.CLIENT) public Animation getAnim() { return null; }
@SideOnly(Side.CLIENT)
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) { set(trans, 0, 0, 0); }
@SideOnly(Side.CLIENT)
public void getRotation(String partName, float openTicks, float[] rot) { set(rot, 0, 0, 0); }
@SideOnly(Side.CLIENT)
public void getOrigin(String partName, float[] orig) { set(orig, 0, 0, 0); }
@SideOnly(Side.CLIENT)
public boolean doesRender(String partName, boolean child) { return true; }
@SideOnly(Side.CLIENT) public void getTranslation(String partName, float openTicks, boolean child, float[] trans) { set(trans, 0, 0, 0); }
@SideOnly(Side.CLIENT) public void getRotation(String partName, float openTicks, float[] rot) { set(rot, 0, 0, 0); }
@SideOnly(Side.CLIENT) public void getOrigin(String partName, float[] orig) { set(orig, 0, 0, 0); }
@SideOnly(Side.CLIENT) public boolean doesRender(String partName, boolean child) { return true; }
private static final String[] nothing = new String[] {};
@SideOnly(Side.CLIENT)
public String[] getChildren(String partName) { return nothing; }
@SideOnly(Side.CLIENT)
public double[][] getClippingPlanes() { return new double[][] {}; }
@SideOnly(Side.CLIENT)
public void doOffsetTransform() { }
@SideOnly(Side.CLIENT) public String[] getChildren(String partName) { return nothing; }
@SideOnly(Side.CLIENT) public double[][] getClippingPlanes() { return new double[][] {}; }
@SideOnly(Side.CLIENT) public void doOffsetTransform() { }
public AxisAlignedBB getBlockBound(int x, int y, int z, boolean open, boolean forCollision) {
return open ? AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0) : AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 1, 1);

View File

@ -21,6 +21,7 @@ import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.module.machine.ModuleMachineAssembler;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.IConditionalInvAccess;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.IUpgradeInfoProvider;
import com.hbm.tileentity.TileEntityMachineBase;
@ -45,7 +46,7 @@ import net.minecraftforge.common.util.ForgeDirection;
// TODO: make a base class because 90% of this is just copy pasted from the chemfac
@NotableComments
public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider {
public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider, IConditionalInvAccess {
public FluidTank[] allTanks;
public FluidTank[] inputTanks;
@ -122,6 +123,26 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl
}; // ho boy, a big fucking array of hand-written values, surely this isn't gonna bite me in the ass some day
}
/// CONDITIONAL ACCESS ///
@Override public boolean isItemValidForSlot(int x, int y, int z, int slot, ItemStack stack) { return this.isItemValidForSlot(slot, stack); }
@Override public boolean canInsertItem(int x, int y, int z, int slot, ItemStack stack, int side) { return this.canInsertItem(slot, stack, side); }
@Override public boolean canExtractItem(int x, int y, int z, int slot, ItemStack stack, int side) { return this.canExtractItem(slot, stack, side); }
@Override public int[] getAccessibleSlotsFromSide(int x, int y, int z, int side) {
DirPos[] io = getIOPos();
for(int i = 0; i < io.length; i++) {
if(io[i].compare(x + io[i].getDir().offsetX, y, z + io[i].getDir().offsetZ)) {
return new int[] {
5 + i * 14, 6 + i * 14, 7 + i * 14, 8 + i * 14,
9 + i * 14, 10 + i * 14, 11 + i * 14, 12 + i * 14,
13 + i * 14, 14 + i * 14, 15 + i * 14, 16 + i * 14,
17, 31, 45, 59 // entering flavor town...
};
}
}
return this.getAccessibleSlotsFromSide(side);
}
@Override
public String getName() {
return "container.machineAssemblyFactory";
@ -252,7 +273,6 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl
new DirPos(xCoord - dir.offsetX - rot.offsetX * 3, yCoord, zCoord - dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
};
}
public DirPos[] getCoolPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
@ -265,6 +285,18 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl
new DirPos(xCoord - rot.offsetX - dir.offsetX * 3, yCoord, zCoord - rot.offsetZ - dir.offsetZ * 3, dir.getOpposite()),
};
}
public DirPos[] getIOPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
return new DirPos[] {
new DirPos(xCoord + dir.offsetX + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ + rot.offsetZ * 3, rot),
new DirPos(xCoord - dir.offsetX + rot.offsetX * 3, yCoord, zCoord - dir.offsetZ + rot.offsetZ * 3, rot),
new DirPos(xCoord + dir.offsetX - rot.offsetX * 3, yCoord, zCoord + dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
new DirPos(xCoord - dir.offsetX - rot.offsetX * 3, yCoord, zCoord - dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
};
}
@Override
public void serialize(ByteBuf buf) {
@ -368,7 +400,7 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl
@Override
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_chemical_factory));
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembly_factory));
if(type == UpgradeType.SPEED) {
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(KEY_SPEED, "+" + (level * 100 / 3) + "%"));
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(KEY_CONSUMPTION, "+" + (level * 50) + "%"));

View File

@ -19,6 +19,7 @@ import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.module.machine.ModuleMachineChemplant;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.IConditionalInvAccess;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.IUpgradeInfoProvider;
import com.hbm.tileentity.TileEntityMachineBase;
@ -41,7 +42,7 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityMachineChemicalFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider {
public class TileEntityMachineChemicalFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider, IConditionalInvAccess {
public FluidTank[] allTanks;
public FluidTank[] inputTanks;
@ -121,6 +122,27 @@ public class TileEntityMachineChemicalFactory extends TileEntityMachineBase impl
};
}
/// CONDITIONAL ACCESS ///
@Override public boolean isItemValidForSlot(int x, int y, int z, int slot, ItemStack stack) { return this.isItemValidForSlot(slot, stack); }
@Override public boolean canInsertItem(int x, int y, int z, int slot, ItemStack stack, int side) { return this.canInsertItem(slot, stack, side); }
@Override public boolean canExtractItem(int x, int y, int z, int slot, ItemStack stack, int side) { return this.canExtractItem(slot, stack, side); }
@Override public int[] getAccessibleSlotsFromSide(int x, int y, int z, int side) {
DirPos[] io = getIOPos();
for(int i = 0; i < io.length; i++) {
if(io[i].compare(x + io[i].getDir().offsetX, y, z + io[i].getDir().offsetZ)) {
return new int[] {
5 + i * 7, 6 + i * 7, 7 + i * 7,
8, 9, 10,
15, 16, 17,
22, 23, 24,
29, 30, 31
};
}
}
return this.getAccessibleSlotsFromSide(side);
}
@Override
public String getName() {
return "container.machineChemicalFactory";
@ -288,6 +310,18 @@ public class TileEntityMachineChemicalFactory extends TileEntityMachineBase impl
new DirPos(xCoord - rot.offsetX - dir.offsetX * 3, yCoord, zCoord - rot.offsetZ - dir.offsetZ * 3, dir.getOpposite()),
};
}
public DirPos[] getIOPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
return new DirPos[] {
new DirPos(xCoord + dir.offsetX + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ + rot.offsetZ * 3, rot),
new DirPos(xCoord - dir.offsetX + rot.offsetX * 3, yCoord, zCoord - dir.offsetZ + rot.offsetZ * 3, rot),
new DirPos(xCoord + dir.offsetX - rot.offsetX * 3, yCoord, zCoord + dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
new DirPos(xCoord - dir.offsetX - rot.offsetX * 3, yCoord, zCoord - dir.offsetZ - rot.offsetZ * 3, rot.getOpposite()),
};
}
@Override
public void serialize(ByteBuf buf) {

View File

@ -213,7 +213,7 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
if(RBMKDials.getOverpressure(worldObj)) {
for(DirPos pos : getOutputPos()) {
FluidNode node = (FluidNode) UniNodespace.getNode(worldObj, pos.getX(), pos.getY(), pos.getZ(), steam.getTankType().getNetworkProvider());
if(node.net != null) {
if(node != null && node.hasValidNet()) {
this.pipes.add(node.net);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB