mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
the electric arcs are your friends, touch them
This commit is contained in:
parent
947078b759
commit
64c6c077e0
@ -1,10 +1,15 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKLever;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
@ -46,4 +51,26 @@ public class RBMKLever extends RBMKMiniPanelBase implements IToolable {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
|
||||
super.renderInventoryBlock(block, meta, modelId, renderBlocks);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.rbmk_lever_tex);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.25, 0, i * -0.5 + 0.25);
|
||||
ResourceManager.rbmk_lever.renderPart("Base");
|
||||
ResourceManager.rbmk_lever.renderPart("Lever");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1758,10 +1758,12 @@ public class ClientProxy extends ServerProxy {
|
||||
}
|
||||
|
||||
if("tau".equals(type)) {
|
||||
boolean small = data.getBoolean("small");
|
||||
|
||||
for(int i = 0; i < data.getByte("count"); i++)
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleSpark(world, x, y, z, rand.nextGaussian() * 0.05, 0.05, rand.nextGaussian() * 0.05));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleHadron(man, world, x, y, z));
|
||||
for(int i = 0; i < data.getByte("count"); i++) {
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleSpark(world, x, y, z, rand.nextGaussian() * 0.05, 0.05, rand.nextGaussian() * 0.05).makeSmall(small));
|
||||
}
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleHadron(man, world, x, y, z).makeSmall(small));
|
||||
}
|
||||
|
||||
if("vanish".equals(type)) {
|
||||
|
||||
@ -100,6 +100,9 @@ public class NTMSounds {
|
||||
public static final String BLOCK_PLUSHY = "hbm:block.squeakyToy"; // squee
|
||||
public static final String BLOCK_HUNDUNS_MAGNIFICENT_HOWL = "hbm:block.hunduns_magnificent_howl"; // tragic yuri
|
||||
public static final String BLOCK_FALLOUT_3_POPUP = "hbm:block.bobble";
|
||||
public static final String LEVER_START = "hbm:block.leverStart";
|
||||
public static final String LEVER_STOP = "hbm:block.leverStop";
|
||||
public static final String SPARK = "hbm:block.spark";
|
||||
|
||||
/// MACHINE SOUNDS, MOSTLY LOOPS ///
|
||||
public static final String ELECTRIC_MOTOR_LOOP = "hbm:block.motor";
|
||||
|
||||
@ -25,11 +25,19 @@ public class ParticleHadron extends EntityFX {
|
||||
super(world, x, y, z);
|
||||
this.theRenderEngine = texman;
|
||||
this.particleMaxAge = 10;
|
||||
this.particleScale = 1F;
|
||||
}
|
||||
|
||||
public int getFXLayer() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public ParticleHadron makeSmall(boolean small) {
|
||||
if(!small) return this;
|
||||
this.particleScale = 0.5F;
|
||||
this.particleMaxAge = 5;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) {
|
||||
|
||||
@ -49,7 +57,7 @@ public class ParticleHadron extends EntityFX {
|
||||
tess.setBrightness(240);
|
||||
|
||||
this.particleAlpha = 1 - (((float)this.particleAge + interp) / (float)this.particleMaxAge);
|
||||
float scale = (this.particleAge + interp) * 0.15F;
|
||||
float scale = (this.particleAge + interp) * 0.15F * this.particleScale;
|
||||
|
||||
tess.setColorRGBA_F(1.0F, 1.0F, 1.0F, this.particleAlpha);
|
||||
|
||||
|
||||
@ -25,6 +25,15 @@ public class ParticleSpark extends EntityFX {
|
||||
public int getFXLayer() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public ParticleSpark makeSmall(boolean small) {
|
||||
if(!small) return this;
|
||||
this.setSize(0.01F, 0.01F);
|
||||
this.thresh = 3;
|
||||
this.particleMaxAge = 2 + rand.nextInt(3);
|
||||
this.motionY = -Math.abs(motionY);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void onUpdate() {
|
||||
|
||||
|
||||
@ -1,17 +1,22 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import com.hbm.handler.threading.PacketThreading;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.gui.GUIScreenRBMKLever;
|
||||
import com.hbm.main.NTMSounds;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.tileentity.network.RTTYSystem;
|
||||
import com.hbm.util.BufferUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityRBMKLever extends TileEntityLoadedBase implements IGUIProvider, IControlReceiver {
|
||||
|
||||
@ -49,6 +54,7 @@ public class TileEntityRBMKLever extends TileEntityLoadedBase implements IGUIPro
|
||||
|
||||
public class LeverUnit {
|
||||
|
||||
public int index;
|
||||
/** If the output should be per tick, allows the lever to lock in place */
|
||||
public boolean polling;
|
||||
/** Label on the lever as rendered on the panel */
|
||||
@ -70,19 +76,26 @@ public class TileEntityRBMKLever extends TileEntityLoadedBase implements IGUIPro
|
||||
public static final float FLIP_SPEED = 1F / 10F; // 0.5s
|
||||
|
||||
public LeverUnit(int initialIndex) {
|
||||
this.index = initialIndex;
|
||||
label = "Lever " + (initialIndex + 1);
|
||||
}
|
||||
|
||||
public void click() {
|
||||
if(!active) return;
|
||||
|
||||
if(this.flipProgress <= 0 || this.flipProgress >= 1)
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, NTMSounds.LEVER_START, 1F, 1F);
|
||||
|
||||
this.isTurningOn = !isTurningOn;
|
||||
TileEntityRBMKLever.this.markDirty();
|
||||
}
|
||||
|
||||
public void update() {
|
||||
this.prevFlipProgress = this.flipProgress;
|
||||
if(!active) return;
|
||||
|
||||
boolean arcFlash = false;
|
||||
|
||||
if(polling) {
|
||||
if(this.flipProgress >= 1F && canSend(commandOn)) RTTYSystem.broadcast(worldObj, rtty, commandOn);
|
||||
if(this.flipProgress <= 0F && canSend(commandOff)) RTTYSystem.broadcast(worldObj, rtty, commandOff);
|
||||
@ -95,15 +108,38 @@ public class TileEntityRBMKLever extends TileEntityLoadedBase implements IGUIPro
|
||||
this.flipProgress = 1F;
|
||||
// for non-polling levers, send one message
|
||||
if(!polling && canSend(commandOn)) RTTYSystem.broadcast(worldObj, rtty, commandOn);
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, NTMSounds.LEVER_STOP, 0.5F, 1F);
|
||||
arcFlash = true;
|
||||
}
|
||||
|
||||
// turning off...
|
||||
} else if(!this.isTurningOn && this.flipProgress > 0F) {
|
||||
if(this.prevFlipProgress >= 1) arcFlash = true;
|
||||
this.flipProgress -= FLIP_SPEED;
|
||||
if(this.flipProgress <= 0F) {
|
||||
this.flipProgress = 0F;
|
||||
// for non-polling levers, send the off message once upon return
|
||||
if(!polling && canSend(commandOff)) RTTYSystem.broadcast(worldObj, rtty, commandOff);
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, NTMSounds.LEVER_STOP, 0.5F, 1F);
|
||||
}
|
||||
}
|
||||
|
||||
if(arcFlash) {
|
||||
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, NTMSounds.SPARK, 1F, 1F);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(getBlockMetadata());
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
double x = xCoord + 0.5 + dir.offsetX * 0.4 - rot.offsetX * (index - 0.5) * (i == 0 ? 0.375 : 0.625);
|
||||
double y = yCoord + 0.4375 - 0.03125;
|
||||
double z = zCoord + 0.5 + dir.offsetZ * 0.4 - rot.offsetZ * (index - 0.5) * (i == 0 ? 0.375 : 0.625);
|
||||
|
||||
NBTTagCompound dPart = new NBTTagCompound();
|
||||
dPart.setString("type", "tau");
|
||||
dPart.setByte("count", (byte)5);
|
||||
dPart.setBoolean("small", true);
|
||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(dPart, x, y, z), new TargetPoint(worldObj.provider.dimensionId, x, y, z, 25));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
"en_US": "Redstone-over-Radio Keypad"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "Interactive [[redstone over radio|Redstone over Radio]] transmitting device, needs to be configured with a scredriver first. Up to four buttons can be enabled using the red buttons, each button can transmit one value over its own RoR channel. This is useful for [RoR controllers|Redstone-over-Radio Controller], allowing things like RBMK settings to be adjusted with the push of a button.<br><br>The color setting accepts hexadecimal values, i.e. up to six characters with groups of two representing red, green and blue color components respectively. As a rule of thumb: FF is full color, 80 is half color and 00 is no color. FF8000 (full red, half green and no blue) is therefore orange.<br><br>The polling setting on the keypad turns the button into a locking one, the button remains pressed, sending the RoR signal each tick, until it is unpressed. State change buttons only send the command once when initially pressed.<br><br>See also:<br>[Redstone-over-Radio Gauge]<br>[Redstone-over-Radio Numeric Display]<br>[Redstone-over-Radio Graph]<br>[Redstone-over-Radio Lever]"
|
||||
"en_US": "Interactive [[redstone over radio|Redstone over Radio]] transmitting device, needs to be configured with a scredriver first. Up to four buttons can be enabled using the red buttons, each button can transmit one value over its own RoR channel. This is useful for [RoR controllers|Redstone-over-Radio Controller], allowing things like RBMK settings to be adjusted with the push of a button.<br><br>The color setting accepts hexadecimal values, i.e. up to six characters with groups of two representing red, green and blue color components respectively. As a rule of thumb: FF is full color, 80 is half color and 00 is no color. FF8000 (full red, half green and no blue) is therefore orange.<br><br>The polling setting on the keypad turns the button into a locking one, the button remains pressed, sending the RoR signal each tick, until it is unpressed. State change buttons only send the command once when initially pressed.<br><br>See also:<br>[[Redstone-over-Radio Gauge]]<br>[[Redstone-over-Radio Numeric Display]]<br>[[Redstone-over-Radio Graph]]<br>[[Redstone-over-Radio Lever]]"
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
"en_US": "Redstone-over-Radio Gauge"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values using a gauge needle. Up to four gauges can be enabled using the red buttons, each gauge can receive one value over its own RoR channel. Minimum and maximum values need to be configured before the gauge can be used, if the minimum is set to a higher value than the maximum, then the needle will run in reverse. The needle can exceed the maximum value by up to 50%, entering the red section of the gauge.<br><br>See also:<br>[Redstone-over-Radio Keypad]<br>[Redstone-over-Radio Numeric Display]<br>[Redstone-over-Radio Graph]<br>[Redstone-over-Radio Lever]"
|
||||
"en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values using a gauge needle. Up to four gauges can be enabled using the red buttons, each gauge can receive one value over its own RoR channel. Minimum and maximum values need to be configured before the gauge can be used, if the minimum is set to a higher value than the maximum, then the needle will run in reverse. The needle can exceed the maximum value by up to 50%, entering the red section of the gauge.<br><br>See also:<br>[[Redstone-over-Radio Keypad]]<br>[[Redstone-over-Radio Numeric Display]]<br>[[Redstone-over-Radio Graph]]<br>[[Redstone-over-Radio Lever]]"
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
"en_US": "Redstone-over-Radio Graph"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values over time using a line graph. Values are updated every half second, and the graph can log up to 15 seconds of input. Up to two graphs can be enabled using the red buttons, each graphs can receive one value over its own RoR channel. Useful for displaying values where the change over time is important, such as temperature curves.<br><br>See also:<br>[Redstone-over-Radio Keypad]<br>[Redstone-over-Radio Gauge]<br>[Redstone-over-Radio Numeric Display]<br>[Redstone-over-Radio Lever]"
|
||||
"en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values over time using a line graph. Values are updated every half second, and the graph can log up to 15 seconds of input. Up to two graphs can be enabled using the red buttons, each graphs can receive one value over its own RoR channel. Useful for displaying values where the change over time is important, such as temperature curves.<br><br>See also:<br>[[Redstone-over-Radio Keypad]]<br>[[Redstone-over-Radio Gauge]]<br>[[Redstone-over-Radio Numeric Display]]<br>[[Redstone-over-Radio Lever]]"
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
"en_US": "Redstone-over-Radio Lever"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "Interactive [[redstone over radio|Redstone over Radio]] transmitting device, needs to be configured with a scredriver first. Up to two large breaker switches can be enabled using the red buttons, each button can transmit one value over its own RoR channel. Levers behave similar to keypad buttons, except that they can transmit different values depending on whether they have been turned on or off. With polling enabled, the switch will continuously send the signal corresponding to whichevever state it is in, except when the lever is currently being flipped. State change causes it to only send a single pulse after it has been flipped.<br><br>See also:<br>[Redstone-over-Radio Keypad]<br>[Redstone-over-Radio Gauge]<br>[Redstone-over-Radio Numeric Display]<br>[Redstone-over-Radio Graph]"
|
||||
"en_US": "Interactive [[redstone over radio|Redstone over Radio]] transmitting device, needs to be configured with a scredriver first. Up to two large breaker switches can be enabled using the red buttons, each button can transmit one value over its own RoR channel. Levers behave similar to keypad buttons, except that they can transmit different values depending on whether they have been turned on or off. With polling enabled, the switch will continuously send the signal corresponding to whichevever state it is in, except when the lever is currently being flipped. State change causes it to only send a single pulse after it has been flipped.<br><br>See also:<br>[[Redstone-over-Radio Keypad]]<br>[[Redstone-over-Radio Gauge]]<br>[[Redstone-over-Radio Numeric Display]]<br>[[Redstone-over-Radio Graph]]"
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
"en_US": "Redstone-over-Radio Numeric Display"
|
||||
},
|
||||
"content": {
|
||||
"en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values using a seven segment number display. Up to two displays can be enabled using the red buttons, each display can receive one value over its own RoR channel. Large values displayed will be shortened, using SI suffixes. Also useful for displaying item counts provided by an [[RoR item counter|Redstone-over-Radio Item Counter]].<br><br>See also:<br>[Redstone-over-Radio Keypad]<br>[Redstone-over-Radio Gauge]<br>[Redstone-over-Radio Graph]<br>[Redstone-over-Radio Lever]"
|
||||
"en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values using a seven segment number display. Up to two displays can be enabled using the red buttons, each display can receive one value over its own RoR channel. Large values displayed will be shortened, using SI suffixes. Also useful for displaying item counts provided by an [[RoR item counter|Redstone-over-Radio Item Counter]].<br><br>See also:<br>[[Redstone-over-Radio Keypad]]<br>[[Redstone-over-Radio Gauge]]<br>[[Redstone-over-Radio Graph]]<br>[[Redstone-over-Radio Lever]]"
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +74,9 @@
|
||||
"block.assemblerStart": {"category": "block", "sounds": [{"name": "block/assemblerStart", "stream": false}]},
|
||||
"block.assemblerStop": {"category": "block", "sounds": [{"name": "block/assemblerStop", "stream": false}]},
|
||||
"block.assemblerCut": {"category": "block", "sounds": [{"name": "block/assemblerCut", "stream": false}]},
|
||||
"block.leverStart": {"category": "block", "sounds": [{"name": "block/leverStart", "stream": false}]},
|
||||
"block.leverStop": {"category": "block", "sounds": [{"name": "block/leverStop", "stream": false}]},
|
||||
"block.spark": {"category": "block", "sounds": ["block/spark1", "block/spark2", "block/spark3", "block/spark4", "block/spark5", "block/spar6"]},
|
||||
|
||||
"door.TransitionSealOpen": {"category": "block", "sounds": [{"name": "block/door/transition_seal_open", "stream": true}]},
|
||||
"door.wghStart": {"category": "block", "sounds": [{"name": "block/door/wgh_start", "stream": true}]},
|
||||
@ -338,7 +341,7 @@
|
||||
"entity.siegeIdle": {"category": "hostile", "sounds": ["entity/siegeIdle1"]},
|
||||
"entity.siegeHurt": {"category": "hostile", "sounds": ["entity/siegeHurt1", "entity/siegeHurt2"]},
|
||||
"entity.siegeDeath": {"category": "hostile", "sounds": ["entity/siegeDeath1", "entity/siegeDeath2", "entity/siegeDeath3"]},
|
||||
"entity.meteoriteFallingLoop": {"category": "block", "sounds": [{"name": "entity/meteoriteFallingLoop", "stream": false}]},
|
||||
"entity.meteoriteFallingLoop": {"category": "block", "sounds": [{"name": "entity/meteoriteFallingLoop", "stream": false}]},
|
||||
|
||||
"step.metal": {"category": "player", "sounds": [{"name": "footsteps/metal", "stream": false}]},
|
||||
"step.iron_jump": {"category": "player", "sounds": [{"name": "footsteps/iron_jump", "stream": false}]},
|
||||
|
||||
BIN
src/main/resources/assets/hbm/sounds/block/leverStart.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/leverStart.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/sounds/block/leverStop.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/leverStop.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/sounds/block/spark1.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/spark1.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/sounds/block/spark2.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/spark2.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/sounds/block/spark3.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/spark3.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/sounds/block/spark4.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/spark4.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/sounds/block/spark5.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/spark5.ogg
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/sounds/block/spark6.ogg
Normal file
BIN
src/main/resources/assets/hbm/sounds/block/spark6.ogg
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user