mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge branch 'HbmMods:master' into master
This commit is contained in:
commit
2632b93980
83
src/main/java/com/hbm/entity/mob/EntityBurrowingBase.java
Normal file
83
src/main/java/com/hbm/entity/mob/EntityBurrowingBase.java
Normal file
@ -0,0 +1,83 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Base class for "digging" entities, removes things such as fall behavior, enables noClip and implements some basic movement code
|
||||
* @author hbm
|
||||
*/
|
||||
public abstract class EntityBurrowingBase extends EntityCreature {
|
||||
|
||||
protected float airDrag;
|
||||
protected float groundDrag;
|
||||
|
||||
public EntityBurrowingBase(World world) {
|
||||
super(world);
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Since most burrowing entities (such as worms, drills and whatnot) rotate along with their movement, center the eye height.
|
||||
* We can override this later on in case we have an "upright" burrowing entity.
|
||||
*/
|
||||
@Override
|
||||
public float getEyeHeight() {
|
||||
return this.height * 0.5F;
|
||||
}
|
||||
|
||||
/**
|
||||
* No fall and fallstate functions
|
||||
*/
|
||||
@Override
|
||||
protected void fall(float dist) { }
|
||||
@Override
|
||||
protected void updateFallState(double distFallen, boolean onGround) { }
|
||||
|
||||
/**
|
||||
* Calls moveFlying to add motion depending on our entity's rotation, then moves. Drag is applied depending on whether it is underground or airborne.
|
||||
* Called in onLivingUpdate TODO: figure out if strafe and forward are set by one of the superclasses or if this part is pointless
|
||||
*/
|
||||
@Override
|
||||
public void moveEntityWithHeading(float strafe, float forward) {
|
||||
|
||||
float drag = this.groundDrag;
|
||||
|
||||
if(!isEntityInsideOpaqueBlock() && !isInWater() && !handleLavaMovement()) {
|
||||
drag = this.airDrag;
|
||||
}
|
||||
|
||||
//misnomer, actually just sets the motion, the moving part happens the line after that
|
||||
moveFlying(strafe, forward, 0.02F);
|
||||
moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
|
||||
this.motionX *= drag;
|
||||
this.motionY *= drag;
|
||||
this.motionZ *= drag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorry, can't use ladders.
|
||||
*/
|
||||
@Override
|
||||
public boolean isOnLadder() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the mob supports the movement behavior through air
|
||||
* @return true if the entity can fly and false if it can only move through ground.
|
||||
*/
|
||||
public boolean canFly() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the entity can freely dig up and down or if gravity should be applied instead.
|
||||
* Some entities might not be able to course-correct when airborne, such as small non-worm entities.
|
||||
* @return true if vertical movement can be performed and false if gravity should apply.
|
||||
*/
|
||||
protected boolean canSupportMovement() {
|
||||
return isEntityInsideOpaqueBlock() || canFly();
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.hbm.entity.mob.botprime;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Deprecated
|
||||
public abstract class EntityBurrowingNT extends EntityCreature {
|
||||
|
||||
protected float dragInAir;
|
||||
|
||||
@ -1732,6 +1732,8 @@ public class GUIHandler implements IGuiHandler {
|
||||
return new GUIScreenGuide(player);
|
||||
case ModItems.guiID_item_bobble:
|
||||
return new GUIScreenBobble((TileEntityBobble) world.getTileEntity(x, y, z));
|
||||
case ModItems.guiID_item_holo_image:
|
||||
return new GUIScreenHolotape();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -102,16 +102,16 @@ public class GUIMachineRadar extends GuiInfoContainer {
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
drawTexturedModalRect(guiLeft - 14, guiTop + 94, 216, 198, 14, 46);
|
||||
|
||||
if(diFurnace.scanMissiles)
|
||||
if(diFurnace.scanMissiles || (diFurnace.jammed && diFurnace.getWorldObj().rand.nextBoolean()))
|
||||
drawTexturedModalRect(guiLeft - 10, guiTop + 98, 230, 202, 8, 8);
|
||||
|
||||
if(diFurnace.scanPlayers)
|
||||
if(diFurnace.scanPlayers || (diFurnace.jammed && diFurnace.getWorldObj().rand.nextBoolean()))
|
||||
drawTexturedModalRect(guiLeft - 10, guiTop + 108, 230, 212, 8, 8);
|
||||
|
||||
if(diFurnace.smartMode)
|
||||
if(diFurnace.smartMode || (diFurnace.jammed && diFurnace.getWorldObj().rand.nextBoolean()))
|
||||
drawTexturedModalRect(guiLeft - 10, guiTop + 118, 230, 222, 8, 8);
|
||||
|
||||
if(diFurnace.redMode)
|
||||
if(diFurnace.redMode || (diFurnace.jammed && diFurnace.getWorldObj().rand.nextBoolean()))
|
||||
drawTexturedModalRect(guiLeft - 10, guiTop + 128, 230, 232, 8, 8);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
@ -119,6 +119,17 @@ public class GUIMachineRadar extends GuiInfoContainer {
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 221, 0, 234, i, 16);
|
||||
}
|
||||
|
||||
if(diFurnace.jammed) {
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
for(int j = 0; j < 5; j++) {
|
||||
drawTexturedModalRect(guiLeft + 8 + i * 40, guiTop + 17 + j * 40, 216, 118 + diFurnace.getWorldObj().rand.nextInt(41), 40, 40);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(!diFurnace.nearbyMissiles.isEmpty()) {
|
||||
for(int[] m : diFurnace.nearbyMissiles) {
|
||||
int x = (int)((m[0] - diFurnace.xCoord) / ((double)WeaponConfig.radarRange * 2 + 1) * (200D - 8D)) - 4;
|
||||
|
||||
@ -37,8 +37,6 @@ public class GUIScreenGuide extends GuiScreen {
|
||||
|
||||
type = BookType.getType(player.getHeldItem().getItemDamage());
|
||||
|
||||
System.out.println(type.toString());
|
||||
|
||||
page = -1;
|
||||
maxPage = (int)Math.ceil(type.pages.size() / 2D) - 1;
|
||||
|
||||
|
||||
96
src/main/java/com/hbm/inventory/gui/GUIScreenHolotape.java
Normal file
96
src/main/java/com/hbm/inventory/gui/GUIScreenHolotape.java
Normal file
@ -0,0 +1,96 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemHolotapeImage.EnumHoloImage;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIScreenHolotape extends GuiScreen {
|
||||
|
||||
EnumHoloImage holo;
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:block.bobble"), 1.0F));
|
||||
|
||||
ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem();
|
||||
|
||||
if(stack != null && stack.getItem() == ModItems.holotape_image) {
|
||||
this.holo = EnumUtil.grabEnumSafely(EnumHoloImage.class, stack.getItemDamage());
|
||||
} else {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
|
||||
if(this.holo == null)
|
||||
return;
|
||||
|
||||
this.drawDefaultBackground();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
double sizeX = 300;
|
||||
double sizeY = 150;
|
||||
double left = (this.width - sizeX) / 2;
|
||||
double top = (this.height - sizeY) / 2;
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.startDrawingQuads();
|
||||
tess.setColorRGBA_F(0F, 0.2F, 0F, 0.8F);
|
||||
tess.addVertex(left + sizeX, top, this.zLevel);
|
||||
tess.addVertex(left, top, this.zLevel);
|
||||
tess.addVertex(left, top + sizeY, this.zLevel);
|
||||
tess.addVertex(left + sizeX, top + sizeY, this.zLevel);
|
||||
tess.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
int nextLevel = (int)top + 30;
|
||||
|
||||
if(this.holo.getText() != null) {
|
||||
|
||||
List<String> lines = I18nUtil.autoBreak(this.fontRendererObj, this.holo.getText(), 275);
|
||||
|
||||
for(String text : lines) {
|
||||
this.fontRendererObj.drawStringWithShadow(text, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(text) / 2), nextLevel, 0x009900);
|
||||
nextLevel += 10;
|
||||
}
|
||||
|
||||
nextLevel += 10;
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int key) {
|
||||
if(key == 1 || key == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -2343,6 +2343,7 @@ public class ModItems {
|
||||
public static Item record_glass;
|
||||
|
||||
public static Item book_guide;
|
||||
public static Item holotape_image;
|
||||
|
||||
public static Item polaroid;
|
||||
public static Item glitch;
|
||||
@ -2478,6 +2479,7 @@ public class ModItems {
|
||||
public static final int guiID_item_book = 10105;
|
||||
public static final int guiID_item_guide = 10106;
|
||||
public static final int guiID_item_bobble = 10107;
|
||||
public static final int guiID_item_holo_image = 10108;
|
||||
|
||||
public static Item mysteryshovel;
|
||||
public static Item memory;
|
||||
@ -5339,6 +5341,7 @@ public class ModItems {
|
||||
record_glass = new ItemModRecord("glass").setUnlocalizedName("record_glass").setCreativeTab(null).setTextureName(RefStrings.MODID + ":record_glass");
|
||||
|
||||
book_guide = new ItemGuideBook().setUnlocalizedName("book_guide").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":book_guide");
|
||||
holotape_image = new ItemHolotapeImage().setUnlocalizedName("holotape_image").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":holotape");
|
||||
|
||||
polaroid = new ItemPolaroid().setUnlocalizedName("polaroid").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":polaroid_" + MainRegistry.polaroidID);
|
||||
glitch = new ItemGlitch().setUnlocalizedName("glitch").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":glitch_" + MainRegistry.polaroidID);
|
||||
@ -7819,6 +7822,7 @@ public class ModItems {
|
||||
|
||||
//wow we're far down the item registry, is this the cellar?
|
||||
GameRegistry.registerItem(book_guide, book_guide.getUnlocalizedName());
|
||||
GameRegistry.registerItem(holotape_image, holotape_image.getUnlocalizedName());
|
||||
|
||||
//Technical Items
|
||||
GameRegistry.registerItem(smoke1, smoke1.getUnlocalizedName());
|
||||
|
||||
10
src/main/java/com/hbm/items/special/ItemHoloTape.java
Normal file
10
src/main/java/com/hbm/items/special/ItemHoloTape.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import com.hbm.items.ItemEnumMulti;
|
||||
|
||||
public class ItemHoloTape extends ItemEnumMulti {
|
||||
|
||||
public ItemHoloTape(Class<? extends Enum> theEnum, boolean multiName, boolean multiTexture) {
|
||||
super(theEnum, multiName, multiTexture);
|
||||
}
|
||||
}
|
||||
67
src/main/java/com/hbm/items/special/ItemHolotapeImage.java
Normal file
67
src/main/java/com/hbm/items/special/ItemHolotapeImage.java
Normal file
@ -0,0 +1,67 @@
|
||||
package com.hbm.items.special;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemHolotapeImage extends ItemHoloTape {
|
||||
|
||||
public ItemHolotapeImage() {
|
||||
super(EnumHoloImage.class, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(world.isRemote) player.openGui(MainRegistry.instance, ModItems.guiID_item_holo_image, world, 0, 0, 0);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
EnumHoloImage holo = EnumUtil.grabEnumSafely(EnumHoloImage.class, stack.getItemDamage());
|
||||
list.add("Band Color: " + holo.colorCode + holo.colorName);
|
||||
list.add("Label: " + holo.name);
|
||||
}
|
||||
|
||||
public static enum EnumHoloImage {
|
||||
HOLO_DIGAMMA( EnumChatFormatting.RED, "Crimson", "D#", "The tape contains a music track that has degraded heavily in quality, making it near-impossible to make out what it once was. There is an image file on it that has also lost its quality, being reduced to a blur of crimson and cream colors. The disk has small shreds of greasy wrapping paper stuck to it."),
|
||||
HOLO_RESTORED( EnumChatFormatting.RED, "Crimson", "D0", "The tape contains a music track that you do not recognize, consisting of mostly electric guitars with lyrics telling the story of a man being left by someone who is moving to another city. The tape also contains an image file, the crimson and cream colors sharp on an otherwise colorless background. You try to look closer but you can't. It feels as if reality itself is twisted and stretched and snapped back into shape like a rubber band."),
|
||||
HOLO_FE_HALL( EnumChatFormatting.GREEN, "Lime", "001-HALL" , "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a small hall with a fountain in the center, a metal door to the left and an open wooden door to the right, with faint green light coming through the doorway. On the left wall of the room, there is a wooden bench with a skeleton sitting on it."),
|
||||
HOLO_FE_CORRIDOR( EnumChatFormatting.GREEN, "Lime", "002-CORRIDOR", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a short hallway with a terminal screen mounted to the right wall, bathing the corridor in a phosphorus-green light. In front of the terminal, an unusually large skeleton is piled up on the floor. On the back of the hallway there's a sturdy metal door standing open."),
|
||||
HOLO_FE_SERVER( EnumChatFormatting.GREEN, "Lime", "003-SERVER", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting what appears to be a server room with racks covering every wall. In the center, what appears to be some sort of super computer is standing tall, with wires coming out from it, going in every direction. On the right side of the room, a small brass trapdoor stands open where one of the wall racks would be."),
|
||||
HOLO_FEH_DOME( EnumChatFormatting.RED, "Red", "011-DOME", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting the insides of a large dome-like concrete structure that is mostly empty, save for a few catwalks and a shiny blueish metal capsule suspended in the center. In the background, the faint outline of what appears to be a tank is visible, sporting mechanical legs instead of treads."),
|
||||
HOLO_FEH_BOAT( EnumChatFormatting.RED, "Red", "012-BOAT", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting the wooden deck of what appears to be an old river boat. There are four rusted railway spikes stuck in the planks in a roughly square shape."),
|
||||
HOLO_FEH_LSC( EnumChatFormatting.RED, "Red", "013-LAUNCH", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting an array of launch pads surrounded by large metal bulwarks. Two of the launch pads are empty, the remaining rockets seem to be heavily damaged. A tipped-over booster is visible, creating plumes of fog."),
|
||||
HOLO_F3_RC( EnumChatFormatting.DARK_GREEN, "Green", "021-RIVET", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting an old aircraft carrier that has broken in two. A makeshift bridge held up by the ship's crane connects the tower with a small building on the shore."),
|
||||
HOLO_F3_IV( EnumChatFormatting.DARK_GREEN, "Green", "022-V87", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is a very grainy image file on it, depicting what appears to be a crater with a small tunnel leading into the ground at the very bottom, closed off with a small wooden door."),
|
||||
HOLO_F3_WM( EnumChatFormatting.DARK_GREEN, "Green", "023-MONUMENT", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a large white obelisk that seems half destroyed. At the top there is a radio dish sticking out of the structure."),
|
||||
HOLO_NV_CRATER( EnumChatFormatting.GOLD, "Brown", "031-MOUNTAIN", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a large dome in blue light surrounded by many smaller buildings. In the distance, there is a smaller dome with red lights."),
|
||||
HOLO_NV_DIVIDE( EnumChatFormatting.GOLD, "Brown", "032-ROAD", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a large chasm with broken highways and destroyed buildings littering the landscape."),
|
||||
HOLO_NV_BM( EnumChatFormatting.GOLD, "Brown", "033-BROADCAST", "The tape contains an audio track that is mostly gabled sound and garbage noise. There is an image file on it, depicting a satellite broadcasting station on top of a hill. In the distance, there is a very large person walking hand in hand with a robot into the sunset."),
|
||||
;
|
||||
|
||||
private String name;
|
||||
private String text;
|
||||
private String colorName;
|
||||
private EnumChatFormatting colorCode;
|
||||
|
||||
private EnumHoloImage(EnumChatFormatting colorCode, String colorName, String name, String text) {
|
||||
this.name = name;
|
||||
this.text = text;
|
||||
this.colorName = colorName;
|
||||
this.colorCode = colorCode;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -76,7 +76,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
} else {
|
||||
tanks[1].setTankType((FluidType) outs[0]);
|
||||
|
||||
int processMax = (int) Math.ceil(Math.ceil(tanks[0].getFill() / 10F) / (Integer)outs[2]); //the maximum amount of cycles based on the 10% cap
|
||||
int processMax = (int) Math.ceil(Math.ceil(tanks[0].getFill() / 5F) / (Integer)outs[2]); //the maximum amount of cycles based on the 20% cap
|
||||
int processSteam = tanks[0].getFill() / (Integer)outs[2]; //the maximum amount of cycles depending on steam
|
||||
int processWater = (tanks[1].getMaxFill() - tanks[1].getFill()) / (Integer)outs[1]; //the maximum amount of cycles depending on water
|
||||
|
||||
@ -85,7 +85,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
tanks[0].setFill(tanks[0].getFill() - (Integer)outs[2] * cycles);
|
||||
tanks[1].setFill(tanks[1].getFill() + (Integer)outs[1] * cycles);
|
||||
|
||||
power += (Integer)outs[3] * cycles;
|
||||
power += ((Integer)outs[3] * cycles) * 1.25; //yields a 25% power conversion bonus
|
||||
|
||||
if(power > maxPower)
|
||||
power = maxPower;
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.WeaponConfig;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.interfaces.Untested;
|
||||
import com.hbm.tileentity.TileEntityTickingBase;
|
||||
|
||||
@ -14,6 +15,7 @@ import api.hbm.entity.IRadarDetectable.RadarTargetType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -31,6 +33,8 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements IEn
|
||||
public boolean scanPlayers = true;
|
||||
public boolean smartMode = true;
|
||||
public boolean redMode = true;
|
||||
|
||||
public boolean jammed = false;
|
||||
|
||||
public float prevRotation;
|
||||
public float rotation;
|
||||
@ -109,6 +113,7 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements IEn
|
||||
|
||||
nearbyMissiles.clear();
|
||||
entList.clear();
|
||||
jammed = false;
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord + 0.5 - WeaponConfig.radarRange, 0, zCoord + 0.5 - WeaponConfig.radarRange, xCoord + 0.5 + WeaponConfig.radarRange, 5000, zCoord + 0.5 + WeaponConfig.radarRange));
|
||||
|
||||
@ -116,6 +121,13 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements IEn
|
||||
|
||||
if(e.posY < yCoord + WeaponConfig.radarBuffer)
|
||||
continue;
|
||||
|
||||
if(e instanceof EntityLivingBase && HbmLivingProps.getDigamma((EntityLivingBase) e) > 0.001) {
|
||||
this.jammed = true;
|
||||
nearbyMissiles.clear();
|
||||
entList.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
if(e instanceof EntityPlayer && this.scanPlayers) {
|
||||
nearbyMissiles.add(new int[] { (int)e.posX, (int)e.posZ, RadarTargetType.PLAYER.ordinal(), (int)e.posY });
|
||||
@ -181,6 +193,7 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements IEn
|
||||
data.setBoolean("scanPlayers", scanPlayers);
|
||||
data.setBoolean("smartMode", smartMode);
|
||||
data.setBoolean("redMode", redMode);
|
||||
data.setBoolean("jammed", jammed);
|
||||
data.setInteger("count", this.nearbyMissiles.size());
|
||||
|
||||
for(int i = 0; i < this.nearbyMissiles.size(); i++) {
|
||||
@ -201,6 +214,7 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements IEn
|
||||
this.scanPlayers = data.getBoolean("scanPlayers");
|
||||
this.smartMode = data.getBoolean("smartMode");
|
||||
this.redMode = data.getBoolean("redMode");
|
||||
this.jammed = data.getBoolean("jammed");
|
||||
|
||||
int count = data.getInteger("count");
|
||||
|
||||
|
||||
@ -1,14 +1,87 @@
|
||||
package com.hbm.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
|
||||
public class I18nUtil {
|
||||
|
||||
/**
|
||||
* Simple wrapper for I18n, for consistency
|
||||
* @param s
|
||||
* @param args
|
||||
* @return
|
||||
*/
|
||||
public static String resolveKey(String s, Object... args) {
|
||||
return I18n.format(s, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for I18n but cuts up the result using NTM's line break character ($)
|
||||
* @param s
|
||||
* @param args
|
||||
* @return
|
||||
*/
|
||||
public static String[] resolveKeyArray(String s, Object... args) {
|
||||
return resolveKey(s, args).split("\\$");
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as autoBreak, but it also respects NTM's break character ($) for manual line breaking in addition to the automatic ones
|
||||
* @param fontRenderer
|
||||
* @param text
|
||||
* @param width
|
||||
* @return
|
||||
*/
|
||||
public static List<String> autoBreakWithParagraphs(FontRenderer fontRenderer, String text, int width) {
|
||||
|
||||
String[] paragraphs = text.split("\\$");
|
||||
List<String> lines = new ArrayList();
|
||||
|
||||
for(String paragraph : paragraphs) {
|
||||
lines.addAll(autoBreak(fontRenderer, paragraph, width));
|
||||
}
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns one string into a list of strings, cutting sentences up to fit within the defined width if they were rendered in a GUI
|
||||
* @param fontRenderer
|
||||
* @param text
|
||||
* @param width
|
||||
* @return
|
||||
*/
|
||||
public static List<String> autoBreak(FontRenderer fontRenderer, String text, int width) {
|
||||
|
||||
List<String> lines = new ArrayList();
|
||||
//split the text by all spaces
|
||||
String[] words = text.split(" ");
|
||||
|
||||
//add the first word to the first line, no matter what
|
||||
lines.add(words[0]);
|
||||
//starting indent is the width of the first word
|
||||
int indent = fontRenderer.getStringWidth(words[0]);
|
||||
|
||||
for(int w = 1; w < words.length; w++) {
|
||||
|
||||
//increment the indent by the width of the next word + leading space
|
||||
indent += fontRenderer.getStringWidth(" " + words[w]);
|
||||
|
||||
//if the indent is within bounds
|
||||
if(indent <= width) {
|
||||
//add the next word to the last line (i.e. the one in question)
|
||||
String last = lines.get(lines.size() - 1);
|
||||
lines.set(lines.size() - 1, last += (" " + words[w]));
|
||||
} else {
|
||||
//otherwise, start a new line and reset the indent
|
||||
lines.add(words[w]);
|
||||
indent = fontRenderer.getStringWidth(words[w]);
|
||||
}
|
||||
}
|
||||
|
||||
return lines;
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,23 +152,23 @@ book.test.page1=Test Page 1
|
||||
|
||||
book.error.cover=Hadron Collider:$Troubleshooting
|
||||
book.error.title1=Error 0x01 [NC]
|
||||
book.error.page1=§Name:§r "ERROR_NO_CHARGE" §lDescription:§r The particle has reached a segment with insufficient charge. §Potential fix:§r Either replace one of the plugs that the particle successfully passes with higher-tier ones or add another plug slightly before the segment where the particle expires.
|
||||
book.error.page1=§lName:§r "ERROR_NO_CHARGE" §lDescription:§r The particle has reached a segment with insufficient charge. §lPotential fix:§r Either replace one of the plugs that the particle successfully passes with higher-tier ones or add another plug slightly before the segment where the particle expires.
|
||||
book.error.title2=Error 0x02 [NA]
|
||||
book.error.page2=§Name:§r "ERROR_NO_ANALYSIS" §lDescription:§r The particle has reached the core, despite not passing an analysis chamber. §Potential fix:§r Make sure that your accelerator has an analysis chamber and double-check the operating mode (linear/circular).
|
||||
book.error.page2=§lName:§r "ERROR_NO_ANALYSIS" §lDescription:§r The particle has reached the core, despite not passing an analysis chamber. §lPotential fix:§r Make sure that your accelerator has an analysis chamber and double-check the operating mode (linear/circular).
|
||||
book.error.title3=Error 0x03 [OC]
|
||||
book.error.page3=§Name:§r "ERROR_OBSTRUCTED_CHANNEL" §lDescription:§r The particle has collided with a block inside the collider's channel. §Potential fix:§r Make sure that the inside of your particle collider is free of any obstructions, except for particle diodes and core blocks.
|
||||
book.error.page3=§lName:§r "ERROR_OBSTRUCTED_CHANNEL" §lDescription:§r The particle has collided with a block inside the collider's channel. §lPotential fix:§r Make sure that the inside of your particle collider is free of any obstructions, except for particle diodes and core blocks.
|
||||
book.error.title4=Error 0x04 [EC]
|
||||
book.error.page4=§Name:§r "ERROR_EXPECTED_COIL" §lDescription:§r The particle has passed a segment that lacks one or multiple coils. §Potential fix:§r Remove the plating of the collider in the offending area and check if all the coils are there. This error will also happen at T-crossings that are built without diodes.
|
||||
book.error.page4=§lName:§r "ERROR_EXPECTED_COIL" §lDescription:§r The particle has passed a segment that lacks one or multiple coils. §lPotential fix:§r Remove the plating of the collider in the offending area and check if all the coils are there. This error will also happen at T-crossings that are built without diodes.
|
||||
book.error.title5=Error 0x05 [MS]
|
||||
book.error.page5=§Name:§r "ERROR_MALFORMED_SEGMENT" §lDescription:§r The particle has passed a segment that was built incorrectly (but neither obstructed nor missing coils). §Potential fix:§r Make sure that the offending segment has platings in all the required spaces, leaving no coils exposed.
|
||||
book.error.page5=§lName:§r "ERROR_MALFORMED_SEGMENT" §lDescription:§r The particle has passed a segment that was built incorrectly (but neither obstructed nor missing coils). §lPotential fix:§r Make sure that the offending segment has platings in all the required spaces, leaving no coils exposed.
|
||||
book.error.title6=Error 0x06 [ATL]
|
||||
book.error.page6=§Name:§r "ERROR_ANALYSIS_TOO_LONG" §lDescription:§r The particle has passed more than the three required valid analysis chamber segments. §Potential fix:§r Make sure that the analysis chamber is exactly 3 blocks long for circular accelerator and at least 2 blocks long for linear ones. Also check if the particle doesn't pass multiple analysis chambers in a branching and/or looped accelerator.
|
||||
book.error.page6=§lName:§r "ERROR_ANALYSIS_TOO_LONG" §lDescription:§r The particle has passed more than the three required valid analysis chamber segments. §lPotential fix:§r Make sure that the analysis chamber is exactly 3 blocks long for circular accelerator and at least 2 blocks long for linear ones. Also check if the particle doesn't pass multiple analysis chambers in a branching and/or looped accelerator.
|
||||
book.error.title7=Error 0x07 [ATS]
|
||||
book.error.page7=§Name:§r "ERROR_ANALYSIS_TOO_SHORT" §lDescription:§r The particle has left the analysis chamber, despite not meeting the length requirement. §Potential fix:§r Make sure that the analysis chamber on your circular accelerator is exactly 3 blocks long. Valid analysis segments have no coils and the plating is entirely composed of analysis chamber walls/windows. Analysis chambers with coils in them count as regular segments.
|
||||
book.error.page7=§lName:§r "ERROR_ANALYSIS_TOO_SHORT" §lDescription:§r The particle has left the analysis chamber, despite not meeting the length requirement. §lPotential fix:§r Make sure that the analysis chamber on your circular accelerator is exactly 3 blocks long. Valid analysis segments have no coils and the plating is entirely composed of analysis chamber walls/windows. Analysis chambers with coils in them count as regular segments.
|
||||
book.error.title8=Error 0x08 [DC]
|
||||
book.error.page8=§Name:§r "ERROR_DIODE_COLLISION" §lDescription:§r The particle collided with a non-input side of a schottky particle diode. §Potential fix:§r Check if your diodes are configured correctly. Particles can only enter the diode from sides with green inward-pointing arrows.
|
||||
book.error.page8=§lName:§r "ERROR_DIODE_COLLISION" §lDescription:§r The particle collided with a non-input side of a schottky particle diode. §lPotential fix:§r Check if your diodes are configured correctly. Particles can only enter the diode from sides with green inward-pointing arrows.
|
||||
book.error.title9=Error 0x09 [BT]
|
||||
book.error.page9=§Name:§r "ERROR_BRANCHING_TURN" §lDescription:§r The particle has reached a turn with multiple exits. §Potential fix:§r If your turn is a normal one, check if all the required coils are present (i.e. no holes in the coil layer). If the turn is intended to be branched, it requires a schottky particle diode that is correctly configured.
|
||||
book.error.page9=§lName:§r "ERROR_BRANCHING_TURN" §lDescription:§r The particle has reached a turn with multiple exits. §lPotential fix:§r If your turn is a normal one, check if all the required coils are present (i.e. no holes in the coil layer). If the turn is intended to be branched, it requires a schottky particle diode that is correctly configured.
|
||||
|
||||
book.rbmk.cover=My first RBMK:$Basics of$building a$reactor
|
||||
book.rbmk.title1=Introduction
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 12 KiB |
Loading…
x
Reference in New Issue
Block a user