Merge branch 'HbmMods:master' into master

This commit is contained in:
Raaaaaaaaaay 2026-01-24 21:29:48 +02:00 committed by GitHub
commit dc55ec75cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 7434 additions and 2865 deletions

View File

@ -13,6 +13,8 @@
* DLs have been long phased out in favor of VBOs anyway * DLs have been long phased out in favor of VBOs anyway
* Rebranded canned horse slime * Rebranded canned horse slime
* Now with extra bone marrow * Now with extra bone marrow
* Updated the deuterium tower's model
* Increased the energy requirement for welding osmiridium
# Fixed # Fixed
* Potentially fixed yet another issue regarding crates * Potentially fixed yet another issue regarding crates
@ -21,4 +23,5 @@
* Fixed RBMK automatic control rods having incorrect settings when using the copy tool * Fixed RBMK automatic control rods having incorrect settings when using the copy tool
* Fixed battery sockets producing junk debug data in the logs * Fixed battery sockets producing junk debug data in the logs
* Fixed an issue where the charging station would crash when trying to charge certain items * Fixed an issue where the charging station would crash when trying to charge certain items
* Fixed the DFC's core component not dropping its contents when mined * Fixed the DFC's core component not dropping its contents when mined
* Fixed audio problems with guns

View File

@ -80,7 +80,7 @@ public class ArcWelderRecipes extends SerializableRecipe {
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_CMB.id), 1_200, 10_000_000L, new FluidStack(Fluids.REFORMGAS, 1_000), recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_CMB.id), 1_200, 10_000_000L, new FluidStack(Fluids.REFORMGAS, 1_000),
new OreDictStack(CMB.plateCast(), 2))); new OreDictStack(CMB.plateCast(), 2)));
//pre-DFC //pre-DFC
recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_OSMIRIDIUM.id), 6_000, 20_000_000L, new FluidStack(Fluids.REFORMGAS, 16_000), recipes.add(new ArcWelderRecipe(new ItemStack(ModItems.plate_welded, 1, Mats.MAT_OSMIRIDIUM.id), 6_000, 50_000_000L, new FluidStack(Fluids.REFORMGAS, 16_000),
new OreDictStack(OSMIRIDIUM.plateCast(), 2))); new OreDictStack(OSMIRIDIUM.plateCast(), 2)));
//Missile Parts //Missile Parts

View File

@ -504,10 +504,10 @@ public class ModEventHandler {
ItemStack[] prevArmor = event.entityLiving.previousEquipment; ItemStack[] prevArmor = event.entityLiving.previousEquipment;
if(event.entityLiving instanceof EntityPlayer && prevArmor != null && event.entityLiving.getHeldItem() != null if(event.entityLiving instanceof EntityPlayerMP && prevArmor != null && event.entityLiving.getHeldItem() != null
&& (prevArmor[0] == null || prevArmor[0].getItem() != event.entityLiving.getHeldItem().getItem()) && (prevArmor[0] == null || prevArmor[0].getItem() != event.entityLiving.getHeldItem().getItem())
&& event.entityLiving.getHeldItem().getItem() instanceof IEquipReceiver) { && event.entityLiving.getHeldItem().getItem() instanceof IEquipReceiver) {
((IEquipReceiver)event.entityLiving.getHeldItem().getItem()).onEquip((EntityPlayer) event.entityLiving, event.entityLiving.getHeldItem()); ((IEquipReceiver)event.entityLiving.getHeldItem().getItem()).onEquip((EntityPlayer) event.entityLiving, event.entityLiving.getHeldItem());
} }

View File

@ -337,7 +337,12 @@ public class ResourceManager {
//Doors //Doors
public static AnimatedModel transition_seal = ColladaLoader.load(new ResourceLocation(RefStrings.MODID, "models/doors/seal.dae"), true); public static AnimatedModel transition_seal = ColladaLoader.load(new ResourceLocation(RefStrings.MODID, "models/doors/seal.dae"), true);
public static Animation transition_seal_anim = ColladaLoader.loadAnim(24040, new ResourceLocation(RefStrings.MODID, "models/doors/seal.dae")); public static Animation transition_seal_anim = ColladaLoader.loadAnim(24040, new ResourceLocation(RefStrings.MODID, "models/doors/seal.dae"));
public static final IModelCustomNamed fire_door = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/doors/fire_door.obj")).asVBO();
//PheoDoors
public static final ResourceLocation pheo_fire_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/pheodoors/fire_door.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();
//Secure Access Door //Secure Access Door
public static final ResourceLocation secure_access_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/secure_access_door.png"); public static final ResourceLocation secure_access_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/secure_access_door.png");
@ -814,7 +819,6 @@ public class ResourceManager {
//Doors //Doors
public static final ResourceLocation transition_seal_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/transition_seal.png"); public static final ResourceLocation transition_seal_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/transition_seal.png");
public static final ResourceLocation fire_door_tex = new ResourceLocation(RefStrings.MODID, "textures/models/doors/fire_door.png");
//Skeleton //Skeleton
public static final ResourceLocation skeleton_holder_tex = new ResourceLocation(RefStrings.MODID, "textures/particle/skeleton.png"); public static final ResourceLocation skeleton_holder_tex = new ResourceLocation(RefStrings.MODID, "textures/particle/skeleton.png");

View File

@ -135,7 +135,7 @@ public class BusAnimationSequence {
continue; continue;
} }
if(millis >= endTime) { if(millis >= endTime || currentFrame.duration == 0) {
transform[i] = currentFrame.value; transform[i] = currentFrame.value;
continue; continue;
} }

View File

@ -615,6 +615,20 @@ public class ItemRenderLibrary {
GL11.glShadeModel(GL11.GL_FLAT); GL11.glShadeModel(GL11.GL_FLAT);
} }
}); });
renderers.put(Item.getItemFromBlock(ModBlocks.fire_door), new ItemRenderBase(){
public void renderInventory() {
GL11.glTranslated(0, -3, 0);
GL11.glScaled(3.5, 3.5, 3.5);
}
public void renderCommon() {
bindTexture(ResourceManager.pheo_fire_door_tex);
GL11.glRotated(90, 0, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.pheo_fire_door.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
});
renderers.put(Item.getItemFromBlock(ModBlocks.large_vehicle_door), new ItemRenderBase(){ renderers.put(Item.getItemFromBlock(ModBlocks.large_vehicle_door), new ItemRenderBase(){
public void renderInventory() { public void renderInventory() {
@ -706,13 +720,13 @@ public class ItemRenderLibrary {
renderers.put(Item.getItemFromBlock(ModBlocks.round_airlock_door), new ItemRenderBase(){ renderers.put(Item.getItemFromBlock(ModBlocks.round_airlock_door), new ItemRenderBase(){
public void renderInventory() { public void renderInventory() {
GL11.glTranslated(0, -4, 0); GL11.glTranslated(0, -3.75, 0);
GL11.glScaled(3, 3, 3); GL11.glScaled(3, 3, 3);
} }
public void renderCommon() { public void renderCommon() {
bindTexture(ResourceManager.round_airlock_door_tex); bindTexture(ResourceManager.pheo_airlock_door_tex);
GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glShadeModel(GL11.GL_SMOOTH);
ResourceManager.round_airlock_door.renderAll(); ResourceManager.pheo_airlock_door.renderAll();
GL11.glShadeModel(GL11.GL_FLAT); GL11.glShadeModel(GL11.GL_FLAT);
} }
}); });

View File

@ -37,7 +37,7 @@ public class RenderDoorGeneric extends TileEntitySpecialRenderer {
DoorDecl door = te.getDoorType(); DoorDecl door = te.getDoorType();
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z+0.5); GL11.glTranslated(x + 0.5, y, z + 0.5);
switch(te.getBlockMetadata() - BlockDummyable.offset) { switch(te.getBlockMetadata() - BlockDummyable.offset) {
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break; case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
@ -50,6 +50,7 @@ public class RenderDoorGeneric extends TileEntitySpecialRenderer {
if(sednaRenderer != null) { if(sednaRenderer != null) {
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glShadeModel(GL11.GL_SMOOTH);
sednaRenderer.render(te, buf); sednaRenderer.render(te, buf);
GL11.glShadeModel(GL11.GL_FLAT); GL11.glShadeModel(GL11.GL_FLAT);

View File

@ -2,9 +2,39 @@ package com.hbm.render.tileentity.door;
import java.nio.DoubleBuffer; import java.nio.DoubleBuffer;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.Animation;
import com.hbm.tileentity.TileEntityDoorGeneric; import com.hbm.tileentity.TileEntityDoorGeneric;
import com.hbm.util.Clock;
public interface IRenderDoors { public interface IRenderDoors {
public void render(TileEntityDoorGeneric door, DoubleBuffer buf); public void render(TileEntityDoorGeneric door, DoubleBuffer buf);
public static double[] getRelevantTransformation(String bus, Animation anim) {
if(anim != null) {
BusAnimation buses = anim.animation;
int millis = (int)(Clock.get_ms() - anim.startMillis);
BusAnimationSequence seq = buses.getBus(bus);
if(seq != null) {
double[] trans = seq.getTransformation(millis);
if(trans != null)
return trans;
}
}
return new double[] {
0, 0, 0, // position
0, 0, 0, // rotation
1, 1, 1, // scale
0, 0, 0, // offset
0, 1, 2, // XYZ order
};
}
} }

View File

@ -0,0 +1,56 @@
package com.hbm.render.tileentity.door;
import java.nio.DoubleBuffer;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.TileEntityDoorGeneric;
import net.minecraft.client.Minecraft;
import net.minecraft.util.MathHelper;
public class RenderAirlockDoor implements IRenderDoors {
public static final RenderAirlockDoor INSTANCE = new RenderAirlockDoor();
@Override
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_airlock_door_tex);
double maxOpen = 1.5;
double open = 0;
if(door.state == door.STATE_OPEN) open = maxOpen;
if(door.currentAnimation != null) {
open = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxOpen;
}
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glTranslated(0, 0, 0.5);
ResourceManager.pheo_airlock_door.renderPart("Frame");
GL11.glEnable(GL11.GL_CLIP_PLANE0);
buf.put(new double[] { 0.0, 0.0, 1, 1.999 }); buf.rewind();
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, buf);
GL11.glEnable(GL11.GL_CLIP_PLANE1);
buf.put(new double[] { 0.0, 0.0, -1, 1.999 }); buf.rewind();
GL11.glClipPlane(GL11.GL_CLIP_PLANE1, buf);
GL11.glPushMatrix();
GL11.glTranslated(0, 0, MathHelper.clamp_double(open, 0, maxOpen));
ResourceManager.pheo_airlock_door.renderPart("Left");
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, -MathHelper.clamp_double(open, 0, maxOpen));
ResourceManager.pheo_airlock_door.renderPart("Right");
GL11.glPopMatrix();
GL11.glDisable(GL11.GL_CLIP_PLANE0);
GL11.glDisable(GL11.GL_CLIP_PLANE1);
}
}

View File

@ -0,0 +1,36 @@
package com.hbm.render.tileentity.door;
import java.nio.DoubleBuffer;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.TileEntityDoorGeneric;
import net.minecraft.client.Minecraft;
import net.minecraft.util.MathHelper;
public class RenderFireDoor implements IRenderDoors {
public static final RenderFireDoor INSTANCE = new RenderFireDoor();
@Override
public void render(TileEntityDoorGeneric door, DoubleBuffer buf) {
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.pheo_fire_door_tex);
double maxRaise = 2.75;
double raise = 0;
if(door.state == door.STATE_OPEN) raise = maxRaise;
if(door.currentAnimation != null) {
raise = IRenderDoors.getRelevantTransformation("DOOR", door.currentAnimation)[1] * maxRaise;
}
GL11.glRotated(90, 0, 1, 0);
GL11.glTranslated(-0.5, 0, 0);
ResourceManager.pheo_fire_door.renderPart("Frame");
GL11.glTranslated(0, MathHelper.clamp_double(raise, 0, maxRaise), 0);
ResourceManager.pheo_fire_door.renderPart("Door");
}
}

View File

@ -4,8 +4,12 @@ import com.hbm.animloader.AnimatedModel;
import com.hbm.animloader.Animation; import com.hbm.animloader.Animation;
import com.hbm.lib.Library; import com.hbm.lib.Library;
import com.hbm.main.ResourceManager; import com.hbm.main.ResourceManager;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.loader.IModelCustomNamed; import com.hbm.render.loader.IModelCustomNamed;
import com.hbm.render.tileentity.door.IRenderDoors; import com.hbm.render.tileentity.door.IRenderDoors;
import com.hbm.render.tileentity.door.RenderAirlockDoor;
import com.hbm.render.tileentity.door.RenderFireDoor;
import com.hbm.util.BobMathUtil; import com.hbm.util.BobMathUtil;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -99,26 +103,24 @@ public abstract class DoorDecl {
public static final DoorDecl FIRE_DOOR = new DoorDecl() { public static final DoorDecl FIRE_DOOR = new DoorDecl() {
@Override public String getOpenSoundEnd() { return "hbm:door.wghStop"; }
@Override public String getOpenSoundLoop() { return "hbm:door.wghStart"; }
@Override public String getSoundLoop2() { return "hbm:door.alarm6"; }
@Override public float getSoundVolume() { return 2; }
@Override @Override
public String getOpenSoundEnd() { public IRenderDoors getSEDNARenderer() {
return "hbm:door.wghStop"; return RenderFireDoor.INSTANCE;
} }
@Override @Override
public String getOpenSoundLoop() { public BusAnimation getBusAnimation(byte state) {
return "hbm:door.wghStart"; if(state == TileEntityDoorGeneric.STATE_OPENING) return new BusAnimation().addBus("DOOR", new BusAnimationSequence().setPos(0, 0, 0).addPos(0, 1, 0, this.timeToOpen() * 50));
} if(state == TileEntityDoorGeneric.STATE_CLOSING) return new BusAnimation().addBus("DOOR", new BusAnimationSequence().setPos(0, 1, 0).addPos(0, 0, 0, this.timeToOpen() * 50));
return null;
@Override
public String getSoundLoop2() {
return "hbm:door.alarm6";
}
@Override
public float getSoundVolume() {
return 2;
} }
@Deprecated
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getTranslation(String partName, float openTicks, boolean child, float[] trans) { public void getTranslation(String partName, float openTicks, boolean child, float[] trans) {
@ -129,12 +131,14 @@ public abstract class DoorDecl {
} }
} }
@Deprecated
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void doOffsetTransform() { public void doOffsetTransform() {
GL11.glTranslated(0, 0, 0.5); GL11.glTranslated(0, 0, 0.5);
} }
@Deprecated
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public double[][] getClippingPlanes() { public double[][] getClippingPlanes() {
@ -173,17 +177,14 @@ public abstract class DoorDecl {
} }
} }
@Deprecated
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public ResourceLocation getTextureForPart(int skinIndex, String partName) { public ResourceLocation getTextureForPart(int skinIndex, String partName) { return null; }
return ResourceManager.fire_door_tex; @Deprecated
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IModelCustomNamed getModel() { public IModelCustomNamed getModel() { return null; }
return ResourceManager.fire_door;
}
}; };
public static final DoorDecl SLIDE_DOOR = new DoorDecl() { public static final DoorDecl SLIDE_DOOR = new DoorDecl() {
@ -467,18 +468,20 @@ public abstract class DoorDecl {
public static final DoorDecl ROUND_AIRLOCK_DOOR = new DoorDecl() { public static final DoorDecl ROUND_AIRLOCK_DOOR = new DoorDecl() {
@Override public String getOpenSoundEnd() { return "hbm:door.garage_stop"; }
@Override public String getOpenSoundLoop() { return "hbm:door.garage_move"; }
@Override public float getSoundVolume() { return 2; }
@Override @Override
public String getOpenSoundEnd() { public IRenderDoors getSEDNARenderer() {
return "hbm:door.garage_stop"; return RenderAirlockDoor.INSTANCE;
} }
@Override @Override
public String getOpenSoundLoop() { public BusAnimation getBusAnimation(byte state) {
return "hbm:door.garage_move"; if(state == TileEntityDoorGeneric.STATE_OPENING) return new BusAnimation().addBus("DOOR", new BusAnimationSequence().setPos(0, 0, 0).addPos(0, 1, 0, this.timeToOpen() * 50));
} if(state == TileEntityDoorGeneric.STATE_CLOSING) return new BusAnimation().addBus("DOOR", new BusAnimationSequence().setPos(0, 1, 0).addPos(0, 0, 0, this.timeToOpen() * 50));
return null;
public float getSoundVolume() {
return 2;
} }
@Override @Override
@ -536,22 +539,19 @@ public abstract class DoorDecl {
return new int[] { 3, 0, 0, 0, 2, 1 }; return new int[] { 3, 0, 0, 0, 2, 1 };
}; };
@Deprecated
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public ResourceLocation getTextureForPart(String partName) { public ResourceLocation getTextureForPart(String partName) { return null; }
return ResourceManager.round_airlock_door_tex;
}
@Deprecated
@Override @Override
public ResourceLocation getTextureForPart(int skinIndex, String partName) { public ResourceLocation getTextureForPart(int skinIndex, String partName) { return null; }
return ResourceManager.round_airlock_door_tex;
}
@Deprecated
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IModelCustomNamed getModel() { public IModelCustomNamed getModel() { return null; }
return ResourceManager.round_airlock_door;
}
}; };
public static final DoorDecl QE_SLIDING = new DoorDecl() { public static final DoorDecl QE_SLIDING = new DoorDecl() {
@ -1213,5 +1213,11 @@ public abstract class DoorDecl {
// keyframe animation system sneakily stitched into the door decl // keyframe animation system sneakily stitched into the door decl
public IRenderDoors getSEDNARenderer() { return null; } public IRenderDoors getSEDNARenderer() { return null; }
public com.hbm.render.anim.HbmAnimations.Animation getSEDNAAnim(byte state) { return null; } public BusAnimation getBusAnimation(byte state) { return null; }
public com.hbm.render.anim.HbmAnimations.Animation getSEDNAAnim(byte state) {
BusAnimation anim = this.getBusAnimation(state);
if(anim != null) return new com.hbm.render.anim.HbmAnimations.Animation("DOOR_ANIM", System.currentTimeMillis(), anim);
return null;
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB