Small fixes here and there
This commit is contained in:
@@ -5,11 +5,14 @@ import com.raoulvdberge.refinedstorage.api.autocrafting.ICraftingPatternContaine
|
|||||||
import com.raoulvdberge.refinedstorage.api.util.IComparer;
|
import com.raoulvdberge.refinedstorage.api.util.IComparer;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.autocrafting.registry.CraftingTaskFactory;
|
import com.raoulvdberge.refinedstorage.apiimpl.autocrafting.registry.CraftingTaskFactory;
|
||||||
|
import com.raoulvdberge.refinedstorage.item.PatternItem;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.inventory.CraftingInventory;
|
import net.minecraft.inventory.CraftingInventory;
|
||||||
import net.minecraft.inventory.container.Container;
|
import net.minecraft.inventory.container.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.ICraftingRecipe;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
import net.minecraft.item.crafting.IRecipeType;
|
||||||
import net.minecraft.item.crafting.Ingredient;
|
import net.minecraft.item.crafting.Ingredient;
|
||||||
import net.minecraft.util.NonNullList;
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -34,12 +37,12 @@ public class CraftingPattern implements ICraftingPattern {
|
|||||||
public CraftingPattern(World world, ICraftingPatternContainer container, ItemStack stack) {
|
public CraftingPattern(World world, ICraftingPatternContainer container, ItemStack stack) {
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this.stack = stack;
|
this.stack = stack;
|
||||||
// TODO this.processing = ItemPattern.isProcessing(stack);
|
this.processing = PatternItem.isProcessing(stack);
|
||||||
// TODO this.oredict = ItemPattern.isOredict(stack);
|
this.oredict = PatternItem.isOredict(stack);
|
||||||
|
|
||||||
if (processing) {
|
if (processing) {
|
||||||
for (int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
ItemStack input = ItemStack.EMPTY;// TODO ItemPattern.getInputSlot(stack, i);
|
ItemStack input = PatternItem.getInputSlot(stack, i);
|
||||||
|
|
||||||
if (input == null) {
|
if (input == null) {
|
||||||
inputs.add(NonNullList.create());
|
inputs.add(NonNullList.create());
|
||||||
@@ -71,42 +74,42 @@ public class CraftingPattern implements ICraftingPattern {
|
|||||||
inputs.add(NonNullList.from(ItemStack.EMPTY, input));
|
inputs.add(NonNullList.from(ItemStack.EMPTY, input));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ItemStack output = ItemPattern.getOutputSlot(stack, i);
|
ItemStack output = PatternItem.getOutputSlot(stack, i);
|
||||||
if (output != null) {
|
if (output != null) {
|
||||||
this.valid = true; // As soon as we have one output, we are valid.
|
this.valid = true; // As soon as we have one output, we are valid.
|
||||||
|
|
||||||
outputs.add(output);
|
outputs.add(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
FluidStack fluidInput = ItemPattern.getFluidInputSlot(stack, i);
|
FluidStack fluidInput = PatternItem.getFluidInputSlot(stack, i);
|
||||||
if (fluidInput != null) {
|
if (fluidInput != null) {
|
||||||
this.valid = true;
|
this.valid = true;
|
||||||
|
|
||||||
fluidInputs.add(fluidInput);
|
fluidInputs.add(fluidInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
FluidStack fluidOutput = ItemPattern.getFluidOutputSlot(stack, i);
|
FluidStack fluidOutput = PatternItem.getFluidOutputSlot(stack, i);
|
||||||
if (fluidOutput != null) {
|
if (fluidOutput != null) {
|
||||||
this.valid = true;
|
this.valid = true;
|
||||||
|
|
||||||
fluidOutputs.add(fluidOutput);
|
fluidOutputs.add(fluidOutput);
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CraftingInventory inv = new CraftingInventoryDummy();
|
CraftingInventory inv = new DummyCraftingInventory();
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
// TODO ItemStack input = ItemPattern.getInputSlot(stack, i);
|
ItemStack input = PatternItem.getInputSlot(stack, i);
|
||||||
|
|
||||||
// TODO inputs.add(input == null ? NonNullList.create() : NonNullList.from(ItemStack.EMPTY, input));
|
inputs.add(input == null ? NonNullList.create() : NonNullList.from(ItemStack.EMPTY, input));
|
||||||
|
|
||||||
// TODO if (input != null) {
|
if (input != null) {
|
||||||
// TODO inv.setInventorySlotContents(i, input);
|
inv.setInventorySlotContents(i, input);
|
||||||
// TODO }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: better way of collecting recipes
|
// TODO: better way of collecting recipes
|
||||||
for (IRecipe r : world.getRecipeManager().getRecipes()) {
|
for (ICraftingRecipe r : world.getRecipeManager().getRecipes(IRecipeType.CRAFTING, inv, world)) {
|
||||||
if (r.matches(inv, world)) {
|
if (r.matches(inv, world)) {
|
||||||
this.recipe = r;
|
this.recipe = r;
|
||||||
|
|
||||||
@@ -182,7 +185,7 @@ public class CraftingPattern implements ICraftingPattern {
|
|||||||
throw new IllegalArgumentException("The items that are taken (" + took.size() + ") should match the inputs for this pattern (" + inputs.size() + ")");
|
throw new IllegalArgumentException("The items that are taken (" + took.size() + ") should match the inputs for this pattern (" + inputs.size() + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
CraftingInventory inv = new CraftingInventoryDummy();
|
CraftingInventory inv = new DummyCraftingInventory();
|
||||||
|
|
||||||
for (int i = 0; i < took.size(); ++i) {
|
for (int i = 0; i < took.size(); ++i) {
|
||||||
inv.setInventorySlotContents(i, took.get(i));
|
inv.setInventorySlotContents(i, took.get(i));
|
||||||
@@ -215,7 +218,7 @@ public class CraftingPattern implements ICraftingPattern {
|
|||||||
throw new IllegalArgumentException("The items that are taken (" + took.size() + ") should match the inputs for this pattern (" + inputs.size() + ")");
|
throw new IllegalArgumentException("The items that are taken (" + took.size() + ") should match the inputs for this pattern (" + inputs.size() + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
CraftingInventory inv = new CraftingInventoryDummy();
|
CraftingInventory inv = new DummyCraftingInventory();
|
||||||
|
|
||||||
for (int i = 0; i < took.size(); ++i) {
|
for (int i = 0; i < took.size(); ++i) {
|
||||||
inv.setInventorySlotContents(i, took.get(i));
|
inv.setInventorySlotContents(i, took.get(i));
|
||||||
@@ -341,8 +344,8 @@ public class CraftingPattern implements ICraftingPattern {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
class CraftingInventoryDummy extends CraftingInventory {
|
private class DummyCraftingInventory extends CraftingInventory {
|
||||||
public CraftingInventoryDummy() {
|
public DummyCraftingInventory() {
|
||||||
super(new Container(null, 0) {
|
super(new Container(null, 0) {
|
||||||
@Override
|
@Override
|
||||||
public boolean canInteractWith(PlayerEntity player) {
|
public boolean canInteractWith(PlayerEntity player) {
|
||||||
|
@@ -5,6 +5,7 @@ import com.raoulvdberge.refinedstorage.api.autocrafting.craftingmonitor.ICraftin
|
|||||||
import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
@@ -52,8 +53,7 @@ public class CraftingMonitorElementFluidRender implements ICraftingMonitorElemen
|
|||||||
|
|
||||||
drawers.getFluidDrawer().draw(x + 4, y + 6, stack);
|
drawers.getFluidDrawer().draw(x + 4, y + 6, stack);
|
||||||
|
|
||||||
// TODO float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
float scale = Minecraft.getInstance().getForceUnicodeFont() ? 1F : 0.5F;
|
||||||
float scale = 1F;
|
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.scalef(scale, scale, 1);
|
GlStateManager.scalef(scale, scale, 1);
|
||||||
|
@@ -5,6 +5,7 @@ import com.raoulvdberge.refinedstorage.api.autocrafting.craftingmonitor.ICraftin
|
|||||||
import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
@@ -52,8 +53,7 @@ public class CraftingMonitorElementItemRender implements ICraftingMonitorElement
|
|||||||
|
|
||||||
drawers.getItemDrawer().draw(x + 4, y + 6, stack);
|
drawers.getItemDrawer().draw(x + 4, y + 6, stack);
|
||||||
|
|
||||||
// TODO float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
float scale = Minecraft.getInstance().getForceUnicodeFont() ? 1F : 0.5F;
|
||||||
float scale = 1F;
|
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.scalef(scale, scale, 1);
|
GlStateManager.scalef(scale, scale, 1);
|
||||||
|
@@ -5,6 +5,7 @@ import com.raoulvdberge.refinedstorage.api.autocrafting.preview.ICraftingPreview
|
|||||||
import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
@@ -67,9 +68,7 @@ public class CraftingPreviewElementFluidStack implements ICraftingPreviewElement
|
|||||||
|
|
||||||
drawers.getFluidDrawer().draw(x, y, getElement());
|
drawers.getFluidDrawer().draw(x, y, getElement());
|
||||||
|
|
||||||
// TODO
|
float scale = Minecraft.getInstance().getForceUnicodeFont() ? 1F : 0.5F;
|
||||||
//float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
|
||||||
float scale = 1F;
|
|
||||||
|
|
||||||
y += 2;
|
y += 2;
|
||||||
|
|
||||||
|
@@ -4,6 +4,7 @@ import com.mojang.blaze3d.platform.GlStateManager;
|
|||||||
import com.raoulvdberge.refinedstorage.api.autocrafting.preview.ICraftingPreviewElement;
|
import com.raoulvdberge.refinedstorage.api.autocrafting.preview.ICraftingPreviewElement;
|
||||||
import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
import com.raoulvdberge.refinedstorage.api.render.IElementDrawers;
|
||||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -77,8 +78,7 @@ public class CraftingPreviewElementItemStack implements ICraftingPreviewElement<
|
|||||||
|
|
||||||
drawers.getItemDrawer().draw(x, y, getElement());
|
drawers.getItemDrawer().draw(x, y, getElement());
|
||||||
|
|
||||||
// TODO float scale = drawers.getFontRenderer().getUnicodeFlag() ? 1F : 0.5F;
|
float scale = Minecraft.getInstance().getForceUnicodeFont() ? 1F : 0.5F;
|
||||||
float scale = 1F;
|
|
||||||
|
|
||||||
y += 2;
|
y += 2;
|
||||||
|
|
||||||
|
@@ -7,7 +7,6 @@ public class ProxyCommon {
|
|||||||
|
|
||||||
API.deliver(e.getAsmData());
|
API.deliver(e.getAsmData());
|
||||||
|
|
||||||
NetworkNodeGrid.FACTORY_ID = API.instance().getGridManager().add(new GridFactoryGridBlock());
|
|
||||||
WirelessGrid.ID = API.instance().getGridManager().add(new GridFactoryWirelessGrid());
|
WirelessGrid.ID = API.instance().getGridManager().add(new GridFactoryWirelessGrid());
|
||||||
WirelessFluidGrid.ID = API.instance().getGridManager().add(new GridFactoryWirelessFluidGrid());
|
WirelessFluidGrid.ID = API.instance().getGridManager().add(new GridFactoryWirelessFluidGrid());
|
||||||
TilePortableGrid.FACTORY_ID = API.instance().getGridManager().add(new GridFactoryPortableGridBlock());
|
TilePortableGrid.FACTORY_ID = API.instance().getGridManager().add(new GridFactoryPortableGridBlock());
|
||||||
@@ -88,19 +87,5 @@ public class ProxyCommon {
|
|||||||
if (e.getTargetBlock().getBlock() instanceof BlockBase) {
|
if (e.getTargetBlock().getBlock() instanceof BlockBase) {
|
||||||
e.setCanHarvest(true); // Allow break without tool
|
e.setCanHarvest(true); // Allow break without tool
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onPlayerLoginEvent(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent e) {
|
|
||||||
if (!e.player.world.isRemote) {
|
|
||||||
RS.INSTANCE.network.sendTo(new MessageConfigSync(), (ServerPlayerEntity) e.player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onPlayerLogoutEvent(WorldEvent.Unload e) {
|
|
||||||
if (e.getWorld().isRemote && RS.INSTANCE.config.getOriginalClientVersion() != null) {
|
|
||||||
RS.INSTANCE.config = RS.INSTANCE.config.getOriginalClientVersion();
|
|
||||||
}
|
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,7 @@ public class GuiCraftingPreview extends BaseScreen {
|
|||||||
int x = 7;
|
int x = 7;
|
||||||
int y = 15;
|
int y = 15;
|
||||||
|
|
||||||
float scale = /* TODO font.getUnicodeFlag() ? 1F :*/ 0.5F;
|
float scale = Minecraft.getInstance().getForceUnicodeFont() ? 1F : 0.5F;
|
||||||
|
|
||||||
if (getErrorType() != null) {
|
if (getErrorType() != null) {
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
@@ -8,6 +8,7 @@ import com.raoulvdberge.refinedstorage.screen.widget.ScrollbarWidget;
|
|||||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.SideButtonRedstoneMode;
|
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.SideButtonRedstoneMode;
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
||||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||||
import net.minecraft.client.gui.widget.button.Button;
|
import net.minecraft.client.gui.widget.button.Button;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
@@ -116,7 +117,7 @@ public class GuiReaderWriter extends BaseScreen<ReaderWriterContainer> {
|
|||||||
|
|
||||||
int item = scrollbar != null ? scrollbar.getOffset() : 0;
|
int item = scrollbar != null ? scrollbar.getOffset() : 0;
|
||||||
|
|
||||||
float scale = /*TODO fontRenderer.getUnicodeFlag() ? 1F :*/ 0.5F;
|
float scale = Minecraft.getInstance().getForceUnicodeFont() ? 1F : 0.5F;
|
||||||
|
|
||||||
for (int i = 0; i < VISIBLE_ROWS; ++i) {
|
for (int i = 0; i < VISIBLE_ROWS; ++i) {
|
||||||
if (item < getChannels().size()) {
|
if (item < getChannels().size()) {
|
||||||
|
@@ -79,7 +79,7 @@ public class ItemGridStack implements IGridStack {
|
|||||||
public String getName() {
|
public String getName() {
|
||||||
try {
|
try {
|
||||||
if (cachedName == null) {
|
if (cachedName == null) {
|
||||||
cachedName = stack.getDisplayName().getFormattedText(); // TODO
|
cachedName = stack.getDisplayName().getFormattedText();
|
||||||
}
|
}
|
||||||
|
|
||||||
return cachedName;
|
return cachedName;
|
||||||
|
Reference in New Issue
Block a user