Skip to content

Commit

Permalink
More stuff on "Tsuki no me"
Browse files Browse the repository at this point in the history
  • Loading branch information
fuj1n committed Sep 24, 2013
1 parent e94cf46 commit 21a611e
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/tconstruct/blocks/logic/AdvancedDrawbridgeLogic.java
Expand Up @@ -12,16 +12,17 @@
//import net.minecraft.util.MathHelper;
//import net.minecraft.world.World;
//import net.minecraftforge.common.ForgeDirection;
//import tconstruct.inventory.DrawbridgeContainer;
//import tconstruct.inventory.AdvancedDrawbridgeContainer;
//import tconstruct.library.TConstructRegistry;
//import tconstruct.library.blocks.ExpandableInventoryLogic;
//import tconstruct.library.blocks.*;
//import tconstruct.library.util.*;
//import tconstruct.util.player.FakePlayerLogic;
//
//public class AdvancedDrawbridgeLogic extends ExpandableInventoryLogic implements IFacingLogic, IActiveLogic {
//public class AdvancedDrawbridgeLogic extends ExpandableInventoryLogic implements IFacingLogic, IActiveLogic, IDrawbridgeLogicBase {
// boolean active;
// boolean working;
// int ticks;
// public int selSlot = 0;
// byte extension;
// byte direction;
// byte placementDirection = 4;
Expand Down Expand Up @@ -176,7 +177,7 @@
//
// @Override
// public Container getGuiContainer(InventoryPlayer inventoryplayer, World world, int x, int y, int z) {
// return new DrawbridgeContainer(inventoryplayer, this);
// return new AdvancedDrawbridgeContainer(inventoryplayer, this);
// }
//
// @Override
Expand Down
4 changes: 3 additions & 1 deletion src/tconstruct/blocks/logic/DrawbridgeLogic.java
@@ -1,5 +1,7 @@
package tconstruct.blocks.logic;

import tconstruct.library.blocks.IDrawbridgeLogicBase;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.block.Block;
Expand All @@ -19,7 +21,7 @@
import tconstruct.library.util.*;
import tconstruct.util.player.FakePlayerLogic;

public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IActiveLogic
public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IActiveLogic, IDrawbridgeLogicBase
{
boolean active;
boolean working;
Expand Down
78 changes: 78 additions & 0 deletions src/tconstruct/inventory/AdvancedDrawbridgeContainer.java
@@ -0,0 +1,78 @@
//package tconstruct.inventory;
//
//import net.minecraft.entity.player.*;
//import net.minecraft.inventory.*;
//import net.minecraft.item.ItemStack;
//import tconstruct.blocks.logic.*;
//
//public class AdvancedDrawbridgeContainer extends Container
//{
// public AdvancedDrawbridgeLogic logic;
// public int progress = 0;
// public int fuel = 0;
// public int fuelGague = 0;
//
// public AdvancedDrawbridgeContainer(InventoryPlayer inventoryplayer, AdvancedDrawbridgeLogic logic)
// {
// this.logic = logic;
//
// this.addSlotToContainer(new DrawbridgeSlot(logic, logic.selSlot < logic.getSizeInventory() ? logic.selSlot : 0, 80, 36, logic));
// this.addSlotToContainer(new SlotOpaqueBlocksOnly(logic, 1, 35, 36));
//
// /* Player inventory */
// for (int column = 0; column < 3; column++)
// {
// for (int row = 0; row < 9; row++)
// {
// this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18));
// }
// }
//
// for (int column = 0; column < 9; column++)
// {
// this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142));
// }
// }
//
// @Override
// public boolean canInteractWith (EntityPlayer entityplayer)
// {
// return logic.isUseableByPlayer(entityplayer);
// }
//
// @Override
// public ItemStack transferStackInSlot (EntityPlayer player, int slotID)
// {
// ItemStack stack = null;
// Slot slot = (Slot) this.inventorySlots.get(slotID);
//
// if (slot != null && slot.getHasStack())
// {
// ItemStack slotStack = slot.getStack();
// stack = slotStack.copy();
//
// if (slotID < logic.getSizeInventory())
// {
// if (!this.mergeItemStack(slotStack, logic.getSizeInventory(), this.inventorySlots.size(), true))
// {
// return null;
// }
// }
// else if (!this.mergeItemStack(slotStack, 0, logic.getSizeInventory(), false))
// {
// return null;
// }
//
// if (slotStack.stackSize == 0)
// {
// slot.putStack((ItemStack) null);
// }
// else
// {
// slot.onSlotChanged();
// }
// }
//
// return stack;
// }
//}
6 changes: 4 additions & 2 deletions src/tconstruct/inventory/DrawbridgeSlot.java
@@ -1,5 +1,7 @@
package tconstruct.inventory;

import tconstruct.library.blocks.IDrawbridgeLogicBase;

import tconstruct.blocks.logic.DrawbridgeLogic;
import tconstruct.library.TConstructRegistry;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -9,9 +11,9 @@

public class DrawbridgeSlot extends SlotBlocksOnly
{
DrawbridgeLogic logic;
IDrawbridgeLogicBase logic;

public DrawbridgeSlot(IInventory iinventory, int par2, int par3, int par4, DrawbridgeLogic logic)
public DrawbridgeSlot(IInventory iinventory, int par2, int par3, int par4, IDrawbridgeLogicBase logic)
{
super(iinventory, par2, par3, par4);
this.logic = logic;
Expand Down
7 changes: 7 additions & 0 deletions src/tconstruct/library/blocks/IDrawbridgeLogicBase.java
@@ -0,0 +1,7 @@
package tconstruct.library.blocks;

public interface IDrawbridgeLogicBase{

public boolean hasExtended();

}

0 comments on commit 21a611e

Please sign in to comment.