Fabric port in progress
This commit is contained in:
@@ -24,7 +24,7 @@ import net.minecraft.dispenser.IBlockSource;
|
||||
import net.minecraft.item.DirectionalPlaceContext;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
@@ -40,7 +40,7 @@ public final class BlockToolDispenseItemBehavior extends DefaultDispenseItemBeha
|
||||
|
||||
final World w = dispenser.getWorld();
|
||||
if (w instanceof ServerWorld) {
|
||||
ItemUseContext context = new DirectionalPlaceContext(w, dispenser.getBlockPos().offset(direction),
|
||||
ItemUsageContext context = new DirectionalPlaceContext(w, dispenser.getBlockPos().offset(direction),
|
||||
direction, dispensedItem, direction.getOpposite());
|
||||
tm.onItemUse(context);
|
||||
}
|
||||
|
||||
@@ -18,17 +18,11 @@
|
||||
|
||||
package appeng.hooks;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IBlockTool {
|
||||
// Workaround for dispenser logic.
|
||||
ActionResult onItemUse(ItemUseContext itemUseContext);
|
||||
ActionResult onItemUse(ItemUsageContext itemUseContext);
|
||||
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ public final class MatterCannonDispenseItemBehavior extends DefaultDispenseItemB
|
||||
final Direction Direction = dispenser.getBlockState().get(DispenserBlock.FACING);
|
||||
AEPartLocation dir = AEPartLocation.INTERNAL;
|
||||
for (final AEPartLocation d : AEPartLocation.SIDE_LOCATIONS) {
|
||||
if (Direction.getXOffset() == d.xOffset && Direction.getYOffset() == d.yOffset
|
||||
&& Direction.getZOffset() == d.zOffset) {
|
||||
if (Direction.getOffsetX() == d.xOffset && Direction.getOffsetY() == d.yOffset
|
||||
&& Direction.getOffsetZ() == d.zOffset) {
|
||||
dir = d;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ import appeng.core.AppEng;
|
||||
import appeng.core.sync.packets.PaintedEntityPacket;
|
||||
import appeng.crafting.CraftingJob;
|
||||
import appeng.me.Grid;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
import appeng.tile.AEBaseBlockEntity;
|
||||
import appeng.util.IWorldCallable;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -90,7 +90,7 @@ public class TickHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public void addInit(final AEBaseTileEntity tile) {
|
||||
public void addInit(final AEBaseBlockEntity tile) {
|
||||
if (Platform.isServer()) // for no there is no reason to care about this on the client...
|
||||
{
|
||||
this.getRepo().tiles.add(tile);
|
||||
@@ -181,7 +181,7 @@ public class TickHandler {
|
||||
// ready tiles.
|
||||
final HandlerRep repo = this.getRepo();
|
||||
while (!repo.tiles.isEmpty()) {
|
||||
final AEBaseTileEntity bt = repo.tiles.poll();
|
||||
final AEBaseBlockEntity bt = repo.tiles.poll();
|
||||
if (!bt.isRemoved()) {
|
||||
bt.onReady();
|
||||
}
|
||||
@@ -249,7 +249,7 @@ public class TickHandler {
|
||||
|
||||
private static class HandlerRep {
|
||||
|
||||
private Queue<AEBaseTileEntity> tiles = new ArrayDeque<>();
|
||||
private Queue<AEBaseBlockEntity> tiles = new ArrayDeque<>();
|
||||
private Set<Grid> networks = new HashSet<>();
|
||||
private Set<Grid> toAdd = new HashSet<>();
|
||||
private Set<Grid> toRemove = new HashSet<>();
|
||||
|
||||
@@ -33,9 +33,9 @@ public final class TinyTNTDispenseItemBehavior extends DefaultDispenseItemBehavi
|
||||
protected ItemStack dispenseStack(final IBlockSource dispenser, final ItemStack dispensedItem) {
|
||||
final Direction Direction = dispenser.getBlockState().get(DispenserBlock.FACING);
|
||||
final World world = dispenser.getWorld();
|
||||
final int i = dispenser.getBlockPos().getX() + Direction.getXOffset();
|
||||
final int j = dispenser.getBlockPos().getY() + Direction.getYOffset();
|
||||
final int k = dispenser.getBlockPos().getZ() + Direction.getZOffset();
|
||||
final int i = dispenser.getBlockPos().getX() + Direction.getOffsetX();
|
||||
final int j = dispenser.getBlockPos().getY() + Direction.getOffsetY();
|
||||
final int k = dispenser.getBlockPos().getZ() + Direction.getOffsetZ();
|
||||
final TinyTNTPrimedEntity primedTinyTNTEntity = new TinyTNTPrimedEntity(world, i + 0.5F, j + 0.5F, k + 0.5F,
|
||||
null);
|
||||
world.addEntity(primedTinyTNTEntity);
|
||||
|
||||
Reference in New Issue
Block a user