0.9.2 hotfix
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Refined Storage Changelog
|
# Refined Storage Changelog
|
||||||
|
|
||||||
|
### 0.9.2
|
||||||
|
**Bugfixes**
|
||||||
|
- Fixed not being able to take out items from Wireless Grid cross-dimensionally
|
||||||
|
|
||||||
### 0.9.1
|
### 0.9.1
|
||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
- Fixed server crash with Grid
|
- Fixed server crash with Grid
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
|
|
||||||
version = "0.9.1"
|
version = "0.9.2"
|
||||||
group = "refinedstorage"
|
group = "refinedstorage"
|
||||||
archivesBaseName = "refinedstorage"
|
archivesBaseName = "refinedstorage"
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import refinedstorage.proxy.CommonProxy;
|
|||||||
@Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION, dependencies = RefinedStorage.DEPENDENCIES)
|
@Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION, dependencies = RefinedStorage.DEPENDENCIES)
|
||||||
public final class RefinedStorage {
|
public final class RefinedStorage {
|
||||||
public static final String ID = "refinedstorage";
|
public static final String ID = "refinedstorage";
|
||||||
public static final String VERSION = "0.9.1";
|
public static final String VERSION = "0.9.2";
|
||||||
public static final String DEPENDENCIES = "required-after:mcmultipart@[1.2.1,);";
|
public static final String DEPENDENCIES = "required-after:mcmultipart@[1.2.1,);";
|
||||||
|
|
||||||
@SidedProxy(clientSide = "refinedstorage.proxy.ClientProxy", serverSide = "refinedstorage.proxy.ServerProxy")
|
@SidedProxy(clientSide = "refinedstorage.proxy.ClientProxy", serverSide = "refinedstorage.proxy.ServerProxy")
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package refinedstorage.api.network;
|
|||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
@@ -18,10 +19,11 @@ public interface IWirelessGridHandler {
|
|||||||
* Called when a player opens a wireless grid.
|
* Called when a player opens a wireless grid.
|
||||||
*
|
*
|
||||||
* @param player The player that opened the wireless grid
|
* @param player The player that opened the wireless grid
|
||||||
|
* @param world The world of the controller
|
||||||
* @param hand The hand the player opened it with
|
* @param hand The hand the player opened it with
|
||||||
* @return If the opening was successful
|
* @return If the opening was successful
|
||||||
*/
|
*/
|
||||||
boolean onOpen(EntityPlayer player, EnumHand hand);
|
boolean onOpen(EntityPlayer player, World world, EnumHand hand);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the player closes a wireless grid.
|
* Called when the player closes a wireless grid.
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import refinedstorage.RefinedStorage;
|
import refinedstorage.RefinedStorage;
|
||||||
import refinedstorage.RefinedStorageGui;
|
import refinedstorage.RefinedStorageGui;
|
||||||
import refinedstorage.RefinedStorageItems;
|
import refinedstorage.RefinedStorageItems;
|
||||||
@@ -31,7 +32,7 @@ public class WirelessGridHandler implements IWirelessGridHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOpen(EntityPlayer player, EnumHand hand) {
|
public boolean onOpen(EntityPlayer player, World controllerWorld, EnumHand hand) {
|
||||||
boolean inRange = false;
|
boolean inRange = false;
|
||||||
|
|
||||||
for (INetworkNode node : network.getNodeGraph().all()) {
|
for (INetworkNode node : network.getNodeGraph().all()) {
|
||||||
@@ -60,7 +61,7 @@ public class WirelessGridHandler implements IWirelessGridHandler {
|
|||||||
|
|
||||||
consumers.add(new WirelessGridConsumer(player, stack));
|
consumers.add(new WirelessGridConsumer(player, stack));
|
||||||
|
|
||||||
player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.WIRELESS_GRID, player.worldObj, hand.ordinal(), 0, 0);
|
player.openGui(RefinedStorage.INSTANCE, RefinedStorageGui.WIRELESS_GRID, player.worldObj, hand.ordinal(), controllerWorld.provider.getDimension(), 0);
|
||||||
|
|
||||||
network.sendItemStorageToClient((EntityPlayerMP) player);
|
network.sendItemStorageToClient((EntityPlayerMP) player);
|
||||||
|
|
||||||
|
|||||||
@@ -63,12 +63,12 @@ public class GuiHandler implements IGuiHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private WirelessGrid getWirelessGrid(EntityPlayer player, int hand) {
|
private WirelessGrid getWirelessGrid(EntityPlayer player, int hand, int controllerDimension) {
|
||||||
return new WirelessGrid(player.worldObj, player.getHeldItem(EnumHand.values()[hand]));
|
return new WirelessGrid(controllerDimension, player.getHeldItem(EnumHand.values()[hand]));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContainerGrid getWirelessGridContainer(EntityPlayer player, int hand) {
|
private ContainerGrid getWirelessGridContainer(EntityPlayer player, int hand, int controllerDimension) {
|
||||||
return new ContainerGrid(getWirelessGrid(player, hand), player);
|
return new ContainerGrid(getWirelessGrid(player, hand, controllerDimension), player);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ContainerGridFilter getGridFilterContainer(EntityPlayer player, int hand) {
|
private ContainerGridFilter getGridFilterContainer(EntityPlayer player, int hand) {
|
||||||
@@ -78,7 +78,7 @@ public class GuiHandler implements IGuiHandler {
|
|||||||
@Override
|
@Override
|
||||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
if (ID == RefinedStorageGui.WIRELESS_GRID) {
|
if (ID == RefinedStorageGui.WIRELESS_GRID) {
|
||||||
return getWirelessGridContainer(player, x);
|
return getWirelessGridContainer(player, x, y);
|
||||||
} else if (ID == RefinedStorageGui.GRID_FILTER) {
|
} else if (ID == RefinedStorageGui.GRID_FILTER) {
|
||||||
return getGridFilterContainer(player, x);
|
return getGridFilterContainer(player, x);
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ public class GuiHandler implements IGuiHandler {
|
|||||||
case RefinedStorageGui.GRID:
|
case RefinedStorageGui.GRID:
|
||||||
return new GuiGrid((ContainerGrid) getContainer(ID, player, tile), (TileGrid) tile);
|
return new GuiGrid((ContainerGrid) getContainer(ID, player, tile), (TileGrid) tile);
|
||||||
case RefinedStorageGui.WIRELESS_GRID:
|
case RefinedStorageGui.WIRELESS_GRID:
|
||||||
return getWirelessGridGui(player, x);
|
return getWirelessGridGui(player, x, y);
|
||||||
case RefinedStorageGui.DISK_DRIVE:
|
case RefinedStorageGui.DISK_DRIVE:
|
||||||
return new GuiStorage((ContainerDiskDrive) getContainer(ID, player, tile), (IStorageGui) tile, "gui/disk_drive.png");
|
return new GuiStorage((ContainerDiskDrive) getContainer(ID, player, tile), (IStorageGui) tile, "gui/disk_drive.png");
|
||||||
case RefinedStorageGui.IMPORTER:
|
case RefinedStorageGui.IMPORTER:
|
||||||
@@ -140,8 +140,8 @@ public class GuiHandler implements IGuiHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private GuiGrid getWirelessGridGui(EntityPlayer player, int hand) {
|
private GuiGrid getWirelessGridGui(EntityPlayer player, int hand, int controllerDimension) {
|
||||||
WirelessGrid grid = getWirelessGrid(player, hand);
|
WirelessGrid grid = getWirelessGrid(player, hand, controllerDimension);
|
||||||
|
|
||||||
return new GuiGrid(new ContainerGrid(grid, player), grid);
|
return new GuiGrid(new ContainerGrid(grid, player), grid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ public class ItemWirelessGrid extends ItemEnergyContainer implements ISpecialEle
|
|||||||
TileEntity controller;
|
TileEntity controller;
|
||||||
|
|
||||||
if (controllerWorld != null && ((controller = controllerWorld.getTileEntity(new BlockPos(getX(stack), getY(stack), getZ(stack)))) instanceof TileController)) {
|
if (controllerWorld != null && ((controller = controllerWorld.getTileEntity(new BlockPos(getX(stack), getY(stack), getZ(stack)))) instanceof TileController)) {
|
||||||
if (((TileController) controller).getWirelessGridHandler().onOpen(player, hand)) {
|
if (((TileController) controller).getWirelessGridHandler().onOpen(player, controllerWorld, hand)) {
|
||||||
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
|
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
|
||||||
} else {
|
} else {
|
||||||
player.addChatComponentMessage(new TextComponentTranslation("misc.refinedstorage:wireless_grid.out_of_range"));
|
player.addChatComponentMessage(new TextComponentTranslation("misc.refinedstorage:wireless_grid.out_of_range"));
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import refinedstorage.RefinedStorage;
|
import refinedstorage.RefinedStorage;
|
||||||
import refinedstorage.api.network.grid.IFluidGridHandler;
|
import refinedstorage.api.network.grid.IFluidGridHandler;
|
||||||
import refinedstorage.api.network.grid.IItemGridHandler;
|
import refinedstorage.api.network.grid.IItemGridHandler;
|
||||||
@@ -24,10 +27,9 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class WirelessGrid implements IGrid {
|
public class WirelessGrid implements IGrid {
|
||||||
private World world;
|
|
||||||
|
|
||||||
private ItemStack stack;
|
private ItemStack stack;
|
||||||
|
|
||||||
|
private int controllerDimension;
|
||||||
private BlockPos controller;
|
private BlockPos controller;
|
||||||
|
|
||||||
private int viewType;
|
private int viewType;
|
||||||
@@ -41,7 +43,7 @@ public class WirelessGrid implements IGrid {
|
|||||||
protected void onContentsChanged(int slot) {
|
protected void onContentsChanged(int slot) {
|
||||||
super.onContentsChanged(slot);
|
super.onContentsChanged(slot);
|
||||||
|
|
||||||
if (!world.isRemote) {
|
if (FMLCommonHandler.instance().getSide() == Side.SERVER) {
|
||||||
if (!stack.hasTagCompound()) {
|
if (!stack.hasTagCompound()) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
@@ -51,13 +53,12 @@ public class WirelessGrid implements IGrid {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public WirelessGrid(World world, ItemStack stack) {
|
public WirelessGrid(int controllerDimension, ItemStack stack) {
|
||||||
this.world = world;
|
this.controllerDimension = controllerDimension;
|
||||||
|
this.controller = new BlockPos(ItemWirelessGrid.getX(stack), ItemWirelessGrid.getY(stack), ItemWirelessGrid.getZ(stack));
|
||||||
|
|
||||||
this.stack = stack;
|
this.stack = stack;
|
||||||
|
|
||||||
this.controller = new BlockPos(ItemWirelessGrid.getX(stack), ItemWirelessGrid.getY(stack), ItemWirelessGrid.getZ(stack));
|
|
||||||
|
|
||||||
this.viewType = ItemWirelessGrid.getViewType(stack);
|
this.viewType = ItemWirelessGrid.getViewType(stack);
|
||||||
this.sortingType = ItemWirelessGrid.getSortingType(stack);
|
this.sortingType = ItemWirelessGrid.getSortingType(stack);
|
||||||
this.sortingDirection = ItemWirelessGrid.getSortingDirection(stack);
|
this.sortingDirection = ItemWirelessGrid.getSortingDirection(stack);
|
||||||
@@ -184,8 +185,14 @@ public class WirelessGrid implements IGrid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TileController getController() {
|
private TileController getController() {
|
||||||
|
World world = DimensionManager.getWorld(controllerDimension);
|
||||||
|
|
||||||
|
if (world != null) {
|
||||||
TileEntity tile = world.getTileEntity(controller);
|
TileEntity tile = world.getTileEntity(controller);
|
||||||
|
|
||||||
return tile instanceof TileController ? (TileController) tile : null;
|
return tile instanceof TileController ? (TileController) tile : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"modid": "refinedstorage",
|
"modid": "refinedstorage",
|
||||||
"name": "Refined Storage",
|
"name": "Refined Storage",
|
||||||
"description": "A Minecraft mod all about storage.",
|
"description": "A Minecraft mod all about storage.",
|
||||||
"version": "0.9.1",
|
"version": "0.9.2",
|
||||||
"mcversion": "1.10.2",
|
"mcversion": "1.10.2",
|
||||||
"url": "",
|
"url": "",
|
||||||
"updateUrl": "",
|
"updateUrl": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user