Utils ported

This commit is contained in:
Sebastian Hartte
2020-06-28 03:41:44 +02:00
parent 7c28a71e10
commit fee5b7fdfc
204 changed files with 1371 additions and 1737 deletions
@@ -51,7 +51,7 @@ public class CubeGeneratorBlockEntity extends AEBaseBlockEntity implements ITick
if (this.countdown % 20 == 0) {
for (final PlayerEntity e : AppEng.proxy.getPlayers()) {
e.sendMessage(new LiteralText("Spawning in... " + (this.countdown / 20)));
e.sendSystemMessage(new LiteralText("Spawning in... " + (this.countdown / 20)), Util.NIL_UUID);
}
}
@@ -102,7 +102,7 @@ public class CubeGeneratorBlockEntity extends AEBaseBlockEntity implements ITick
this.size = 64;
}
player.sendMessage(new LiteralText("Size: " + this.size));
player.sendSystemMessage(new LiteralText("Size: " + this.size), Util.NIL_UUID);
} else {
this.countdown = 20 * 10;
this.is = hand;
@@ -49,19 +49,19 @@ public class DebugPartPlacerItem extends AEBaseItem {
}
if (!player.abilities.isCreativeMode) {
player.sendMessage(new LiteralText("Only usable in creative mode"));
player.sendSystemMessage(new LiteralText("Only usable in creative mode"), Util.NIL_UUID);
return ActionResult.FAIL;
}
BlockEntity te = world.getBlockEntity(pos);
if (!(te instanceof IPartHost)) {
player.sendMessage(new LiteralText("Right-click something that will accept parts"));
player.sendSystemMessage(new LiteralText("Right-click something that will accept parts"), Util.NIL_UUID);
return ActionResult.FAIL;
}
IPartHost center = (IPartHost) te;
IPart cable = center.getPart(AEPartLocation.INTERNAL);
if (cable == null) {
player.sendMessage(new LiteralText("Clicked part host must have an INSIDE part"));
player.sendSystemMessage(new LiteralText("Clicked part host must have an INSIDE part"), Util.NIL_UUID);
return ActionResult.FAIL;
}
@@ -24,7 +24,7 @@ import java.util.Queue;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import alexiil.mc.lib.attributes.item.FixedItemInv;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -42,7 +42,7 @@ public class ItemGenBlockEntity extends AEBaseBlockEntity {
private static final Queue<ItemStack> POSSIBLE_ITEMS = new ArrayDeque<>();
private final ItemTransferable handler = new QueuedItemHandler();
private final FixedItemInv handler = new QueuedItemHandler();
public ItemGenBlockEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
@@ -81,7 +81,7 @@ public class ItemGenBlockEntity extends AEBaseBlockEntity {
return super.getCapability(capability, facing);
}
class QueuedItemHandler implements ItemTransferable {
class QueuedItemHandler implements FixedItemInv {
@Override
@Nonnull
@@ -69,7 +69,7 @@ public class MeteoritePlacerItem extends AEBaseItem {
CraterType craterType = CraterType.values()[tag.getByte(MODE_TAG)];
player.sendMessage(new LiteralText(craterType.name()));
player.sendSystemMessage(new LiteralText(craterType.name()), Util.NIL_UUID);
return TypedActionResult.resultSuccess(itemStack);
}