From 247eaccc904c560ec5a2c74d55278ab70acfe963 Mon Sep 17 00:00:00 2001 From: Bob Date: Thu, 3 Feb 2022 22:39:27 +0100 Subject: [PATCH] some minor UV work, made transission seals not crashy --- .../hbm/items/special/ItemHolotapeImage.java | 1 + .../java/com/hbm/packet/PacketDispatcher.java | 2 + .../render/tileentity/RenderDoorGeneric.java | 3 +- .../hbm/tileentity/TileEntityDoorGeneric.java | 39 ++++++++++-------- .../assets/hbm/textures/armor/rpa_arm.png | Bin 0 -> 709 bytes .../assets/hbm/textures/armor/rpa_leg.png | Bin 0 -> 706 bytes 6 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 src/main/resources/assets/hbm/textures/armor/rpa_arm.png create mode 100644 src/main/resources/assets/hbm/textures/armor/rpa_leg.png diff --git a/src/main/java/com/hbm/items/special/ItemHolotapeImage.java b/src/main/java/com/hbm/items/special/ItemHolotapeImage.java index 44b0e1718..dfb1a60f4 100644 --- a/src/main/java/com/hbm/items/special/ItemHolotapeImage.java +++ b/src/main/java/com/hbm/items/special/ItemHolotapeImage.java @@ -49,6 +49,7 @@ public class ItemHolotapeImage extends ItemHoloTape { HOLO_O_1( EnumChatFormatting.WHITE, "Chroma", "X00-TRANSCRIPT", "[Start of Automated Audio Transcript] in a boardroom, right, and they're trying to come up with some new ideas. So one guy just says they should reuse this other character from somewhere else, who has like this night-theme you know, and just change the entire schtick to day. So when they had to come up with a name, one guy said, why not take the original name, replace the N with a D, because of night to day, right, and run with it? Now the name sounds like 'Dicks'! Funniest thing I've ever heard! [End of Transcript]"), HOLO_O_2( EnumChatFormatting.WHITE, "Chroma", "X01-NEWS", "The tape contains a news article, reporting an unusually pale person throwing flashbangs at people in public. The image at the bottom shows one of the incidents, unsurprisingly the light from one of the flashbangs made it unrecognizable."), HOLO_O_3( EnumChatFormatting.WHITE, "Chroma", "X02-FICTION", "The tape contains an article from a science fiction magazine, engaging with various reader comments about what to do with a time machine. One of those comments suggests engaging in various unsanitary acts with the future self, being signed off with just the initial '~D'."), + HOLO_CHALLENGE( EnumChatFormatting.GRAY, "None", "-", "An empty holotape. The back has the following message scribbled on it with black marker: \"official challenge - convince me that lyons' brotherhood isn't the best brotherhood of steel chapter and win a custom cape!\" The tape smells like chicken nuggets."), ; private String name; diff --git a/src/main/java/com/hbm/packet/PacketDispatcher.java b/src/main/java/com/hbm/packet/PacketDispatcher.java index 42703f6aa..8be73219b 100644 --- a/src/main/java/com/hbm/packet/PacketDispatcher.java +++ b/src/main/java/com/hbm/packet/PacketDispatcher.java @@ -95,6 +95,8 @@ public class PacketDispatcher { wrapper.registerMessage(NBTControlPacket.Handler.class, NBTControlPacket.class, i++, Side.SERVER); //Packet to send for anvil recipes to be crafted wrapper.registerMessage(AnvilCraftPacket.Handler.class, AnvilCraftPacket.class, i++, Side.SERVER); + //Sends a funi text to display like a music disc announcement + wrapper.registerMessage(TEDoorAnimationPacket.Handler.class, TEDoorAnimationPacket.class, i++, Side.CLIENT); } } diff --git a/src/main/java/com/hbm/render/tileentity/RenderDoorGeneric.java b/src/main/java/com/hbm/render/tileentity/RenderDoorGeneric.java index 147758e86..ef7fd3388 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderDoorGeneric.java +++ b/src/main/java/com/hbm/render/tileentity/RenderDoorGeneric.java @@ -11,7 +11,6 @@ import com.hbm.animloader.AnimationWrapper; import com.hbm.animloader.AnimationWrapper.EndResult; import com.hbm.animloader.AnimationWrapper.EndType; import com.hbm.blocks.BlockDummyable; -import com.hbm.main.ResourceManager; import com.hbm.render.WavefrontObjDisplayList; import com.hbm.tileentity.DoorDecl; import com.hbm.tileentity.TileEntityDoorGeneric; @@ -37,7 +36,7 @@ public class RenderDoorGeneric extends TileEntitySpecialRenderer { if(buf == null){ buf = GLAllocation.createDirectByteBuffer(8*4).asDoubleBuffer(); } - DoorDecl door = te.doorType; + DoorDecl door = te.getDoorType(); GL11.glPushMatrix(); GL11.glTranslated(x+0.5, y, z+0.5); diff --git a/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java b/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java index a18548b19..64a846c00 100644 --- a/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java +++ b/src/main/java/com/hbm/tileentity/TileEntityDoorGeneric.java @@ -1,15 +1,12 @@ package com.hbm.tileentity; -import java.util.Arrays; import java.util.HashSet; -import java.util.List; import java.util.Set; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.generic.BlockDoorGeneric; import com.hbm.interfaces.IAnimatedDoor; -import com.hbm.main.MainRegistry; import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEDoorAnimationPacket; import com.hbm.sound.AudioWrapper; @@ -22,15 +19,13 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumFacing; -import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAnimatedDoor { //0: closed, 1: open, 2: closing, 3: opening public byte state = 0; - public DoorDecl doorType; + protected DoorDecl doorType; public int openTicks = 0; public long animStartTime = 0; public int redstonePower; @@ -44,8 +39,8 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn public void updateEntity(){ if(state == 3) { openTicks++; - if(openTicks >= doorType.timeToOpen()) { - openTicks = doorType.timeToOpen(); + if(openTicks >= getDoorType().timeToOpen()) { + openTicks = getDoorType().timeToOpen(); } } else if(state == 2) { openTicks--; @@ -57,7 +52,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn if(worldObj.isRemote) { } else { - int[][] ranges = doorType.getDoorOpenRanges(); + int[][] ranges = getDoorType().getDoorOpenRanges(); ForgeDirection dir = ForgeDirection.getOrientation(getBlockMetadata() - BlockDummyable.offset); if(state == 3) { @@ -66,7 +61,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn int[] range = ranges[i]; int[] startPos = new int[] {range[0], range[1], range[2]}; - float time = doorType.getDoorRangeOpenTime(openTicks, i); + float time = getDoorType().getDoorRangeOpenTime(openTicks, i); for(int j = 0; j < Math.abs(range[3]); j++) { @@ -101,7 +96,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn int[] range = ranges[i]; int[] startPos = new int[] {range[0], range[1], range[2]}; - float time = doorType.getDoorRangeOpenTime(openTicks, i); + float time = getDoorType().getDoorRangeOpenTime(openTicks, i); for(int j = Math.abs(range[3])-1; j >= 0; j--) { @@ -129,7 +124,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn } } } - if(state == 3 && openTicks == doorType.timeToOpen()) { + if(state == 3 && openTicks == getDoorType().timeToOpen()) { state = 1; } if(state == 2 && openTicks == 0) { @@ -160,24 +155,33 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn } } - //@Override TODO: figure this one out - public void onLoad(){ - doorType = ((BlockDoorGeneric)this.getBlockType()).type; + public DoorDecl getDoorType(){ + + if(this.doorType == null) + this.doorType = ((BlockDoorGeneric)this.getBlockType()).type; + + return this.doorType; } public boolean tryToggle(EntityPlayer player){ + + System.out.println("start"); + if(state == 0 && redstonePower > 0){ + System.out.println("red power > 0"); //Redstone "power locks" doors, just like minecraft iron doors return false; } if(this.state == 0) { if(!worldObj.isRemote && canAccess(player)) { this.state = 3; + System.out.println("opening"); } return true; } else if(this.state == 1) { if(!worldObj.isRemote && canAccess(player)) { this.state = 2; + System.out.println("closing"); } return true; } @@ -231,13 +235,14 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn @Override @SideOnly(Side.CLIENT) public void handleNewState(byte state){ + if(this.state != state) { if(this.state == 0 && state == 3){ if(audio == null){ //audio = MainRegistry.proxy.getLoopedSoundStartStop(world, doorType.getOpenSoundLoop(), doorType.getOpenSoundStart(), doorType.getOpenSoundEnd(), SoundCategory.BLOCKS, pos.getX(), pos.getY(), pos.getZ(), doorType.getSoundVolume(), 1); //audio.startSound(); } - if(audio2 == null && doorType.getSoundLoop2() != null){ + if(audio2 == null && getDoorType().getSoundLoop2() != null){ //audio2 = MainRegistry.proxy.getLoopedSoundStartStop(world, doorType.getSoundLoop2(), null, null, SoundCategory.BLOCKS, pos.getX(), pos.getY(), pos.getZ(), doorType.getSoundVolume(), 1); //audio2.startSound(); } @@ -247,7 +252,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn //audio = MainRegistry.proxy.getLoopedSoundStartStop(world, doorType.getCloseSoundLoop(), doorType.getCloseSoundStart(), doorType.getCloseSoundEnd(), SoundCategory.BLOCKS, pos.getX(), pos.getY(), pos.getZ(), doorType.getSoundVolume(), 1); //audio.startSound(); } - if(audio2 == null && doorType.getSoundLoop2() != null){ + if(audio2 == null && getDoorType().getSoundLoop2() != null){ //audio2 = MainRegistry.proxy.getLoopedSoundStartStop(world, doorType.getSoundLoop2(), null, null, SoundCategory.BLOCKS, pos.getX(), pos.getY(), pos.getZ(), doorType.getSoundVolume(), 1); //audio2.startSound(); } diff --git a/src/main/resources/assets/hbm/textures/armor/rpa_arm.png b/src/main/resources/assets/hbm/textures/armor/rpa_arm.png new file mode 100644 index 0000000000000000000000000000000000000000..191bdc0ab616ae4f7b18ac5d2b401d2da3d8d6d4 GIT binary patch literal 709 zcmeAS@N?(olHy`uVBq!ia0vp^9zYzP`c6K^zF=8zy3u0k7Um@v zc(1XlF}8fsxu*VR!uORX9=oG#t5nz4O$(TodMn55;5^OKMl+dxFGs{)e|TrlB8{Ny zd$u2&J9GY&;I2g(SF7J`-+m^=zHpX`KHue{m2;L#>c!98di#%Q>^9+jE$80yB`;l` zIqTj}`B%46ZPQt2KJ|VzF}ZBQ0^2Q#JAIa44t(YM>~zZK9kb)yBh22ptXq6@mzDOb zbDMLwduTgeSNauNTA~qJ_jT4xp%xDT1;+*!Mj@6xw?cDFu7!4dSDZQXXl?z9<{#DN zXS-!<6^vCmGF4w}VgD1f;<-%hwM)gT6L+^9DL;L#(o#k>qi1%g@#bCY4x7s7ACcI6 z-SzZ8&kHk(_?EB#w`1|^x;J+D#p-F-Cl>#R4is7W{=$vPpLZwT2&c2|pWOudn;IfBt1fHjp
Ln_+K%h~kG;RvE?{94-n{?h$-PQ%rvI0p zbmbMhu2}b)UOV0L)qfY9eDv^oH`lgP2iYgzw6VDQ_=?=z=7w+S2a4zOugYUp#o{^+ z@&CQf;wByT;_IuemVeWL1Zj&&iO;nIY!|3+T0z=y{I bI>X<4+a^I*hR!*_bjjf9>gTe~DWM4f=;SV0 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/armor/rpa_leg.png b/src/main/resources/assets/hbm/textures/armor/rpa_leg.png new file mode 100644 index 0000000000000000000000000000000000000000..d7ddbbcb7532393049d3df4e2001267d5d22c0cc GIT binary patch literal 706 zcmeAS@N?(olHy`uVBq!ia0vp^9zYz=!3HF~?HW^n6icy_X9x!n)NrJ9FfcGxdb&7< zRLprh=c4an0}3~{()zDK&y5`| znb&E!A4zU9i=EOdS9ec4V|DwMx1lNf*D9S#Z<29zWZ+^75NK#(5Mf!M(6HYsV?XaN zkwqOHd|xl{{Mv0>vp$5m)4);SdQ)4=6S>VtmMVn$&NH&iJ%8}Nlu7Elzc+$s=PFO< zl)CW#XKeq{AyA0dXtX%ESrjgSnf`m(ZTc$d4T(3111vKQ7Lx-K4Pzem6R%TZ0X z1qwjbF}4;#PVb_2{q>Z#7G~KolcjUXat%{kB_Dw&uY^r}c~^BWD;4(&zVWt9ZEDH= z?_$d*eyz$anpap~lz%z+YQ1{mA8*c!tG1Y1osR%YpPUq8+82M?l%v4BDJbpKO0#n1 z7cqbCv*jGvux!p}_D)Vj;DTM65XQdpV&yFxwds7qzyJq|t=c1g`PAF!Lo9Hw1!P-I zlrY|JrMcUErP?x1Ey)$(o@q@wY%cM-*QG literal 0 HcmV?d00001