mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 19:59:36 +00:00
Fixed spreaders. Build 56.
This commit is contained in:
1 parent
40b4492db1
commit
f163261f56
9 files changed
+52
-9
No files matched your search
@@ -51,7 +51,7 @@ public class ClientTickHandler {
|
||||
if(player != null) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && stack.getItem() instanceof ItemTwigWand) {
|
||||
List<TileEntity> list = new ArrayList(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld));
|
||||
List<TileEntity> list = new ArrayList(ManaNetworkHandler.instance.getAllClientCollectorsInWorld(Minecraft.getMinecraft().theWorld));
|
||||
for(TileEntity tile : list) {
|
||||
if(tile instanceof IManaCollector)
|
||||
((IManaCollector) tile).onClientDisplayTick();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
package vazkii.botania.client.core.proxy;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -50,6 +51,7 @@ import vazkii.botania.common.block.tile.TileRuneAltar;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.handler.ManaNetworkHandler;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.core.proxy.CommonProxy;
|
||||
import vazkii.botania.common.core.version.VersionChecker;
|
||||
@@ -109,6 +111,11 @@ public class ClientProxy extends CommonProxy {
|
||||
public void setEntryToOpen(LexiconEntry entry) {
|
||||
GuiLexicon.currentOpenLexicon = new GuiLexiconEntry(entry, new GuiLexiconIndex(entry.category));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addClientCollector(TileEntity tile) {
|
||||
ManaNetworkHandler.addClientCollector(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getWorldElapsedTicks() {
|
||||
|
||||
@@ -44,6 +44,7 @@ import vazkii.botania.api.mana.ManaNetworkEvent;
|
||||
import vazkii.botania.api.wand.ITileBound;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
@@ -108,11 +109,13 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote && !added) {
|
||||
boolean added = this.added;
|
||||
if(!worldObj.isRemote && !this.added) {
|
||||
ManaNetworkEvent.addCollector(this);
|
||||
added = true;
|
||||
}
|
||||
|
||||
this.added = true;
|
||||
} else if(worldObj.isRemote && !added)
|
||||
Botania.proxy.addClientCollector(this);
|
||||
|
||||
boolean redstone = false;
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
||||
@@ -25,11 +25,16 @@ import vazkii.botania.api.mana.ManaNetworkEvent.Action;
|
||||
import vazkii.botania.api.mana.ManaNetworkEvent.ManaBlockType;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public final class ManaNetworkHandler implements IManaNetwork {
|
||||
|
||||
public static final ManaNetworkHandler instance = new ManaNetworkHandler();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static WeakHashMap<World, List<TileEntity>> clientCollectors = new WeakHashMap();
|
||||
|
||||
public WeakHashMap<World, List<TileEntity>> manaPools = new WeakHashMap();
|
||||
public WeakHashMap<World, List<TileEntity>> manaCollectors = new WeakHashMap();
|
||||
|
||||
@@ -101,11 +106,31 @@ public final class ManaNetworkHandler implements IManaNetwork {
|
||||
if(!tiles.contains(tile))
|
||||
tiles.add(tile);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void addClientCollector(TileEntity tile) {
|
||||
World world = tile.getWorldObj();
|
||||
Map<World, List<TileEntity>> map = clientCollectors;
|
||||
|
||||
List<TileEntity> tiles;
|
||||
if(!map.containsKey(world))
|
||||
map.put(world, new ArrayList());
|
||||
|
||||
tiles = map.get(world);
|
||||
|
||||
if(!tiles.contains(tile))
|
||||
tiles.add(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TileEntity> getAllCollectorsInWorld(World world) {
|
||||
return getAllInWorld(manaCollectors, world);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public List<TileEntity> getAllClientCollectorsInWorld(World world) {
|
||||
return getAllInWorld(clientCollectors, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TileEntity> getAllPoolsInWorld(World world) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.List;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -93,6 +94,10 @@ public class CommonProxy {
|
||||
public void setEntryToOpen(LexiconEntry entry) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
public void addClientCollector(TileEntity tile) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
public long getWorldElapsedTicks() {
|
||||
return MinecraftServer.getServer().worldServers[0].getTotalWorldTime();
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#Sat, 14 Jun 2014 21:56:08 +0100
|
||||
#Sat, 14 Jun 2014 22:17:14 +0100
|
||||
version=r1.0
|
||||
build_number=56
|
||||
build_number=57
|
||||
mc_version=1.7.2
|
||||
mod_name=Botania
|
||||
dir.repo=./
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
r1.0-55
|
||||
r1.0-56
|
||||
@@ -1,3 +1,5 @@
|
||||
r1.0 56
|
||||
*Fixed Mana Spreaders not showing the prediction beam, another thing broken by 54...
|
||||
r1.0 55
|
||||
*Added some sanity checking to the flowers' connection code to reflect the changes in 54, be it for Spreaders or Pools. In theory, this ought to fix the bug where flowers lose their binding upon relog. I can't exactly tell you if that is the case though, because this issue is completely sporadic and nigh-on impossible to reproduce with consistency. <i><b>Warning</b>: This change modifies API files SubTileGenerating.java and SubTileFunctional.java. Third time's the charm, right? Please be so.</i>
|
||||
*Mana Mirrors no longer show their binding in the tooltip, but rather in world.
|
||||
|
||||
+2
-1
@@ -52,4 +52,5 @@ r1.0-51=1.7.2
|
||||
r1.0-52=1.7.2
|
||||
r1.0-53=1.7.2
|
||||
r1.0-54=1.7.2
|
||||
r1.0-55=1.7.2
|
||||
r1.0-55=1.7.2
|
||||
r1.0-56=1.7.2
|
||||
Reference in new issue
Block a user