Merge branch 'HbmMods:master' into shredder_dust_fix

This commit is contained in:
MerrittK 2025-06-24 10:41:40 -04:00 committed by GitHub
commit 46c59eace3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 71 additions and 31 deletions

View File

@ -44,4 +44,5 @@
* Rapidly spinning dyx should no longer have a state leak that would rotate lighting of unrelated TESRs with it * Rapidly spinning dyx should no longer have a state leak that would rotate lighting of unrelated TESRs with it
* Fixed issue where mining strange stone with silk touch ability would cause a desync. It also now drops cobblestone, as if silk touch wasn't active at all * Fixed issue where mining strange stone with silk touch ability would cause a desync. It also now drops cobblestone, as if silk touch wasn't active at all
* Fixed issue where applying a filter to a mask that doesn't support certain protection types would permanently remove those types from the filter until the game is restarted * Fixed issue where applying a filter to a mask that doesn't support certain protection types would permanently remove those types from the filter until the game is restarted
* Fixed InventoryBogoSorter being able to move held crates * Fixed InventoryBogoSorter being able to move held crates
* Fixed tier 2 pickaxes mining depth rock causing a desync with the depth rock not actually being broken

View File

@ -274,7 +274,7 @@ public class ItemToolAbility extends ItemTool implements IDepthRockTool, IGUIPro
EntityPlayerMP player = (EntityPlayerMP) playerEntity; EntityPlayerMP player = (EntityPlayerMP) playerEntity;
ItemStack stack = player.getHeldItem(); ItemStack stack = player.getHeldItem();
if (stack == null) { if(stack == null) {
return; return;
} }
@ -288,7 +288,7 @@ public class ItemToolAbility extends ItemTool implements IDepthRockTool, IGUIPro
float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ); float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ);
float strength = ForgeHooks.blockStrength(block, player, world, x, y, z); float strength = ForgeHooks.blockStrength(block, player, world, x, y, z);
if(!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength / strength > 10f || refBlock.getBlockHardness(world, refX, refY, refZ) < 0) if(!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength / strength > 10f || refBlock.getPlayerRelativeBlockHardness(player, world, refX, refY, refZ) < 0)
return; return;
BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z); BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z);

View File

@ -323,7 +323,7 @@ public class XFactory12ga {
ModItems.gun_maresleg_broken = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig() ModItems.gun_maresleg_broken = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(0).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE) .dura(0).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(32F).spreadAmmo(1.15F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F) .dmg(48F).spreadAmmo(1.15F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(g12_equestrian_tkr, g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus)) .mag(new MagazineSingleReload(0, 6).addConfigs(g12_equestrian_tkr, g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus))
.offset(0.75, -0.0625, -0.1875) .offset(0.75, -0.0625, -0.1875)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_NOWEAR_FIRE).recoil(LAMBDA_RECOIL_MARESLEG)) .canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_NOWEAR_FIRE).recoil(LAMBDA_RECOIL_MARESLEG))
@ -654,12 +654,18 @@ public class XFactory12ga {
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_SEXY_ANIMS = (stack, type) -> { @SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_SEXY_ANIMS = (stack, type) -> {
switch(type) { switch(type) {
case CYCLE: return new BusAnimation() case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, -1, 50, IType.SIN_DOWN).addPos(0, 0, 0, 150, IType.SIN_FULL)) .addBus("RECOIL", new BusAnimationSequence().hold(50).addPos(0, 0, -0.25, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("CYCLE", new BusAnimationSequence().addPos(0, 0, 18, 50)); .addBus("BARREL", new BusAnimationSequence().addPos(0, 0, -1, 50, IType.SIN_DOWN).addPos(0, 0, 0, 150))
.addBus("CYCLE", new BusAnimationSequence().addPos(1, 0, 0, 150))
.addBus("HOOD", new BusAnimationSequence().hold(50).addPos(3, 0, 0, 50, IType.SIN_DOWN).addPos(0, 0, 0, 50, IType.SIN_UP));
case CYCLE_DRY: return new BusAnimation() case CYCLE_DRY: return new BusAnimation()
.addBus("CYCLE", new BusAnimationSequence().addPos(0, 0, 18, 50)); .addBus("CYCLE", new BusAnimationSequence().addPos(0, 0, 18, 50));
case RELOAD: return new BusAnimation()
.addBus("LEVER", new BusAnimationSequence().addPos(0, 0, 1, 150).hold(2750).addPos(0, 0, 0, 150))
.addBus("HOOD", new BusAnimationSequence().hold(250).addPos(60, 0, 0, 500, IType.SIN_FULL).hold(1500).addPos(0, 0, 0, 500, IType.SIN_FULL))
.addBus("BELT", new BusAnimationSequence().setPos(1, 0, 0).hold(750).addPos(0, 0, 0, 500, IType.SIN_FULL).hold(500).addPos(1, 0, 0, 500, IType.SIN_FULL));
} }
return LAMBDA_SHREDDER_ANIMS.apply(stack, type); return null;
}; };
} }

View File

@ -922,16 +922,18 @@ public class ModEventHandlerClient {
ItemFluidDuct.class ItemFluidDuct.class
); );
String prefix = "Gun "; String prefix = "Slot ";
int scale = 8; int gunScale = 8;
int slotScale = 1;
boolean ignoreNonNTM = true; boolean ignoreNonNTM = true;
boolean onlyGuns = true;
List<ItemStack> stacks = new ArrayList<ItemStack>(); List<ItemStack> stacks = new ArrayList<ItemStack>();
for (Object reg : Item.itemRegistry) { for (Object reg : Item.itemRegistry) {
Item item = (Item) reg; Item item = (Item) reg;
if(ignoreNonNTM && !Item.itemRegistry.getNameForObject(item).startsWith("hbm:")) continue; if(ignoreNonNTM && !Item.itemRegistry.getNameForObject(item).startsWith("hbm:")) continue;
if(ignoredItems.contains(item)) continue; if(ignoredItems.contains(item)) continue;
if(!(item instanceof ItemGunBaseNT) && prefix.toLowerCase(Locale.US).startsWith("gun")) continue; if(onlyGuns && !(item instanceof ItemGunBaseNT)) continue;
if(collapsedClasses.contains(item.getClass())) { if(collapsedClasses.contains(item.getClass())) {
stacks.add(new ItemStack(item)); stacks.add(new ItemStack(item));
} else { } else {
@ -940,7 +942,7 @@ public class ModEventHandlerClient {
} }
Minecraft.getMinecraft().thePlayer.closeScreen(); Minecraft.getMinecraft().thePlayer.closeScreen();
FMLCommonHandler.instance().showGuiScreen(new GUIScreenWikiRender(stacks.toArray(new ItemStack[0]), prefix, "wiki-block-renders-256", scale)); FMLCommonHandler.instance().showGuiScreen(new GUIScreenWikiRender(stacks.toArray(new ItemStack[0]), prefix, "wiki-block-renders-256", slotScale));
} }
} else { } else {
isRenderingItems = false; isRenderingItems = false;

View File

@ -2,14 +2,17 @@ package com.hbm.render.item.weapon.sedna;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.hbm.interfaces.NotableComments;
import com.hbm.items.weapon.sedna.ItemGunBaseNT; import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.main.ResourceManager; import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations; import com.hbm.render.anim.HbmAnimations;
import com.hbm.util.BobMathUtil; import com.hbm.util.BobMathUtil;
import com.hbm.util.Vec3NT;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@NotableComments
public class ItemRenderSexy extends ItemRenderWeaponBase { public class ItemRenderSexy extends ItemRenderWeaponBase {
@Override @Override
@ -43,8 +46,15 @@ public class ItemRenderSexy extends ItemRenderWeaponBase {
double scale = 0.375D; double scale = 0.375D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
boolean doesCycle = HbmAnimations.getRelevantAnim(0) != null && HbmAnimations.getRelevantAnim(0).animation.getBus("CYCLE") != null;
boolean reloading = HbmAnimations.getRelevantAnim(0) != null && HbmAnimations.getRelevantAnim(0).animation.getBus("BELT") != null;
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP"); double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL"); double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] cycle = HbmAnimations.getRelevantTransformation("CYCLE");
double[] barrel = HbmAnimations.getRelevantTransformation("BARREL");
double[] hood = HbmAnimations.getRelevantTransformation("HOOD");
double[] lever = HbmAnimations.getRelevantTransformation("LEVER");
double[] belt = HbmAnimations.getRelevantTransformation("BELT");
GL11.glTranslated(0, -1, -8); GL11.glTranslated(0, -1, -8);
GL11.glRotated(equip[0], 1, 0, 0); GL11.glRotated(equip[0], 1, 0, 0);
@ -57,7 +67,7 @@ public class ItemRenderSexy extends ItemRenderWeaponBase {
ResourceManager.sexy.renderPart("Gun"); ResourceManager.sexy.renderPart("Gun");
GL11.glPushMatrix(); GL11.glPushMatrix();
//GL11.glTranslated(0, 0, -1); GL11.glTranslated(0, 0, barrel[2]);
ResourceManager.sexy.renderPart("Barrel"); ResourceManager.sexy.renderPart("Barrel");
GL11.glPopMatrix(); GL11.glPopMatrix();
@ -70,42 +80,64 @@ public class ItemRenderSexy extends ItemRenderWeaponBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(0, 0.4375, -2.875); GL11.glTranslated(0, 0.4375, -2.875);
//GL11.glRotated(60, 1, 0, 0); GL11.glRotated(hood[0], 1, 0, 0);
GL11.glTranslated(0, -0.4375, 2.875); GL11.glTranslated(0, -0.4375, 2.875);
ResourceManager.sexy.renderPart("Hood"); ResourceManager.sexy.renderPart("Hood");
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(0, 0.46875, -6.875); GL11.glTranslated(0, 0.46875, -6.875);
//GL11.glRotated(60, 1, 0, 0); GL11.glRotated(lever[2] * 60, 1, 0, 0);
GL11.glTranslated(0, -0.46875, 6.875); GL11.glTranslated(0, -0.46875, 6.875);
ResourceManager.sexy.renderPart("Lever"); ResourceManager.sexy.renderPart("Lever");
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(0, 0, -6.75); GL11.glTranslated(0, 0, -6.75);
//GL11.glScaled(1, 1, 0.75); GL11.glScaled(1, 1, 1 - lever[2] * 0.25);
GL11.glTranslated(0, 0, 6.75); GL11.glTranslated(0, 0, 6.75);
ResourceManager.sexy.renderPart("LockSpring"); ResourceManager.sexy.renderPart("LockSpring");
GL11.glPopMatrix(); GL11.glPopMatrix();
ResourceManager.sexy.renderPart("Magazine"); ResourceManager.sexy.renderPart("Magazine");
/*renderShell(0, -0.375, 90, false);
renderShell(0.3125, -0.0625, 30, false);
renderShell(0.75, -0.125, -30, false);
renderShell(1.0625, -0.4375, -60, false);
renderShell(1.0625, -0.875, -90, false);
renderShell(1.0625, -1.3125, -90, false);*/
double p = 0.0625D; double p = 0.0625D;
double x = p * 17;
double y = p * -26;
double angle = 0;
Vec3NT vec = new Vec3NT(0, 0.4375, 0); // reusable, just like how toilet paper was reusable during corona
// basically what all this does is take an array of angles and just strings together shells with the appropriate
// position and angle calculated out of the next angle, taking all previous transformations into account.
// has a second array which is the "open" position that the animation can smoothly interpolate through
double[] anglesLoaded = new double[] {0, 0, 20, 20, 50, 60, 70};
double[] anglesUnloaded = new double[] {0, -10, -50, -60, -60, 0, 0};
double reloadProgress = !reloading ? 1D : belt[0];
double cycleProgress = !doesCycle ? 1 : cycle[0];
renderShell(p * 0, p * -6, 90, true); double[][] shells = new double[anglesLoaded.length][3];
renderShell(p * 5, p * 1, 30, true);
renderShell(p * 12, p * -1, -30, true); // generate belt, interp used for the reload animation
renderShell(p * 17, p * -6, -60, true); for(int i = 0; i < anglesLoaded.length; i++) {
renderShell(p * 17, p * -13, -90, true); shells[i][0] = x;
renderShell(p * 17, p * -20, -90, true); shells[i][1] = y;
shells[i][2] = angle - 90;
double delta = BobMathUtil.interp(anglesUnloaded[i], anglesLoaded[i], reloadProgress);
angle += delta;
vec.rotateAroundZDeg(-delta);
x += vec.xCoord;
y += vec.yCoord;
}
// draw belt, interp used for cycling (shells will transform towards the position/rotation of the next shell)
for(int i = 0; i < shells.length - 1; i++) {
double[] prevShell = shells[i];
double[] nextShell = shells[i + 1];
renderShell(
BobMathUtil.interp(prevShell[0], nextShell[0], cycleProgress),
BobMathUtil.interp(prevShell[1], nextShell[1], cycleProgress),
BobMathUtil.interp(prevShell[2], nextShell[2], cycleProgress), true);
}
GL11.glShadeModel(GL11.GL_FLAT); GL11.glShadeModel(GL11.GL_FLAT);
} }
@ -113,10 +145,9 @@ public class ItemRenderSexy extends ItemRenderWeaponBase {
@Override @Override
public void setupThirdPerson(ItemStack stack) { public void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack); super.setupThirdPerson(stack);
double scale = 1.25D; double scale = 1.75D;
GL11.glScaled(scale, scale, scale); GL11.glScaled(scale, scale, scale);
GL11.glTranslated(0, 0, 4); GL11.glTranslated(1, 1, 6);
} }
@Override @Override