mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
More work on Digital Miner filter system, also fixed a little memory leak
This commit is contained in:
1 parent
13afad3b0d
commit
ddc499c9fe
7 files changed
+64
-1
No files matched your search
@@ -11,6 +11,7 @@ import mekanism.common.network.PacketDigitalMinerGui.MinerGuiPacket;
|
||||
import mekanism.common.network.PacketEditFilter.EditFilterMessage;
|
||||
import mekanism.common.network.PacketNewFilter.NewFilterMessage;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -131,6 +132,11 @@ public class GuiMItemStackFilter extends GuiMekanism
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.requireReplace") + ": " + LangUtils.transYesNo(filter.requireStack), xAxis, yAxis);
|
||||
}
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
}
|
||||
@@ -225,6 +231,12 @@ public class GuiMItemStackFilter extends GuiMekanism
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0, 0, 0));
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
filter.requireStack = !filter.requireStack;
|
||||
}
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ import mekanism.common.network.PacketDigitalMinerGui.MinerGuiPacket;
|
||||
import mekanism.common.network.PacketEditFilter.EditFilterMessage;
|
||||
import mekanism.common.network.PacketNewFilter.NewFilterMessage;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -131,6 +132,11 @@ public class GuiMMaterialFilter extends GuiMekanism
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.requireReplace") + ": " + LangUtils.transYesNo(filter.requireStack), xAxis, yAxis);
|
||||
}
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
}
|
||||
@@ -225,6 +231,12 @@ public class GuiMMaterialFilter extends GuiMekanism
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0, 0, 0));
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
filter.requireStack = !filter.requireStack;
|
||||
}
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ import mekanism.common.network.PacketDigitalMinerGui.MinerGuiPacket;
|
||||
import mekanism.common.network.PacketEditFilter.EditFilterMessage;
|
||||
import mekanism.common.network.PacketNewFilter.NewFilterMessage;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -169,6 +170,11 @@ public class GuiMModIDFilter extends GuiMekanism
|
||||
GL11.glPopMatrix();
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.requireReplace") + ": " + LangUtils.transYesNo(filter.requireStack), xAxis, yAxis);
|
||||
}
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
}
|
||||
@@ -293,6 +299,12 @@ public class GuiMModIDFilter extends GuiMekanism
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
setModID();
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
filter.requireStack = !filter.requireStack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import mekanism.common.network.PacketDigitalMinerGui.MinerGuiPacket;
|
||||
import mekanism.common.network.PacketEditFilter.EditFilterMessage;
|
||||
import mekanism.common.network.PacketNewFilter.NewFilterMessage;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -172,6 +173,11 @@ public class GuiMOreDictFilter extends GuiMekanism
|
||||
GL11.glPopMatrix();
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.requireReplace") + ": " + LangUtils.transYesNo(filter.requireStack), xAxis, yAxis);
|
||||
}
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
}
|
||||
@@ -296,6 +302,12 @@ public class GuiMOreDictFilter extends GuiMekanism
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
setOreDictKey();
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
filter.requireStack = !filter.requireStack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ public class CommonWorldTickHandler
|
||||
|
||||
int dimensionId = world.provider.dimensionId;
|
||||
|
||||
//Credit to E. Beef :)
|
||||
//Credit to E. Beef
|
||||
if(chunkRegenMap.containsKey(dimensionId))
|
||||
{
|
||||
Queue<ChunkCoordIntPair> chunksToGen = chunkRegenMap.get(dimensionId);
|
||||
@@ -152,6 +152,7 @@ public class CommonWorldTickHandler
|
||||
fmlRandom.setSeed((xSeed*nextChunk.chunkXPos + zSeed*nextChunk.chunkZPos) ^ world.getSeed());
|
||||
|
||||
Mekanism.genHandler.generate(fmlRandom, nextChunk.chunkXPos, nextChunk.chunkZPos, world, world.getChunkProvider(), world.getChunkProvider());
|
||||
Mekanism.logger.info("[Mekanism] Regenerating ores at chunk " + nextChunk);
|
||||
}
|
||||
|
||||
if(chunksToGen.isEmpty())
|
||||
|
||||
@@ -221,6 +221,7 @@ public class Mekanism
|
||||
/** A list of the usernames of players who have donated to Mekanism. */
|
||||
public static List<String> donators = new ArrayList<String>();
|
||||
|
||||
/** The server's world tick handler. */
|
||||
public static CommonWorldTickHandler worldTickHandler = new CommonWorldTickHandler();
|
||||
|
||||
/** The Mekanism world generation handler. */
|
||||
@@ -1543,6 +1544,18 @@ public class Mekanism
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void chunkSave(ChunkDataEvent.Save event)
|
||||
{
|
||||
if(!event.world.isRemote)
|
||||
{
|
||||
NBTTagCompound nbtTags = event.getData();
|
||||
|
||||
nbtTags.setInteger("MekanismWorldGen", baseWorldGenVersion);
|
||||
nbtTags.setInteger("MekanismUserWorldGen", userWorldGenVersion);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public synchronized void onChunkDataLoad(ChunkDataEvent.Load event)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user