mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
radar fixes
This commit is contained in:
parent
e01ce6676d
commit
e62955f667
@ -6,6 +6,7 @@
|
||||
* Capacity can be changed by right-clicking if the pipette is empty
|
||||
|
||||
## Changed
|
||||
* Updated russian localization
|
||||
* There is now a config option to disable the biome change caused by fallout. The config will also determine whether the biomes are registered at all, which prevents them from conflicting with other mods' biomes when disabled.
|
||||
* Chemical plants now have a timer that starts after loading/unloading fluids using item fluid containers from the input buffers, this creates a delay between switching from loading and unloading, making it possible to retrieve fluids using pipettes.
|
||||
* In addition to delaying overheats, efficiency upgrades now reduce the cyclotron's coolant demand
|
||||
@ -13,6 +14,7 @@
|
||||
* Meteorite swords now render their variant glint in first person view
|
||||
* Meteorite swords are now a lot larger, similar to most other NTM swords
|
||||
* Non-custom missile items now render in 3D
|
||||
* Combinator funnels can now be configured whether to only do 3x3, 2x2 or both recipe types
|
||||
|
||||
## Fixed
|
||||
* Fixed trenchmaster armor not doing most of the armor calculation, making it the worst armor
|
||||
@ -21,3 +23,5 @@
|
||||
* Fixed fallout being able to replace bedrock
|
||||
* Fixed the upgrade info of the large mining drill being incorrect
|
||||
* Fixed cyclotron not having the new upgrade info tooltip
|
||||
* Fixed the large radar not actually having a larger scan range
|
||||
* Fixed radar blips going out of bounds when using a radar screen with a large radar or a radar with a different config
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=4844
|
||||
mod_build_number=4845
|
||||
|
||||
credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
|
||||
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\
|
||||
|
||||
@ -4,15 +4,18 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerFunnel;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.NBTControlPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineFunnel;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIFunnel extends GuiContainer {
|
||||
public class GUIFunnel extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_funnel.png");
|
||||
private TileEntityMachineFunnel funnel;
|
||||
@ -24,6 +27,25 @@ public class GUIFunnel extends GuiContainer {
|
||||
this.xSize = 176;
|
||||
this.ySize = 168;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 159, guiTop + 73, 10, 10, mouseX, mouseY, "Mode: " + (funnel.mode == funnel.MODE_3x3 ? "3x3 only" : funnel.mode == funnel.MODE_2x2 ? "2x2 only" : "3x3 then 2x2"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(this.checkClick(x, y, 159, 73, 10, 10)) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("toggle", true);
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, funnel.xCoord, funnel.yCoord, funnel.zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
@ -38,5 +60,7 @@ public class GUIFunnel extends GuiContainer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
drawTexturedModalRect(guiLeft + 159, guiTop + 73, 176, funnel.mode * 10, 10, 10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.lib;
|
||||
public class RefStrings {
|
||||
public static final String MODID = "hbm";
|
||||
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
||||
public static final String VERSION = "1.0.27 BETA (4844)";
|
||||
public static final String VERSION = "1.0.27 BETA (4845)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -7,7 +7,6 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.gui.GUIMachineRadarNT;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadarScreen;
|
||||
|
||||
import api.hbm.entity.RadarEntry;
|
||||
@ -71,8 +70,8 @@ public class RenderRadarScreen extends TileEntitySpecialRenderer implements IIte
|
||||
|
||||
for(RadarEntry entry : screen.entries) {
|
||||
|
||||
double sX = (entry.posX - screen.refX) / ((double) TileEntityMachineRadarNT.radarRange + 1) * (0.875D);
|
||||
double sZ = (entry.posZ - screen.refZ) / ((double) TileEntityMachineRadarNT.radarRange + 1) * (0.875D);
|
||||
double sX = (entry.posX - screen.refX) / ((double) screen.range + 1) * (0.875D);
|
||||
double sZ = (entry.posZ - screen.refZ) / ((double) screen.range + 1) * (0.875D);
|
||||
double size = 0.0625D;
|
||||
tess.addVertexWithUV(0.38, 1 - sZ + size, 0.5 - sX + size, 216D / 256D, (entry.blipLevel * 8F + 8F) / 256F);
|
||||
tess.addVertexWithUV(0.38, 1 - sZ + size, 0.5 - sX - size, 224D / 256D, (entry.blipLevel * 8F + 8F) / 256F);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerFunnel;
|
||||
import com.hbm.inventory.gui.GUIFunnel;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
@ -8,6 +9,7 @@ import com.hbm.tileentity.machine.TileEntityMachineAutocrafter.InventoryCrafting
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@ -15,9 +17,15 @@ import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineFunnel extends TileEntityMachineBase implements IGUIProvider {
|
||||
public class TileEntityMachineFunnel extends TileEntityMachineBase implements IGUIProvider, IControlReceiver {
|
||||
|
||||
public int mode = 0;
|
||||
public static final int MODE_ALL = 0;
|
||||
public static final int MODE_3x3 = 1;
|
||||
public static final int MODE_2x2 = 2;
|
||||
|
||||
public TileEntityMachineFunnel() {
|
||||
super(18);
|
||||
@ -37,9 +45,9 @@ public class TileEntityMachineFunnel extends TileEntityMachineBase implements IG
|
||||
|
||||
if(slots[i] != null) {
|
||||
int stacksize = 9;
|
||||
ItemStack compressed = slots[i].stackSize < 9 ? null : this.getFrom9(slots[i]);
|
||||
ItemStack compressed = (mode == MODE_2x2 || slots[i].stackSize < 9) ? null : this.getFrom9(slots[i]);
|
||||
if(compressed == null) {
|
||||
compressed = slots[i].stackSize < 4 ? null : this.getFrom4(slots[i]);
|
||||
compressed = (mode == MODE_3x3 || slots[i].stackSize < 4) ? null : this.getFrom4(slots[i]);
|
||||
stacksize = 4;
|
||||
}
|
||||
|
||||
@ -54,8 +62,20 @@ public class TileEntityMachineFunnel extends TileEntityMachineBase implements IG
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.networkPackNT(15);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeInt(this.mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
this.mode = buf.readInt();
|
||||
}
|
||||
|
||||
public int[] topAccess = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||
public int[] bottomAccess = new int[] { 9, 10, 11, 12, 13, 14, 15, 16, 17 };
|
||||
@ -104,6 +124,18 @@ public class TileEntityMachineFunnel extends TileEntityMachineBase implements IG
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.mode = nbt.getInteger("mode");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("mode", mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
@ -115,4 +147,16 @@ public class TileEntityMachineFunnel extends TileEntityMachineBase implements IG
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIFunnel(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return this.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
this.mode++;
|
||||
if(mode > 2) mode = 0;
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,34 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMachineRadarLarge extends TileEntityMachineRadarNT {
|
||||
|
||||
public static int radarLargeRange = 3_000;
|
||||
|
||||
@Override
|
||||
public String getConfigName() {
|
||||
return "radar_large";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readIfPresent(JsonObject obj) {
|
||||
radarLargeRange = IConfigurableMachine.grab(obj, "I:radarLargeRange", radarLargeRange);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(JsonWriter writer) throws IOException {
|
||||
writer.name("I:radarLargeRange").value(radarLargeRange);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRange() {
|
||||
return radarLargeRange;
|
||||
|
||||
@ -81,7 +81,6 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
public static int maxPower = 100_000;
|
||||
public static int consumption = 500;
|
||||
public static int radarRange = 1_000;
|
||||
public static int radarLargeRange = 3_000;
|
||||
public static int radarBuffer = 30;
|
||||
public static int radarAltitude = 55;
|
||||
public static int chunkLoadCap = 10;
|
||||
@ -102,7 +101,6 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:powerCap", maxPower);
|
||||
consumption = IConfigurableMachine.grab(obj, "L:consumption", consumption);
|
||||
radarRange = IConfigurableMachine.grab(obj, "I:radarRange", radarRange);
|
||||
radarLargeRange = IConfigurableMachine.grab(obj, "I:radarLargeRange", radarLargeRange);
|
||||
radarBuffer = IConfigurableMachine.grab(obj, "I:radarBuffer", radarBuffer);
|
||||
radarAltitude = IConfigurableMachine.grab(obj, "I:radarAltitude", radarAltitude);
|
||||
chunkLoadCap = IConfigurableMachine.grab(obj, "I:chunkLoadCap", chunkLoadCap);
|
||||
@ -114,7 +112,6 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
writer.name("L:powerCap").value(maxPower);
|
||||
writer.name("L:consumption").value(consumption);
|
||||
writer.name("I:radarRange").value(radarRange);
|
||||
writer.name("I:radarLargeRange").value(radarLargeRange);
|
||||
writer.name("I:radarBuffer").value(radarBuffer);
|
||||
writer.name("I:radarAltitude").value(radarAltitude);
|
||||
writer.name("B:generateChunks").value(generateChunks);
|
||||
@ -207,6 +204,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
screen.refX = xCoord;
|
||||
screen.refY = yCoord;
|
||||
screen.refZ = zCoord;
|
||||
screen.range = this.getRange();
|
||||
screen.linked = true;
|
||||
}
|
||||
}
|
||||
@ -328,7 +326,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
if(this.power < consumption) return;
|
||||
this.power -= consumption;
|
||||
|
||||
int scan = this.scanRange();
|
||||
int scan = this.getRange();
|
||||
|
||||
RadarScanParams params = new RadarScanParams(this.scanMissiles, this.scanShells, this.scanPlayers, this.smartMode);
|
||||
|
||||
@ -394,10 +392,6 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected int scanRange() {
|
||||
return radarRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
|
||||
@ -21,6 +21,7 @@ public class TileEntityMachineRadarScreen extends TileEntity implements IBufPack
|
||||
public int refX;
|
||||
public int refY;
|
||||
public int refZ;
|
||||
public int range;
|
||||
public boolean linked;
|
||||
|
||||
@Override
|
||||
@ -43,6 +44,7 @@ public class TileEntityMachineRadarScreen extends TileEntity implements IBufPack
|
||||
buf.writeInt(refX);
|
||||
buf.writeInt(refY);
|
||||
buf.writeInt(refZ);
|
||||
buf.writeInt(range);
|
||||
buf.writeInt(entries.size());
|
||||
for(RadarEntry entry : entries) entry.toBytes(buf);
|
||||
}
|
||||
@ -53,6 +55,7 @@ public class TileEntityMachineRadarScreen extends TileEntity implements IBufPack
|
||||
refX = buf.readInt();
|
||||
refY = buf.readInt();
|
||||
refZ = buf.readInt();
|
||||
range = buf.readInt();
|
||||
int count = buf.readInt();
|
||||
this.entries.clear();
|
||||
for(int i = 0; i < count; i++) {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.5 KiB |
Loading…
x
Reference in New Issue
Block a user