This commit is contained in:
Boblet 2026-04-15 15:14:50 +02:00
parent 756e51f3e0
commit d9a33be854
62 changed files with 227 additions and 22315 deletions

View File

@ -1,10 +1,18 @@
## Added
* Redstone-over-radio lever
* Big breaker switches
* Up to two per module, side by side
* Can send different RoR values based on the lever's position
## Changed
* All RoR panels now have basic item descriptions informing about the screwdriver requirement for configuration
* EMP grenades now deal 5x damage against anything with powered armor
* Decreased base damage to compensate
* EMP grenades now destroy machines in a small radius like an EMP missile would
* Grenades are no longer affected by nuclear blasts or other grenade explosions
## Fixed
* Fixed the grenade crafting handler not checking if a shell/filling combination is even valid, allowing weird combos
* Fixed dispenser fired laser grenades crashing the game
* Fixed schrabidium grenade being obscenely powerful for no reason
* Fixed annihilator recipe config throwing an error about the recipe list being empty, even though the recipe list should indeed be empty on purpose

View File

@ -59,7 +59,7 @@ public class EntityHunterChopper extends EntityFlying implements IMob, IBossDisp
@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
if(!(source == ModDamageSource.shrapnel || source == ModDamageSource.nuclearBlast || source == ModDamageSource.blackhole || source.isExplosion() || ModDamageSource.getIsTau(source) || ModDamageSource.getIsSubatomic(source) || ModDamageSource.getIsDischarge(source)))
if(!(source == ModDamageSource.shrapnel || source == ModDamageSource.nuclearBlast || source == ModDamageSource.blackhole || source.isExplosion() || ModDamageSource.getIsTau(source) || ModDamageSource.getIsSubatomic(source)))
amount *= 0.1F;
if(this.isEntityInvulnerable() || source instanceof EntityDamageSource || this.getHealth() <= 0.1F) {

View File

@ -7,8 +7,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
@ -21,12 +21,15 @@ import net.minecraftforge.common.util.ForgeDirection;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.VersatileConfig;
import com.hbm.entity.projectile.EntityBulletBaseNT;
import com.hbm.entity.grenade.EntityGrenadeUniversal;
import com.hbm.entity.projectile.EntityB92Beam;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.interfaces.Spaghetti;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
import com.hbm.lib.Library;
import com.hbm.lib.ModDamageSource;
import com.hbm.util.ArmorUtil;
import com.hbm.util.Compat;
import com.hbm.util.EntityDamageUtil;
import api.hbm.energymk2.IEnergyHandlerMK2;
import cofh.api.energy.IEnergyProvider;
@ -77,10 +80,19 @@ public class ExplosionNukeGeneric {
if(!isExplosionExempt(e) && !Library.isObstructed(world, x, y, z, entX, entY, entZ)) {
boolean doKnockback = true;
double damage = maxDamage * (radius - dist) / radius;
e.attackEntityFrom(ModDamageSource.nuclearBlast, (float)damage);
if(e instanceof EntityLivingBase && e.isEntityAlive()) {
EntityLivingBase living = (EntityLivingBase) e;
doKnockback = EntityDamageUtil.attackEntityFromNT(living, ModDamageSource.nuclearBlast, (float) damage, true, true, 0, 100F, 0);
if(!e.isEntityAlive()) ConfettiUtil.decideConfetti(living, ModDamageSource.nuclearBlast);
} else {
e.attackEntityFrom(ModDamageSource.nuclearBlast, (float) damage);
}
e.setFire(5);
if(doKnockback) {
double knockX = e.posX - x;
double knockY = e.posY + e.getEyeHeight() - y;
double knockZ = e.posZ - z;
@ -95,6 +107,7 @@ public class ExplosionNukeGeneric {
}
}
}
}
@Spaghetti("just look at it")
private static boolean isExplosionExempt(Entity e) {
@ -102,8 +115,8 @@ public class ExplosionNukeGeneric {
if (e instanceof EntityOcelot ||
e instanceof EntityB92Beam ||
e instanceof EntityBulletBaseNT ||
e instanceof EntityPlayer &&
ArmorUtil.checkArmor((EntityPlayer) e, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots)) {
e instanceof EntityBulletBaseMK4 ||
e instanceof EntityGrenadeUniversal) {
return true;
}
@ -417,13 +430,14 @@ public class ExplosionNukeGeneric {
public static void emp(World world, int x, int y, int z) {
if (!world.isRemote) {
TileEntity te = world.getTileEntity(x, y, z);
TileEntity te = Compat.getTileStandard(world, x, y, z);
if(te == null) return;
if (te != null && te instanceof IEnergyHandlerMK2) {
if(te instanceof IEnergyHandlerMK2) {
((IEnergyHandlerMK2)te).setPower(0);
if(random.nextInt(5) < 1) world.setBlock(x, y, z, ModBlocks.block_electrical_scrap);
}
if (te != null && te instanceof IEnergyProvider) {
if(te instanceof IEnergyProvider) {
((IEnergyProvider)te).extractEnergy(ForgeDirection.UP, ((IEnergyProvider)te).getEnergyStored(ForgeDirection.UP), false);
((IEnergyProvider)te).extractEnergy(ForgeDirection.DOWN, ((IEnergyProvider)te).getEnergyStored(ForgeDirection.DOWN), false);
@ -432,8 +446,7 @@ public class ExplosionNukeGeneric {
((IEnergyProvider)te).extractEnergy(ForgeDirection.EAST, ((IEnergyProvider)te).getEnergyStored(ForgeDirection.EAST), false);
((IEnergyProvider)te).extractEnergy(ForgeDirection.WEST, ((IEnergyProvider)te).getEnergyStored(ForgeDirection.WEST), false);
if(random.nextInt(5) <= 1)
world.setBlock(x, y, z, ModBlocks.block_electrical_scrap);
if(random.nextInt(5) <= 1) world.setBlock(x, y, z, ModBlocks.block_electrical_scrap);
}
}
}

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import com.hbm.entity.grenade.EntityGrenadeUniversal;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.interfaces.ICustomDamageHandler;
@ -33,6 +34,10 @@ public class EntityProcessorCross implements IEntityProcessor {
protected double knockbackMult = 1D;
protected boolean allowSelfDamage = false;
public EntityProcessorCross() {
this(0);
}
public EntityProcessorCross(double nodeDist) {
this.nodeDist = nodeDist;
}
@ -69,12 +74,18 @@ public class EntityProcessorCross implements IEntityProcessor {
ForgeEventFactory.onExplosionDetonate(world, explosion.compat, list, size);
Vec3[] nodes = new Vec3[7];
Vec3[] nodes;
if(this.nodeDist > 0) {
nodes = new Vec3[7];
for(int i = 0; i < 7; i++) {
ForgeDirection dir = ForgeDirection.getOrientation(i);
nodes[i] = Vec3.createVectorHelper(x + dir.offsetX * nodeDist, y + dir.offsetY * nodeDist, z + dir.offsetZ * nodeDist);
}
} else {
nodes = new Vec3[1];
nodes[0] = Vec3.createVectorHelper(x, y, z);
}
HashMap<Entity, Float> damageMap = new HashMap();
@ -116,7 +127,7 @@ public class EntityProcessorCross implements IEntityProcessor {
if(!damageMap.containsKey(entity) || damageMap.get(entity) < dmg) damageMap.put(entity, dmg);
double enchKnockback = EnchantmentProtection.func_92092_a(entity, knockback);
if(!(entity instanceof EntityBulletBaseMK4)) {
if(shouldDealKnockback(entity)) {
entity.motionX += deltaX * enchKnockback * knockbackMult;
entity.motionY += deltaY * enchKnockback * knockbackMult;
entity.motionZ += deltaZ * enchKnockback * knockbackMult;
@ -147,6 +158,12 @@ public class EntityProcessorCross implements IEntityProcessor {
return affectedPlayers;
}
public static boolean shouldDealKnockback(Entity entity) {
if(entity instanceof EntityBulletBaseMK4) return false;
if(entity instanceof EntityGrenadeUniversal) return false;
return true;
}
public void attackEntity(Entity entity, ExplosionVNT source, float amount) {
entity.attackEntityFrom(setExplosionSource(source.compat), amount);
}

View File

@ -19,6 +19,7 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
@Deprecated // an inferior version to the cross processors, so there is no actual reason to ever use this one
public class EntityProcessorStandard implements IEntityProcessor {
protected IEntityRangeMutator range;

View File

@ -12,6 +12,7 @@ import com.hbm.util.i18n.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
@ -24,6 +25,10 @@ public class GUIScreenRBMKLever extends GuiScreen {
protected int guiLeft;
protected int guiTop;
protected GuiTextField[] label = new GuiTextField[4];
protected GuiTextField[] rtty = new GuiTextField[4];
protected GuiTextField[] cmdOn = new GuiTextField[4];
protected GuiTextField[] cmdOff = new GuiTextField[4];
protected boolean[] active = new boolean[2];
protected boolean[] polling = new boolean[2];
@ -46,6 +51,14 @@ public class GUIScreenRBMKLever extends GuiScreen {
int oY = 4;
for(int i = 0; i < 2; i++) {
rtty[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 55 + oY + i * 52, 72 - oX * 2, 14);
GUIScreenRBMKKeyPad.setupTextFieldStandard(rtty[i], 10, lever.levers[i].rtty);
label[i] = new GuiTextField(this.fontRendererObj, guiLeft + 175 + oX, guiTop + 55 + oY + i * 52, 72 - oX * 2, 14);
GUIScreenRBMKKeyPad.setupTextFieldStandard(label[i], 15, lever.levers[i].label);
cmdOn[i] = new GuiTextField(this.fontRendererObj, guiLeft + 45 + oX, guiTop + 73 + oY + i * 52, 81 - oX * 2, 14);
GUIScreenRBMKKeyPad.setupTextFieldStandard(cmdOn[i], 32, lever.levers[i].commandOn);
cmdOff[i] = new GuiTextField(this.fontRendererObj, guiLeft + 166 + oX, guiTop + 73 + oY + i * 52, 81 - oX * 2, 14);
GUIScreenRBMKKeyPad.setupTextFieldStandard(cmdOff[i], 32, lever.levers[i].commandOff);
active[i] = lever.levers[i].active;
polling[i] = lever.levers[i].polling;
@ -77,6 +90,10 @@ public class GUIScreenRBMKLever extends GuiScreen {
}
for(int i = 0; i < 2; i++) {
this.label[i].drawTextBox();
this.rtty[i].drawTextBox();
this.cmdOn[i].drawTextBox();
this.cmdOff[i].drawTextBox();
}
}
@ -111,13 +128,37 @@ public class GUIScreenRBMKLever extends GuiScreen {
data.setByte("polling", polling);
for(int i = 0; i < 2; i++) {
/*data.setString("label" + i, this.label[i].getText());
data.setString("label" + i, this.label[i].getText());
data.setString("rtty" + i, this.rtty[i].getText());
data.setString("cmd" + i, this.cmd[i].getText());*/
data.setString("cmdOn" + i, this.cmdOn[i].getText());
data.setString("cmdOff" + i, this.cmdOff[i].getText());
}
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, lever.xCoord, lever.yCoord, lever.zCoord));
return;
}
for(int i = 0; i < 2; i++) {
this.label[i].mouseClicked(x, y, b);
this.rtty[i].mouseClicked(x, y, b);
this.cmdOn[i].mouseClicked(x, y, b);
this.cmdOff[i].mouseClicked(x, y, b);
}
}
@Override
protected void keyTyped(char c, int b) {
for(int i = 0; i < 2; i++) {
if(this.label[i].textboxKeyTyped(c, b)) return;
if(this.rtty[i].textboxKeyTyped(c, b)) return;
if(this.cmdOn[i].textboxKeyTyped(c, b)) return;
if(this.cmdOff[i].textboxKeyTyped(c, b)) return;
}
if(b == 1 || b == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
this.mc.thePlayer.closeScreen();
this.mc.setIngameFocus();
}
}
@Override public void onGuiClosed() { Keyboard.enableRepeatEvents(false); }

View File

@ -84,6 +84,7 @@ public class AnnihilatorRecipes extends SerializableRecipe {
@Override public String getFileName() { return "hbmAnnihilator.json"; }
@Override public Object getRecipeObject() { return recipes; }
@Override public void deleteRecipes() { recipes.clear(); }
@Override public boolean allowEmptyRecipeList() { return true; }
public static HashMap getRecipes() {

View File

@ -213,7 +213,7 @@ public abstract class SerializableRecipe {
recipeList.addAll(((HashMap) recipeObject).entrySet());
}
if(recipeList.isEmpty())
if(recipeList.isEmpty() && !allowEmptyRecipeList())
throw new IllegalStateException("Error while writing recipes for " + this.getClass().getSimpleName() + ": Recipe list is either empty or in an unsupported format!");
JsonWriter writer = new JsonWriter(new FileWriter(template));
@ -240,6 +240,8 @@ public abstract class SerializableRecipe {
}
}
public boolean allowEmptyRecipeList() { return false; }
public void readRecipeFile(File file) {
try {
readRecipeStream(new FileReader(file));

View File

@ -1,6 +1,5 @@
package com.hbm.lib;
import com.hbm.entity.projectile.EntityBullet;
import net.minecraft.entity.Entity;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;
@ -9,15 +8,13 @@ public class ModDamageSource extends DamageSource {
public static DamageSource nuclearBlast = (new DamageSource("nuclearBlast")).setExplosion();
public static DamageSource mudPoisoning = (new DamageSource("mudPoisoning")).setDamageBypassesArmor();
public static DamageSource acid = (new DamageSource("acid")); //.setDamageBypassesArmor();
public static DamageSource acid = (new DamageSource("acid"));
public static DamageSource euthanizedSelf = (new DamageSource("euthanizedSelf")).setDamageBypassesArmor();
public static DamageSource euthanizedSelf2 = (new DamageSource("euthanizedSelf2")).setDamageBypassesArmor();
public static DamageSource tauBlast = (new DamageSource("tauBlast")).setDamageBypassesArmor();
public static DamageSource tauBlast = (new DamageSource("tauBlast")).setDamageBypassesArmor().setExplosion();
public static DamageSource radiation = (new DamageSource("radiation")).setDamageBypassesArmor();
public static DamageSource digamma = (new DamageSource("digamma")).setDamageIsAbsolute().setDamageBypassesArmor().setDamageAllowedInCreativeMode();
public static DamageSource suicide = (new DamageSource("suicide")).setProjectile();
public static DamageSource teleporter = (new DamageSource("teleporter")).setDamageIsAbsolute();
public static DamageSource cheater = (new DamageSource("cheater")).setDamageIsAbsolute().setDamageBypassesArmor().setDamageAllowedInCreativeMode();
public static DamageSource rubble = (new DamageSource("rubble")).setProjectile();
public static DamageSource shrapnel = (new DamageSource("shrapnel")).setProjectile();
public static DamageSource blackhole = (new DamageSource("blackhole")).setDamageIsAbsolute().setDamageBypassesArmor();
@ -62,13 +59,7 @@ public class ModDamageSource extends DamageSource {
public static final String s_boil = "boil";
public static final String s_acid = "acidPlayer";
public ModDamageSource(String p_i1566_1_) {
super(p_i1566_1_);
}
public static DamageSource causeBulletDamage(EntityBullet ent, Entity hit) {
return (new EntityDamageSourceIndirect(s_bullet, ent, hit)).setProjectile();
}
public ModDamageSource(String type) { super(type); }
public static DamageSource causeBulletDamage(Entity base, Entity ent) {
return (new EntityDamageSourceIndirect(s_bullet, base, ent)).setProjectile();
@ -94,20 +85,6 @@ public class ModDamageSource extends DamageSource {
return (new EntityDamageSourceIndirect(s_euthanized, ent, hit)).setDamageBypassesArmor();
}
public static boolean getIsBullet(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("revolverBullet");
}
return false;
}
public static boolean getIsEmplacer(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("chopperBullet");
}
return false;
}
public static boolean getIsTau(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("tau");
@ -115,20 +92,6 @@ public class ModDamageSource extends DamageSource {
return false;
}
public static boolean getIsPoison(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("euthanized");
}
return false;
}
public static boolean getIsCmb(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("cmb");
}
return false;
}
public static boolean getIsSubatomic(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
String s = ((EntityDamageSourceIndirect) source).damageType;
@ -136,40 +99,4 @@ public class ModDamageSource extends DamageSource {
}
return false;
}
public static boolean getIsDischarge(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("electrified");
}
return false;
}
public static boolean getIsFire(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("flamethrower");
}
return false;
}
public static boolean getIsPlasma(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("plasma");
}
return false;
}
public static boolean getIsLiquidNitrogen(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("ice");
}
return false;
}
public static boolean getIsLaser(DamageSource source) {
if(source instanceof EntityDamageSourceIndirect) {
return ((EntityDamageSourceIndirect) source).damageType.equals("laser");
}
return false;
}
}

View File

@ -796,6 +796,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModBlocks.rbmk_gauge, 1), new Object[] { "R", "C", "B", 'R', ModBlocks.radio_torch_receiver, 'B', ModBlocks.rbmk_display_blank, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE) });
addRecipeAuto(new ItemStack(ModBlocks.rbmk_numitron, 1), new Object[] { " R ", "CCC", " B ", 'R', ModBlocks.radio_torch_receiver, 'B', ModBlocks.rbmk_display_blank, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.NUMITRON) });
addRecipeAuto(new ItemStack(ModBlocks.rbmk_graph, 1), new Object[] { "R", "C", "B", 'R', ModBlocks.radio_torch_receiver, 'B', ModBlocks.rbmk_display_blank, 'C', ModItems.crt_display });
addRecipeAuto(new ItemStack(ModBlocks.rbmk_lever, 1), new Object[] { "R", "C", "B", 'R', ModBlocks.radio_torch_sender, 'B', ModBlocks.rbmk_display_blank, 'C', CU.ingot() });
addRecipeAuto(new ItemStack(ModBlocks.deco_rbmk, 8), new Object[] { "R", 'R', ModBlocks.rbmk_blank });
addRecipeAuto(new ItemStack(ModBlocks.deco_rbmk_smooth, 1), new Object[] { "R", 'R', ModBlocks.deco_rbmk });

View File

@ -904,9 +904,7 @@ public class ResourceManager {
public static final IModelCustom bolter = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/bolter.obj")).asVBO();
public static final IModelCustom detonator_laser = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/detonator_laser.obj")).asVBO();
public static final IModelCustom fireext = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/fireext.obj")).asVBO();
public static final IModelCustom ff_nightmare = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/nightmare.obj"));
public static final IModelCustom coilgun = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/coilgun.obj")).asVBO();
public static final IModelCustom cryocannon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/cryo_cannon.obj")).asVBO();
public static final IModelCustom pepperbox = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/pepperbox.obj")).asVBO();
public static final IModelCustom bio_revolver = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/bio_revolver.obj")).asVBO();
@ -1017,7 +1015,6 @@ public class ResourceManager {
public static final ResourceLocation chemthrower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/chemthrower.png");
public static final ResourceLocation m2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/m2_browning.png");
public static final ResourceLocation coilgun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/coilgun.png");
public static final ResourceLocation cryocannon_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/cryo_cannon.png");
public static final ResourceLocation congolake_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/congolake.png");
public static final ResourceLocation debug_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/debug_gun.png");

View File

@ -28,44 +28,43 @@ public class RenderRBMKLever extends TileEntitySpecialRenderer {
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
}
TileEntityRBMKLever keypad = (TileEntityRBMKLever) te;
TileEntityRBMKLever lever = (TileEntityRBMKLever) te;
for(int i = 0; i < 2; i++) {
LeverUnit key = keypad.levers[i];
if(!key.active) continue;
LeverUnit unit = lever.levers[i];
if(!unit.active) continue;
GL11.glPushMatrix();
GL11.glPushMatrix(); {
GL11.glTranslated(0.25, 0, i * -0.5 + 0.25);
GL11.glColor3f(1F, 1F, 1F);
this.bindTexture(ResourceManager.rbmk_lever_tex);
ResourceManager.rbmk_lever.renderPart("Base");
GL11.glPushMatrix();
GL11.glPushMatrix(); {
float progress = unit.prevFlipProgress + (unit.flipProgress - unit.prevFlipProgress) * interp;
GL11.glTranslated(0.125, 0.5625, 0);
GL11.glRotated(-180 * i, 0, 0, 1);
GL11.glRotated(-180 * progress, 0, 0, 1);
GL11.glTranslated(-0.125, -0.5625, 0);
ResourceManager.rbmk_lever.renderPart("Lever");
GL11.glPopMatrix();
} GL11.glPopMatrix();
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
int height = font.FONT_HEIGHT;
if(key.label != null && !key.label.isEmpty()) {
if(unit.label != null && !unit.label.isEmpty()) {
GL11.glTranslated(0.01, 0.3125, 0);
int width = font.getStringWidth(key.label);
GL11.glTranslated(0.01, 0.0625, 0);
int width = font.getStringWidth(unit.label);
float f3 = Math.min(0.0125F, 0.4F / Math.max(width, 1));
GL11.glScalef(f3, -f3, f3);
GL11.glNormal3f(0.0F, 0.0F, -1.0F);
GL11.glRotatef(90, 0, 1, 0);
RenderArcFurnace.fullbright(true);
font.drawString(key.label, - width / 2, - height / 2, 0x00ff00);
font.drawString(unit.label, - width / 2, - height / 2, 0x00ff00);
RenderArcFurnace.fullbright(false);
}
GL11.glPopMatrix();
} GL11.glPopMatrix();
}
GL11.glPopMatrix();

View File

@ -35,55 +35,39 @@ public class TileEntityRBMKLever extends TileEntityLoadedBase implements IGUIPro
public void updateEntity() {
if(!worldObj.isRemote) {
for(int i = 0; i < 2; i++) this.levers[i].update();
this.networkPackNT(50);
} else {
for(int i = 0; i < 2; i++) this.levers[i].updateClient();
}
}
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
for(int i = 0; i < 2; i++) this.levers[i].serialize(buf);
}
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
for(int i = 0; i < 2; i++) this.levers[i].deserialize(buf);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
for(int i = 0; i < 2; i++) this.levers[i].readFromNBT(nbt, i);
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
for(int i = 0; i < 2; i++) this.levers[i].writeToNBT(nbt, i);
}
@Override public void serialize(ByteBuf buf) { super.serialize(buf); for(int i = 0; i < 2; i++) this.levers[i].serialize(buf); }
@Override public void deserialize(ByteBuf buf) { super.deserialize(buf); for(int i = 0; i < 2; i++) this.levers[i].deserialize(buf); }
@Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); for(int i = 0; i < 2; i++) this.levers[i].readFromNBT(nbt, i); }
@Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); for(int i = 0; i < 2; i++) this.levers[i].writeToNBT(nbt, i); }
public class LeverUnit {
/** If the output should be per tick, allows the lever to lock in place */
public boolean polling;
/** If the lever is flipped, assuming polling is enabled */
public boolean isFlipped;
/** Label on the lever as rendered on the panel */
public String label = "";
/** What channel to send the command over */
public String rtty = "";
/** What to send when pressed */
public String command = "";
/** What to send when flipped */
public String commandOn = "";
/** What to send when not flipped */
public String commandOff = "";
/** Whether this lever is enabled and can be pressed */
public boolean active;
/** For non-polling levers, the time until the lever returns */
public int holdTimer;
/** If true, the lever tries to move down to the ON state, otherwise, tries to return to OFF */
public boolean isTurningOn = false;
public float flipProgress;
public float prevFlipProgress;
public float flipSync;
public int turnProgress;
public static final float FLIP_SPEED = 1F / 10F; // 0.5s
public LeverUnit(int initialIndex) {
label = "Lever " + (initialIndex + 1);
@ -92,70 +76,93 @@ public class TileEntityRBMKLever extends TileEntityLoadedBase implements IGUIPro
public void click() {
if(!active) return;
if(!polling) {
if(canSend()) RTTYSystem.broadcast(worldObj, rtty, command);
this.isFlipped = true;
this.holdTimer = 10;
} else {
this.isFlipped = !this.isFlipped;
this.isTurningOn = !isTurningOn;
TileEntityRBMKLever.this.markDirty();
}
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "random.click", 1F, this.isFlipped ? 1F : 0.75F);
}
public void update() {
if(!active) return;
if(polling && isFlipped) {
if(canSend()) RTTYSystem.broadcast(worldObj, rtty, command);
if(polling) {
if(this.flipProgress >= 1F && canSend(commandOn)) RTTYSystem.broadcast(worldObj, rtty, commandOn);
if(this.flipProgress <= 0F && canSend(commandOff)) RTTYSystem.broadcast(worldObj, rtty, commandOff);
}
if(!polling && isFlipped) {
if(this.holdTimer-- <= 0) {
this.isFlipped = false;
// turning on...
if(this.isTurningOn && this.flipProgress < 1F) {
this.flipProgress += FLIP_SPEED;
if(this.flipProgress >= 1F) {
this.flipProgress = 1F;
// for non-polling levers, send one message
if(!polling && canSend(commandOn)) RTTYSystem.broadcast(worldObj, rtty, commandOn);
}
// turning off...
} else if(!this.isTurningOn && this.flipProgress > 0F) {
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);
}
}
}
public boolean canSend() {
return rtty != null && !rtty.isEmpty() && command != null && !command.isEmpty();
public void updateClient() {
this.prevFlipProgress = this.flipProgress;
// approach-based interp
if(this.turnProgress > 0) {
this.flipProgress = this.flipProgress + ((this.flipSync - this.flipProgress) / (float) this.turnProgress);
--this.turnProgress;
} else {
this.flipProgress = this.flipSync;
}
}
public boolean canSend(String command) { return rtty != null && !rtty.isEmpty() && command != null && !command.isEmpty(); }
public void serialize(ByteBuf buf) {
buf.writeBoolean(active);
buf.writeBoolean(polling);
buf.writeBoolean(isFlipped);
buf.writeFloat(flipProgress);
BufferUtil.writeString(buf, label);
BufferUtil.writeString(buf, rtty);
BufferUtil.writeString(buf, command);
BufferUtil.writeString(buf, commandOn);
BufferUtil.writeString(buf, commandOff);
}
public void deserialize(ByteBuf buf) {
active = buf.readBoolean();
polling = buf.readBoolean();
isFlipped = buf.readBoolean();
flipSync = buf.readFloat();
label = BufferUtil.readString(buf);
rtty = BufferUtil.readString(buf);
command = BufferUtil.readString(buf);
commandOn = BufferUtil.readString(buf);
commandOff = BufferUtil.readString(buf);
turnProgress = 3; // three-ply for extra smoothness
}
public void readFromNBT(NBTTagCompound nbt, int index) {
this.active = nbt.getBoolean("active" + index);
this.polling = nbt.getBoolean("polling" + index);
this.isFlipped = nbt.getBoolean("isFlipped" + index);
this.isTurningOn = nbt.getBoolean("isTurningOn" + index);
this.flipProgress = nbt.getFloat("flipProgress" + index);
this.label = nbt.getString("label" + index);
this.rtty = nbt.getString("rtty" + index);
this.command = nbt.getString("command" + index);
this.commandOn = nbt.getString("commandOn" + index);
this.commandOff = nbt.getString("commandOff" + index);
}
public void writeToNBT(NBTTagCompound nbt, int index) {
nbt.setBoolean("active" + index, active);
nbt.setBoolean("polling" + index, polling);
nbt.setBoolean("isFlipped" + index, isFlipped);
nbt.setBoolean("isTurningOn" + index, isTurningOn);
nbt.setFloat("flipProgress" + index, flipProgress);
nbt.setString("label" + index, label);
nbt.setString("rtty" + index, rtty);
nbt.setString("command" + index, command);
nbt.setString("commandOn" + index, commandOn);
nbt.setString("commandOff" + index, commandOff);
}
}
@ -181,7 +188,10 @@ public class TileEntityRBMKLever extends TileEntityLoadedBase implements IGUIPro
LeverUnit lever = this.levers[i];
lever.label = data.getString("label" + i);
lever.rtty = data.getString("rtty" + i);
lever.command = data.getString("cmd" + i);
lever.commandOn = data.getString("cmdOn" + i);
lever.commandOff = data.getString("cmdOff" + i);
}
this.markDirty();
}
}

View File

@ -467,6 +467,7 @@ container.rbmkGauge=Redstone-over-Radio Meter
container.rbmkGraph=Redstone-over-Radio Graph
container.rbmkHeater=RBMK Heizer
container.rbmkKeyPad=Redstone-over-Radio Tastenfeld
container.rbmkLever=Redstone-over-Radio Hebel
container.rbmkNumitron=Redstone-over-Radio Ziffernanzeige
container.rbmkOutgasser=RBMK Bestrahlungskanal
container.rbmkReaSim=RBMK Brennstäbe (ReaSim)

View File

@ -875,6 +875,7 @@ container.rbmkGauge=Redstone-over-Radio Gauge
container.rbmkGraph=Redstone-over-Radio Graph
container.rbmkHeater=RBMK Fluid Heater
container.rbmkKeyPad=Redstone-over-Radio Keypad
container.rbmkLever=Redstone-over-Radio Lever
container.rbmkNumitron=Redstone-over-Radio Numeric Display
container.rbmkOutgasser=RBMK Irradiation Channel
container.rbmkReaSim=RBMK Fuel Rod (ReaSim)
@ -6168,6 +6169,8 @@ tile.rbmk_graph.desc=Can be configured with a screwdriver.$Logs and displays up
tile.rbmk_heater.name=RBMK Fluid Heater
tile.rbmk_key_pad.name=Redstone-over-Radio Keypad
tile.rbmk_key_pad.desc=Can be configured with a screwdriver.$Allows up to four different buttons which can$send RoR signals when pressed.
tile.rbmk_lever.name=Redstone-over-Radio Lever
tile.rbmk_lever.desc=Can be configured with a screwdriver.$Allows up to two levers which can send$RoR signals in either position.
tile.rbmk_loader.name=RBMK Steam Connector
tile.rbmk_loader.desc=Allows RBMKs to have both water and steam connections at the bottom$Place one water pipe below the RBMK column, then the connector,$then connect the steam duct to the connector.
tile.rbmk_moderator.name=RBMK Graphite Moderator

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: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB