mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 17:45:08 +00:00
Compare commits
19
Commits
2.10.26
...
2.9.10-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cd91b0112 | ||
|
|
29f8752c98 | ||
|
|
41657d44b1 | ||
|
|
4d2ace0d3f | ||
|
|
38845890c1 | ||
|
|
be92550e42 | ||
|
|
6e5087dac1 | ||
|
|
a12e5f37ba | ||
|
|
d023c347cb | ||
|
|
56a642cebf | ||
|
|
68bc2116b4 | ||
|
|
3e72fe00ac | ||
|
|
efbe0ba259 | ||
|
|
0ef9ce80ea | ||
|
|
bc7975f26c | ||
|
|
b3acdd8f35 | ||
|
|
559c64e82c | ||
|
|
2fe6acc762 | ||
|
|
80c83d3fce |
No files matched your search
+4
-4
@@ -3,8 +3,8 @@
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.7:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.38-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.20:dev")
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.40-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.21:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.42:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
shadowImplementation('cglib:cglib-nodep:3.3.0')
|
||||
@@ -13,9 +13,9 @@ dependencies {
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.4:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-586-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.254:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.256:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.2.7-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.21:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.23:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.0-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.16.2-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.13-GTNH:api') {transitive = false}
|
||||
|
||||
@@ -74,7 +74,6 @@ public final class Config {
|
||||
public static final Section sectionMobConfig = new Section("Mob Config", "mobconfig");
|
||||
public static final Section sectionRailConfig = new Section("Rail", "railconfig");
|
||||
public static final Section sectionEnchantments = new Section("Enchantments", "enchantments");
|
||||
public static final Section sectionWeather = new Section("Weather", "weather");
|
||||
public static final Section sectionTelepad = new Section("Telepad", "telepad");
|
||||
public static final Section sectionInventoryPanel = new Section("InventoryPanel", "inventorypanel");
|
||||
public static final Section sectionMisc = new Section("Misc", "misc");
|
||||
@@ -544,10 +543,6 @@ public final class Config {
|
||||
public static boolean spawnGuardStopAllSlimesDebug = false;
|
||||
public static boolean spawnGuardStopAllSquidSpawning = false;
|
||||
|
||||
public static int weatherObeliskClearFluid = 2000;
|
||||
public static int weatherObeliskRainFluid = 500;
|
||||
public static int weatherObeliskThunderFluid = 1000;
|
||||
|
||||
// Loot Defaults
|
||||
public static boolean lootDarkSteel = true;
|
||||
public static boolean lootItemConduitProbe = true;
|
||||
@@ -600,6 +595,8 @@ public final class Config {
|
||||
|
||||
public static boolean strictTPItemChecking = true;
|
||||
|
||||
public static float fusedQuartzExplosionResistance = 2000.0f;
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
@@ -2746,22 +2743,6 @@ public final class Config {
|
||||
spawnGuardStopAllSquidSpawning,
|
||||
"When true no squid will be spawned.");
|
||||
|
||||
weatherObeliskClearFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskClearFluid",
|
||||
weatherObeliskClearFluid,
|
||||
"The fluid required (in mB) to set the world to clear weather").getInt();
|
||||
weatherObeliskRainFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskRainFluid",
|
||||
weatherObeliskRainFluid,
|
||||
"The fluid required (in mB) to set the world to rainy weather").getInt();
|
||||
weatherObeliskThunderFluid = config.get(
|
||||
sectionWeather.name,
|
||||
"weatherObeliskThunderFluid",
|
||||
weatherObeliskThunderFluid,
|
||||
"The fluid required (in mB) to set the world to thundering weather").getInt();
|
||||
|
||||
// Loot Config
|
||||
lootDarkSteel = config.getBoolean(
|
||||
"lootDarkSteel",
|
||||
@@ -2990,6 +2971,13 @@ public final class Config {
|
||||
strictTPItemChecking,
|
||||
"If true, turn on strict checking of item energy checking. This might cause traveling tools from third party mods to fire fake security warnings on server side and not function correctly.")
|
||||
.getBoolean(strictTPItemChecking);
|
||||
fusedQuartzExplosionResistance = config.getFloat(
|
||||
"fusedQuartzExplosionResistance",
|
||||
sectionMisc.name,
|
||||
2000.0f,
|
||||
0.0f,
|
||||
Float.MAX_VALUE,
|
||||
"How blast resistant the three Fused Quartz blocks should be.");
|
||||
}
|
||||
|
||||
public static void checkYetaAccess() {
|
||||
|
||||
@@ -31,6 +31,11 @@ public class BlockWeatherObelisk extends BlockObeliskAbstract<TileWeatherObelisk
|
||||
Side.CLIENT);
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketWeatherTank.class, PacketWeatherTank.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketControlModeWeather.class,
|
||||
PacketControlModeWeather.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.SERVER);
|
||||
|
||||
EntityRegistry
|
||||
.registerModEntity(EntityWeatherRocket.class, "weather_rocket", 33, EnderIO.instance, 64, 3, false);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraftforge.fluids.FluidTank;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
|
||||
@@ -24,6 +25,7 @@ import crazypants.enderio.network.PacketHandler;
|
||||
public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk> {
|
||||
|
||||
private IconButton buttonStart;
|
||||
private ToggleButton buttonMode;
|
||||
|
||||
public GuiWeatherObelisk(InventoryPlayer inventory, TileWeatherObelisk tileEntity) {
|
||||
super(tileEntity, new ContainerWeatherObelisk(inventory, tileEntity), "weatherObelisk");
|
||||
@@ -50,10 +52,23 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk>
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
int x = (xSize / 2) - (BUTTON_SIZE / 2);
|
||||
int x_mode = xSize - 5 - BUTTON_SIZE;
|
||||
int x_start = (xSize / 2) - (BUTTON_SIZE / 2);
|
||||
int y = 58;
|
||||
|
||||
addButton(buttonStart = new IconButton(this, 0, x, y, IconEIO.TICK));
|
||||
buttonMode = new ToggleButton(this, 1, x_mode, y, IconEIO.ROUND_ROBIN_OFF, IconEIO.REDSTONE_MODE_WITH_SIGNAL);
|
||||
|
||||
buttonMode.setToolTip(EnderIO.lang.localize("gui.machine.weather.control"));
|
||||
buttonMode.setSelectedToolTip(EnderIO.lang.localize("gui.machine.weather.redstone"));
|
||||
buttonMode.setUnselectedToolTip(EnderIO.lang.localize("gui.machine.weather.manual"));
|
||||
buttonMode.setSelected(getTileEntity().getLaunchOnRedstone());
|
||||
addButton(buttonMode);
|
||||
buttonMode.onGuiInit();
|
||||
|
||||
buttonStart = new IconButton(this, 0, x_start, y, IconEIO.TICK);
|
||||
buttonStart.setToolTip(EnderIO.lang.localize("gui.machine.weather.run"));
|
||||
|
||||
addButton(buttonStart);
|
||||
buttonStart.onGuiInit();
|
||||
|
||||
refreshButtons();
|
||||
@@ -68,6 +83,9 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk>
|
||||
}
|
||||
|
||||
private void refreshButtons() {
|
||||
boolean pulseControl = getTileEntity().getLaunchOnRedstone();
|
||||
pulseControlAction(pulseControl);
|
||||
|
||||
FluidStack fs = getTileEntity().getInputTank().getFluid();
|
||||
if (fs == null) {
|
||||
buttonStart.enabled = false;
|
||||
@@ -143,9 +161,22 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk>
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton b) {
|
||||
super.actionPerformed(b);
|
||||
if (b.id >= 0 && b.id <= 2) {
|
||||
if (b.id == 0) {
|
||||
// Start Button
|
||||
getTileEntity().startTask();
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketActivateWeather(getTileEntity()));
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketActivateWeather(getTileEntity(), true));
|
||||
} else if (b.id == 1) {
|
||||
// Control Mode Button
|
||||
boolean pulseControl = buttonMode.isSelected();
|
||||
getTileEntity().setLaunchOnRedstone(pulseControl);
|
||||
pulseControlAction(pulseControl);
|
||||
PacketControlModeWeather packet = new PacketControlModeWeather(getTileEntity());
|
||||
PacketHandler.INSTANCE.sendToServer(packet);
|
||||
}
|
||||
}
|
||||
|
||||
protected void pulseControlAction(boolean pulseControl) {
|
||||
redstoneButton.setVisible(!pulseControl);
|
||||
buttonStart.setVisible(!pulseControl);
|
||||
}
|
||||
}
|
||||
+19
-1
@@ -7,14 +7,30 @@ import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketActivateWeather extends MessageTileEntity<TileWeatherObelisk>
|
||||
implements IMessageHandler<PacketActivateWeather, IMessage> {
|
||||
|
||||
private boolean start;
|
||||
|
||||
public PacketActivateWeather() {}
|
||||
|
||||
public PacketActivateWeather(TileWeatherObelisk te) {
|
||||
public PacketActivateWeather(TileWeatherObelisk te, boolean start) {
|
||||
super(te);
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeBoolean(start);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
start = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -24,6 +40,8 @@ public class PacketActivateWeather extends MessageTileEntity<TileWeatherObelisk>
|
||||
if (te != null) {
|
||||
if (ctx.side.isServer()) {
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
}
|
||||
if (message.start) {
|
||||
te.startTask();
|
||||
} else {
|
||||
te.stopTask();
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package crazypants.enderio.machine.obelisk.weather;
|
||||
|
||||
import com.enderio.core.common.network.MessageTileEntity;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketControlModeWeather extends MessageTileEntity<TileWeatherObelisk>
|
||||
implements IMessageHandler<PacketControlModeWeather, IMessage> {
|
||||
|
||||
private boolean pulse;
|
||||
|
||||
public PacketControlModeWeather() {}
|
||||
|
||||
public PacketControlModeWeather(TileWeatherObelisk te) {
|
||||
super(te);
|
||||
this.pulse = te.getLaunchOnRedstone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
super.toBytes(buf);
|
||||
buf.writeBoolean(pulse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
super.fromBytes(buf);
|
||||
pulse = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketControlModeWeather message, MessageContext ctx) {
|
||||
TileWeatherObelisk te = message.getTileEntity(message.getWorld(ctx));
|
||||
if (te != null) {
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
te.setLaunchOnRedstone(message.pulse);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractPowerConsumerEntity;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
@@ -100,6 +101,9 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
private boolean canBeActive = true;
|
||||
private boolean tanksDirty;
|
||||
|
||||
private boolean launchOnRedstone = false;
|
||||
private int cooldown = 0;
|
||||
|
||||
private static final ICapacitor cap = Capacitors.BASIC_CAPACITOR.capacitor;
|
||||
|
||||
private FluidTank inputTank = new FluidTank(8000);
|
||||
@@ -230,7 +234,13 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
protected boolean processTasks(boolean redstoneCheckPassed) {
|
||||
boolean res = false;
|
||||
|
||||
if (!redstoneCheckPassed) {
|
||||
if (cooldown > 0) {
|
||||
cooldown--;
|
||||
res = true;
|
||||
return res;
|
||||
}
|
||||
|
||||
if (!redstoneCheckPassed && !launchOnRedstone) {
|
||||
if (canBeActive) {
|
||||
canBeActive = false;
|
||||
res = true;
|
||||
@@ -254,9 +264,13 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
EntityWeatherRocket e = new EntityWeatherRocket(worldObj, activeTask);
|
||||
e.setPosition(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
|
||||
worldObj.spawnEntityInWorld(e);
|
||||
cooldown = 200;
|
||||
stopTask();
|
||||
res = true;
|
||||
}
|
||||
} else if (launchOnRedstone && RedstoneControlMode.isConditionMet(RedstoneControlMode.ON, this)) {
|
||||
startTask();
|
||||
res = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,20 +294,19 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
&& inputTank.getFluidAmount() >= 1000;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return If the operation was successful.
|
||||
*/
|
||||
public boolean startTask() {
|
||||
public void startTask() {
|
||||
if (getActiveTask() == null && inputTank.getFluidAmount() > 0) {
|
||||
fluidUsed = 0;
|
||||
WeatherTask task = WeatherTask.fromFluid(inputTank.getFluid().getFluid());
|
||||
if (canStartTask(task)) {
|
||||
if (!worldObj.isRemote) {
|
||||
PacketHandler.INSTANCE
|
||||
.sendToDimension(new PacketActivateWeather(this, true), worldObj.provider.dimensionId);
|
||||
}
|
||||
decrStackSize(0, 1);
|
||||
activeTask = task;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void stopTask() {
|
||||
@@ -301,7 +314,8 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
activeTask = null;
|
||||
fluidUsed = 0;
|
||||
if (!worldObj.isRemote) {
|
||||
PacketHandler.INSTANCE.sendToDimension(new PacketActivateWeather(this), worldObj.provider.dimensionId);
|
||||
PacketHandler.INSTANCE
|
||||
.sendToDimension(new PacketActivateWeather(this, false), worldObj.provider.dimensionId);
|
||||
} else {
|
||||
playedFuse = false;
|
||||
}
|
||||
@@ -312,12 +326,14 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
public void writeCommon(NBTTagCompound nbtRoot) {
|
||||
super.writeCommon(nbtRoot);
|
||||
nbtRoot.setTag("tank", inputTank.writeToNBT(new NBTTagCompound()));
|
||||
nbtRoot.setBoolean("weatherobeliskcontrolmode", launchOnRedstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCommon(NBTTagCompound nbtRoot) {
|
||||
super.readCommon(nbtRoot);
|
||||
inputTank.readFromNBT(nbtRoot.getCompoundTag("tank"));
|
||||
launchOnRedstone = nbtRoot.getBoolean("weatherobeliskcontrolmode");
|
||||
}
|
||||
|
||||
private boolean isValidFluid(Fluid f) {
|
||||
@@ -382,4 +398,12 @@ public class TileWeatherObelisk extends AbstractPowerConsumerEntity
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
return new FluidTankInfo[] { inputTank.getInfo() };
|
||||
}
|
||||
|
||||
public void setLaunchOnRedstone(boolean launchOnRedstone) {
|
||||
this.launchOnRedstone = launchOnRedstone;
|
||||
}
|
||||
|
||||
public boolean getLaunchOnRedstone() {
|
||||
return this.launchOnRedstone;
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class BlockFusedQuartz extends BlockEio {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Type type = Type.byMeta(meta);
|
||||
if (type.blastResistance) {
|
||||
return 20;
|
||||
return Config.fusedQuartzExplosionResistance;
|
||||
} else {
|
||||
return super.getExplosionResistance(par1Entity);
|
||||
}
|
||||
|
||||
@@ -1101,6 +1101,10 @@ enderio.gui.machine.side.west=West
|
||||
enderio.gui.machine.side.east=East
|
||||
enderio.gui.machine.side.up=Up
|
||||
enderio.gui.machine.side.down=Down
|
||||
enderio.gui.machine.weather.control=Control Mode
|
||||
enderio.gui.machine.weather.redstone=Launch on Redstone
|
||||
enderio.gui.machine.weather.manual=Default Control Mode
|
||||
enderio.gui.machine.weather.run=Launch
|
||||
|
||||
|
||||
#Power Monitor
|
||||
|
||||
Reference in new issue
Block a user