API compiles

This commit is contained in:
Sebastian Hartte
2020-06-27 18:09:44 +02:00
parent ba71a82288
commit 80fbb58d4f
572 changed files with 2995 additions and 3037 deletions
@@ -23,26 +23,15 @@
package appeng.api.config; package appeng.api.config;
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
public enum Actionable { public enum Actionable {
/** /**
* Perform the intended action. * Perform the intended action.
*/ */
MODULATE(FluidAction.EXECUTE), MODULATE,
/** /**
* Pretend to perform the action. * Pretend to perform the action.
*/ */
SIMULATE(FluidAction.SIMULATE); SIMULATE
private final FluidAction fluidAction;
Actionable(FluidAction fluidAction) {
this.fluidAction = fluidAction;
}
public FluidAction getFluidAction() {
return fluidAction;
}
} }
@@ -23,8 +23,8 @@
package appeng.api.config; package appeng.api.config;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.text.TranslatableText;
public enum PowerUnits { public enum PowerUnits {
AE("gui.appliedenergistics2.units.appliedenergstics"), // Native Units - AE Energy AE("gui.appliedenergistics2.units.appliedenergstics"), // Native Units - AE Energy
@@ -61,8 +61,8 @@ public enum PowerUnits {
return (value * this.conversionRatio) / target.conversionRatio; return (value * this.conversionRatio) / target.conversionRatio;
} }
public ITextComponent textComponent() { public Text textComponent() {
return new TranslationTextComponent(unlocalizedName); return new TranslatableText(unlocalizedName);
} }
} }
@@ -20,11 +20,11 @@ package appeng.api.definitions;
import java.util.Optional; import java.util.Optional;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
public interface ITileDefinition extends IBlockDefinition { public interface ITileDefinition extends IBlockDefinition {
/** /**
* @return the {@link TileEntity} Class if applicable. * @return the {@link BlockEntity} Class if applicable.
*/ */
Optional<? extends Class<? extends TileEntity>> maybeEntity(); Optional<? extends Class<? extends BlockEntity>> maybeEntity();
} }
@@ -1,6 +1,6 @@
package appeng.api.definitions; package appeng.api.definitions;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
// Private helper class to create AE2 resource locations // Private helper class to create AE2 resource locations
final class IdHelper { final class IdHelper {
@@ -11,8 +11,8 @@ final class IdHelper {
/** /**
* Creates a ResourceLocation namespaced to AE2. * Creates a ResourceLocation namespaced to AE2.
*/ */
static ResourceLocation id(String id) { static Identifier id(String id) {
return new ResourceLocation("appliedenergistics2", id); return new Identifier("appliedenergistics2", id);
} }
} }
@@ -23,24 +23,24 @@
package appeng.api.events; package appeng.api.events;
import net.minecraftforge.eventbus.api.Event;
import appeng.api.features.ILocatable; import appeng.api.features.ILocatable;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
/** /**
* Input Event: * Input Event:
* * <p>
* Used to Notify the Location Registry of objects, and their availability. * Used to Notify the Location Registry of objects, and their availability.
*/ */
public class LocatableEventAnnounce extends Event { public interface LocatableEventAnnounce {
public final ILocatable target; Event<LocatableEventAnnounce> EVENT = EventFactory.createArrayBacked(LocatableEventAnnounce.class, listeners -> (ILocatable o, LocatableEvent evt) -> {
public final LocatableEvent change; for (LocatableEventAnnounce listener : listeners) {
listener.onLocatableAnnounce(o, evt);
}
});
public LocatableEventAnnounce(final ILocatable o, final LocatableEvent ev) { void onLocatableAnnounce(final ILocatable o, final LocatableEvent ev);
this.target = o;
this.change = ev;
}
public enum LocatableEvent { public enum LocatableEvent {
/** /**
@@ -0,0 +1,8 @@
package appeng.api.events;
@FunctionalInterface
public interface LocatableEventCallback {
void onLocatable(LocatableEventAnnounce.LocatableEvent evt);
}
@@ -25,7 +25,7 @@ package appeng.api.features;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
public interface IMatterCannonAmmoRegistry { public interface IMatterCannonAmmoRegistry {
@@ -45,7 +45,7 @@ public interface IMatterCannonAmmoRegistry {
* @param ammoTag item tag id * @param ammoTag item tag id
* @param weight atomic weight * @param weight atomic weight
*/ */
void registerAmmoTag(ResourceLocation ammoTag, double weight); void registerAmmoTag(Identifier ammoTag, double weight);
/** /**
* get the penetration value for a particular ammo, 0 indicates a non-ammo. * get the penetration value for a particular ammo, 0 indicates a non-ammo.
@@ -27,7 +27,6 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.common.capabilities.Capability;
import appeng.api.config.TunnelType; import appeng.api.config.TunnelType;
@@ -48,8 +47,6 @@ public interface IP2PTunnelRegistry {
void addNewAttunement(@Nonnull String ModId, @Nullable TunnelType type); void addNewAttunement(@Nonnull String ModId, @Nullable TunnelType type);
void addNewAttunement(@Nonnull Capability<?> cap, @Nullable TunnelType type);
/** /**
* returns null if no attunement can be found. * returns null if no attunement can be found.
* *
@@ -23,19 +23,16 @@
package appeng.api.features; package appeng.api.features;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraft.world.IWorld; import net.minecraft.world.ServerWorldAccess;
import net.minecraft.world.dimension.Dimension;
public interface IWorldGen { public interface IWorldGen {
void disableWorldGenForProviderID(WorldGenType type, Class<? extends Dimension> provider); void enableWorldGenForDimension(WorldGenType type, Identifier dimID);
void enableWorldGenForDimension(WorldGenType type, ResourceLocation dimID); void disableWorldGenForDimension(WorldGenType type, Identifier dimID);
void disableWorldGenForDimension(WorldGenType type, ResourceLocation dimID); boolean isWorldGenEnabled(WorldGenType type, ServerWorldAccess w);
boolean isWorldGenEnabled(WorldGenType type, IWorld w);
enum WorldGenType { enum WorldGenType {
CERTUS_QUARTZ, CHARGED_CERTUS_QUARTZ, METEORITES CERTUS_QUARTZ, CHARGED_CERTUS_QUARTZ, METEORITES
@@ -23,7 +23,7 @@
package appeng.api.implementations; package appeng.api.implementations;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
import appeng.api.config.Upgrades; import appeng.api.config.Upgrades;
import appeng.api.implementations.tiles.ISegmentedInventory; import appeng.api.implementations.tiles.ISegmentedInventory;
@@ -41,5 +41,5 @@ public interface IUpgradeableHost extends IConfigurableObject, ISegmentedInvento
* *
* @return tile entity * @return tile entity
*/ */
TileEntity getTile(); BlockEntity getTile();
} }
@@ -23,7 +23,7 @@
package appeng.api.implementations.guiobjects; package appeng.api.implementations.guiobjects;
import net.minecraftforge.items.IItemHandler; import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.networking.IGridHost; import appeng.api.networking.IGridHost;
@@ -33,5 +33,5 @@ import appeng.api.networking.IGridHost;
public interface INetworkTool extends IGuiItemObject { public interface INetworkTool extends IGuiItemObject {
IGridHost getGridHost(); // null for most purposes. IGridHost getGridHost(); // null for most purposes.
IItemHandler getInventory(); ItemTransferable getInventory();
} }
@@ -23,7 +23,7 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import net.minecraftforge.items.IItemHandler; import alexiil.mc.lib.attributes.item.ItemTransferable;
public interface ISegmentedInventory { public interface ISegmentedInventory {
@@ -36,5 +36,5 @@ public interface ISegmentedInventory {
* *
* @return inventory with inventory name * @return inventory with inventory name
*/ */
IItemHandler getInventoryByName(String name); ItemTransferable getInventoryByName(String name);
} }
@@ -23,7 +23,7 @@
package appeng.api.implementations.tiles; package appeng.api.implementations.tiles;
import net.minecraftforge.items.IItemHandler; import alexiil.mc.lib.attributes.item.ItemTransferable;
public interface IViewCellStorage { public interface IViewCellStorage {
@@ -32,5 +32,5 @@ public interface IViewCellStorage {
* *
* @return inventory with at least 5 slot * @return inventory with at least 5 slot
*/ */
IItemHandler getViewCellStorage(); ItemTransferable getViewCellStorage();
} }
@@ -23,7 +23,7 @@
package appeng.api.movable; package appeng.api.movable;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -38,7 +38,7 @@ public interface IMovableHandler {
* *
* @return true if it can handle moving * @return true if it can handle moving
*/ */
boolean canHandle(Class<? extends TileEntity> myClass, TileEntity tile); boolean canHandle(Class<? extends BlockEntity> myClass, BlockEntity tile);
/** /**
* request that the handler move the the tile from its current location to the * request that the handler move the the tile from its current location to the
@@ -64,5 +64,5 @@ public interface IMovableHandler {
* @param world world of tile * @param world world of tile
* @param newPosition the new location * @param newPosition the new location
*/ */
void moveTile(TileEntity tile, World world, BlockPos newPosition); void moveTile(BlockEntity tile, World world, BlockPos newPosition);
} }
@@ -24,7 +24,7 @@
package appeng.api.movable; package appeng.api.movable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
/** /**
* Used to determine if a tile is marked as movable, a block will be considered * Used to determine if a tile is marked as movable, a block will be considered
@@ -36,7 +36,7 @@ import net.minecraft.tileentity.TileEntity;
* 2. The Tile implements IMovableTile * 2. The Tile implements IMovableTile
* *
* 3. A IMovableHandler is register that returns canHandle = true for the * 3. A IMovableHandler is register that returns canHandle = true for the
* {@link TileEntity} subclass * {@link BlockEntity} subclass
* *
* *
* The movement process is as follows, * The movement process is as follows,
@@ -72,21 +72,21 @@ public interface IMovableRegistry {
* If you tile is handled with IMovableHandler or IMovableTile you do not need * If you tile is handled with IMovableHandler or IMovableTile you do not need
* to white list it. * to white list it.
*/ */
void whiteListTileEntity(Class<? extends TileEntity> c); void whiteListTileEntity(Class<? extends BlockEntity> c);
/** /**
* @param te to be moved tile entity * @param te to be moved tile entity
* *
* @return true if the tile has accepted your request to move it * @return true if the tile has accepted your request to move it
*/ */
boolean askToMove(TileEntity te); boolean askToMove(BlockEntity te);
/** /**
* tells the tile you are done moving it. * tells the tile you are done moving it.
* *
* @param te moved tile entity * @param te moved tile entity
*/ */
void doneMoving(TileEntity te); void doneMoving(BlockEntity te);
/** /**
* add a new handler movable handler. * add a new handler movable handler.
@@ -105,7 +105,7 @@ public interface IMovableRegistry {
* *
* @return moving handler of tile entity * @return moving handler of tile entity
*/ */
IMovableHandler getHandler(TileEntity te); IMovableHandler getHandler(BlockEntity te);
/** /**
* @return a copy of the default handler * @return a copy of the default handler
@@ -26,14 +26,14 @@ package appeng.api.networking;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
import appeng.api.parts.IPart; import appeng.api.parts.IPart;
import appeng.api.util.AECableType; import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
/** /**
* Implement to create a networked {@link TileEntity} or {@link IPart} must be * Implement to create a networked {@link BlockEntity} or {@link IPart} must be
* implemented for a part, or tile entity to become part of a grid. * implemented for a part, or tile entity to become part of a grid.
*/ */
public interface IGridHost { public interface IGridHost {
@@ -28,7 +28,7 @@ import java.util.EnumSet;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import appeng.api.IAppEngApi; import appeng.api.IAppEngApi;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
@@ -89,7 +89,7 @@ public interface IGridNode {
* @return the world the node is located in * @return the world the node is located in
*/ */
@Nonnull @Nonnull
IWorld getWorld(); WorldAccess getWorld();
/** /**
* @return a set of the connected sides, INTERNAL represents an invisible * @return a set of the connected sides, INTERNAL represents an invisible
@@ -23,7 +23,7 @@
package appeng.api.networking.crafting; package appeng.api.networking.crafting;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import appeng.api.networking.security.IActionSource; import appeng.api.networking.security.IActionSource;
import appeng.api.networking.storage.IBaseMonitor; import appeng.api.networking.storage.IBaseMonitor;
@@ -54,5 +54,5 @@ public interface ICraftingCPU extends IBaseMonitor<IAEItemStack> {
/** /**
* @return a null or the name of the cpu. * @return a null or the name of the cpu.
*/ */
ITextComponent getName(); Text getName();
} }
@@ -26,7 +26,7 @@ package appeng.api.parts;
import java.io.IOException; import java.io.IOException;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketByteBuf;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
@@ -75,7 +75,7 @@ public interface IFacadeContainer {
* *
* @throws IOException * @throws IOException
*/ */
boolean readFromStream(PacketBuffer data) throws IOException; boolean readFromStream(PacketByteBuf data) throws IOException;
/** /**
* read from NBT * read from NBT
@@ -91,7 +91,7 @@ public interface IFacadeContainer {
* *
* @throws IOException * @throws IOException
*/ */
void writeToStream(PacketBuffer data) throws IOException; void writeToStream(PacketByteBuf data) throws IOException;
/** /**
* @return true if there are no facades. * @return true if there are no facades.
+14 -30
View File
@@ -29,27 +29,24 @@ import java.util.Random;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import com.mojang.blaze3d.matrix.MatrixStack; import alexiil.mc.lib.attributes.AttributeList;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketByteBuf;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.model.data.EmptyModelData;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import appeng.api.networking.IGridNode; import appeng.api.networking.IGridNode;
import appeng.api.util.AECableType; import appeng.api.util.AECableType;
@@ -80,8 +77,8 @@ public interface IPart extends ICustomCableConnection {
* part has to return true for {@link #requireDynamicRender()} in order for this * part has to return true for {@link #requireDynamicRender()} in order for this
* method to be called. * method to be called.
*/ */
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
default void renderDynamic(float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffers, default void renderDynamic(float partialTicks, MatrixStack matrixStack, VertexConsumerProvider buffers,
int combinedLightIn, int combinedOverlayIn) { int combinedLightIn, int combinedOverlayIn) {
} }
@@ -155,7 +152,7 @@ public interface IPart extends ICustomCableConnection {
* *
* @throws IOException * @throws IOException
*/ */
void writeToStream(PacketBuffer data) throws IOException; void writeToStream(PacketByteBuf data) throws IOException;
/** /**
* read data from bus packet. * read data from bus packet.
@@ -166,7 +163,7 @@ public interface IPart extends ICustomCableConnection {
* *
* @throws IOException * @throws IOException
*/ */
boolean readFromStream(PacketBuffer data) throws IOException; boolean readFromStream(PacketByteBuf data) throws IOException;
/** /**
* get the Grid Node for the Bus, be sure your IGridBlock is NOT * get the Grid Node for the Bus, be sure your IGridBlock is NOT
@@ -209,7 +206,7 @@ public interface IPart extends ICustomCableConnection {
* @param host part side * @param host part side
* @param tile tile entity of part * @param tile tile entity of part
*/ */
void setPartHostInfo(AEPartLocation side, IPartHost host, TileEntity tile); void setPartHostInfo(AEPartLocation side, IPartHost host, BlockEntity tile);
/** /**
* Called when you right click the part, very similar to Block.onActivateBlock * Called when you right click the part, very similar to Block.onActivateBlock
@@ -345,24 +342,11 @@ public interface IPart extends ICustomCableConnection {
* capabilities on the cable bus will be forwarded to parts on the appropriate * capabilities on the cable bus will be forwarded to parts on the appropriate
* side. * side.
* *
* @see TileEntity#getCapability(Capability, net.minecraft.util.math.Direction) * @see alexiil.mc.lib.attributes.AttributeProvider
* *
* @return The capability or null. * @return The capability or null.
*/ */
default <T> LazyOptional<T> getCapability(Capability<T> capabilityClass) { default void addAllAttributes(AttributeList<?> to) {}
return LazyOptional.empty();
}
/**
* Additional model data to be passed to the models for rendering this part.
*
* @return The model data to pass to the model. Only useful if custom models are
* used.
*/
@Nonnull
default IModelData getModelData() {
return EmptyModelData.INSTANCE;
}
/** /**
* add your collision information to the the list. * add your collision information to the the list.
@@ -27,7 +27,7 @@ import java.util.Set;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
@@ -118,7 +118,7 @@ public interface IPartHost extends ICustomCableConnection {
* @return the tile entity for the host, this can either be an FMP tile, or a AE * @return the tile entity for the host, this can either be an FMP tile, or a AE
* tile * tile
*/ */
TileEntity getTile(); BlockEntity getTile();
/** /**
* @return the color of the host type ( this is determined by the middle cable. * @return the color of the host type ( this is determined by the middle cable.
@@ -28,10 +28,10 @@ import java.util.List;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
/** /**
* A container to store a collection of {@link ResourceLocation} as models for a * A container to store a collection of {@link Identifier} as models for a
* part as well as other properties. * part as well as other properties.
*/ */
public interface IPartModel { public interface IPartModel {
@@ -49,12 +49,12 @@ public interface IPartModel {
} }
/** /**
* A collection of {@link ResourceLocation} used as models for a part. * A collection of {@link Identifier} used as models for a part.
* *
* @return a collection of models, never null. * @return a collection of models, never null.
*/ */
@Nonnull @Nonnull
default List<ResourceLocation> getModels() { default List<Identifier> getModels() {
return Collections.emptyList(); return Collections.emptyList();
} }
@@ -21,7 +21,7 @@ package appeng.api.parts;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import appeng.api.AEInjectable; import appeng.api.AEInjectable;
@@ -41,12 +41,12 @@ public interface IPartModels {
* This method must be called during the pre-init phase (as part of your * This method must be called during the pre-init phase (as part of your
* plugin's constructor). * plugin's constructor).
*/ */
void registerModels(Collection<ResourceLocation> partModels); void registerModels(Collection<Identifier> partModels);
/** /**
* Convenience overload of {@link #registerModels(Collection)} * Convenience overload of {@link #registerModels(Collection)}
*/ */
default void registerModels(ResourceLocation... partModels) { default void registerModels(Identifier... partModels) {
registerModels(Arrays.asList(partModels)); registerModels(Arrays.asList(partModels));
} }
} }
@@ -25,8 +25,8 @@ package appeng.api.parts;
import java.util.Set; import java.util.Set;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.tileentity.TileEntityType; import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import appeng.api.util.AEPartLocation; import appeng.api.util.AEPartLocation;
@@ -38,10 +38,10 @@ import appeng.api.util.AEPartLocation;
* *
* TODO: Consider removing and replacing with capabilities. * TODO: Consider removing and replacing with capabilities.
*/ */
public abstract class LayerBase extends TileEntity // implements IPartHost public abstract class LayerBase extends BlockEntity // implements IPartHost
{ {
public LayerBase(TileEntityType<?> tileEntityTypeIn) { public LayerBase(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn); super(tileEntityTypeIn);
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
@@ -23,9 +23,9 @@ import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.server.ServerWorld; import net.minecraft.server.world.ServerWorld;
public interface ISpatialDimension { public interface ISpatialDimension {
ServerWorld getWorld(DimensionType cellDim); ServerWorld getWorld(DimensionType cellDim);
@@ -45,6 +45,6 @@ public interface ISpatialDimension {
* Adds a user-facing tooltip that describes this dimension so that a player can * Adds a user-facing tooltip that describes this dimension so that a player can
* keep storage cells apart. * keep storage cells apart.
*/ */
void addCellDimensionTooltip(DimensionType cellDim, List<ITextComponent> lines); void addCellDimensionTooltip(DimensionType cellDim, List<Text> lines);
} }
@@ -30,8 +30,7 @@ import javax.annotation.Nullable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketByteBuf;
import net.minecraftforge.fluids.FluidStack;
import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList; import appeng.api.storage.data.IItemList;
@@ -92,7 +91,7 @@ public interface IStorageChannel<T extends IAEStack<T>> {
* @throws IOException * @throws IOException
*/ */
@Nullable @Nullable
T readFromPacket(@Nonnull PacketBuffer input); T readFromPacket(@Nonnull PacketByteBuf input);
/** /**
* create from nbt data * create from nbt data
@@ -23,8 +23,8 @@
package appeng.api.storage.cells; package appeng.api.storage.cells;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.storage.IMEInventory; import appeng.api.storage.IMEInventory;
@@ -50,12 +50,12 @@ public interface ICellInventory<T extends IAEStack<T>> extends IMEInventory<T> {
/** /**
* @return access configured list * @return access configured list
*/ */
IItemHandler getConfigInventory(); ItemTransferable getConfigInventory();
/** /**
* @return access installed upgrades. * @return access installed upgrades.
*/ */
IItemHandler getUpgradesInventory(); ItemTransferable getUpgradesInventory();
/** /**
* @return How many bytes are used for each type? * @return How many bytes are used for each type?
@@ -23,8 +23,8 @@
package appeng.api.storage.cells; package appeng.api.storage.cells;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
@@ -47,7 +47,7 @@ public interface ICellWorkbenchItem {
* *
* onInventoryChange will be called when saving is needed. * onInventoryChange will be called when saving is needed.
*/ */
IItemHandler getUpgradesInventory(ItemStack is); ItemTransferable getUpgradesInventory(ItemStack is);
/** /**
* Used to extract, or mirror the contents of the work bench onto the cell. * Used to extract, or mirror the contents of the work bench onto the cell.
@@ -56,7 +56,7 @@ public interface ICellWorkbenchItem {
* *
* onInventoryChange will be called when saving is needed. * onInventoryChange will be called when saving is needed.
*/ */
IItemHandler getConfigInventory(ItemStack is); ItemTransferable getConfigInventory(ItemStack is);
/** /**
* @return the current fuzzy status. * @return the current fuzzy status.
@@ -23,8 +23,8 @@
package appeng.api.storage.data; package appeng.api.storage.data;
import alexiil.mc.lib.attributes.fluid.volume.FluidVolume;
import net.minecraft.fluid.Fluid; import net.minecraft.fluid.Fluid;
import net.minecraftforge.fluids.FluidStack;
/** /**
* An alternate version of FluidStack for AE to keep tabs on things easier, and * An alternate version of FluidStack for AE to keep tabs on things easier, and
@@ -45,7 +45,7 @@ public interface IAEFluidStack extends IAEStack<IAEFluidStack> {
* *
* @return new FluidStack * @return new FluidStack
*/ */
FluidStack getFluidStack(); FluidVolume getFluidStack();
/** /**
* Combines two IAEItemStacks via addition. * Combines two IAEItemStacks via addition.
@@ -27,7 +27,7 @@ import java.io.IOException;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer; import net.minecraft.network.PacketByteBuf;
import appeng.api.config.FuzzyMode; import appeng.api.config.FuzzyMode;
import appeng.api.storage.IStorageChannel; import appeng.api.storage.IStorageChannel;
@@ -162,7 +162,7 @@ public interface IAEStack<T extends IAEStack<T>> {
* *
* @throws IOException * @throws IOException
*/ */
void writeToPacket(PacketBuffer data); void writeToPacket(PacketByteBuf data);
/** /**
* Clone the Item / Fluid Stack * Clone the Item / Fluid Stack
@@ -18,7 +18,7 @@
package appeng.api.util; package appeng.api.util;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Box;
/** /**
* Mutable stand in for Axis Aligned BB, this was used to prevent GC Thrashing.. * Mutable stand in for Axis Aligned BB, this was used to prevent GC Thrashing..
@@ -35,8 +35,8 @@ public class AEAxisAlignedBB {
public double maxY; public double maxY;
public double maxZ; public double maxZ;
public AxisAlignedBB getBoundingBox() { public Box getBoundingBox() {
return new AxisAlignedBB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); return new Box(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);
} }
public AEAxisAlignedBB(final double a, final double b, final double c, final double d, final double e, public AEAxisAlignedBB(final double a, final double b, final double c, final double d, final double e,
@@ -54,7 +54,7 @@ public class AEAxisAlignedBB {
return new AEAxisAlignedBB(a, b, c, d, e, f); return new AEAxisAlignedBB(a, b, c, d, e, f);
} }
public static AEAxisAlignedBB fromBounds(final AxisAlignedBB bb) { public static AEAxisAlignedBB fromBounds(final Box bb) {
return new AEAxisAlignedBB(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ); return new AEAxisAlignedBB(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ);
} }
} }
@@ -26,8 +26,8 @@ package appeng.api.util;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.item.DyeColor; import net.minecraft.util.DyeColor;
/** /**
* List of all colors supported by AE, their names, and various colors for * List of all colors supported by AE, their names, and various colors for
@@ -75,25 +75,25 @@ public enum AEColor {
PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE, BLUE, BROWN, GREEN, RED, BLACK); PINK, GRAY, LIGHT_GRAY, CYAN, PURPLE, BLUE, BROWN, GREEN, RED, BLACK);
/** /**
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to * The {@link BakedQuad#getColorIndex() tint index} that can normally be used to
* get the {@link #blackVariant dark variant} of the apprioriate AE color. * get the {@link #blackVariant dark variant} of the apprioriate AE color.
*/ */
public static final int TINTINDEX_DARK = 1; public static final int TINTINDEX_DARK = 1;
/** /**
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to * The {@link BakedQuad#getColorIndex() tint index} that can normally be used to
* get the {@link #mediumVariant medium variant} of the apprioriate AE color. * get the {@link #mediumVariant medium variant} of the apprioriate AE color.
*/ */
public static final int TINTINDEX_MEDIUM = 2; public static final int TINTINDEX_MEDIUM = 2;
/** /**
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to * The {@link BakedQuad#getColorIndex() tint index} that can normally be used to
* get the {@link #whiteVariant bright variant} of the apprioriate AE color. * get the {@link #whiteVariant bright variant} of the apprioriate AE color.
*/ */
public static final int TINTINDEX_BRIGHT = 3; public static final int TINTINDEX_BRIGHT = 3;
/** /**
* The {@link BakedQuad#getTintIndex() tint index} that can normally be used to * The {@link BakedQuad#getColorIndex() tint index} that can normally be used to
* get a color between the {@link #mediumVariant medium} and * get a color between the {@link #mediumVariant medium} and
* {@link #whiteVariant bright variant} of the apprioriate AE color. * {@link #whiteVariant bright variant} of the apprioriate AE color.
*/ */
@@ -145,7 +145,7 @@ public enum AEColor {
* Will return a variant of this color based on the given tint index. * Will return a variant of this color based on the given tint index.
* *
* @param tintIndex A tint index as it can be used for * @param tintIndex A tint index as it can be used for
* {@link BakedQuad#getTintIndex()}. * {@link BakedQuad#getColorIndex()}.
* @return The appropriate color variant, or -1. * @return The appropriate color variant, or -1.
*/ */
public int getVariantByTintIndex(int tintIndex) { public int getVariantByTintIndex(int tintIndex) {
@@ -24,9 +24,9 @@
package appeng.api.util; package appeng.api.util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public interface AEColoredItemDefinition { public interface AEColoredItemDefinition {
@@ -41,9 +41,9 @@ public interface AEColoredItemDefinition {
Item item(AEColor color); Item item(AEColor color);
/** /**
* @return the {@link TileEntity} Class if applicable. * @return the {@link BlockEntity} Class if applicable.
*/ */
Class<? extends TileEntity> entity(AEColor color); Class<? extends BlockEntity> entity(AEColor color);
/** /**
* @return an {@link ItemStack} with specified quantity of this item. * @return an {@link ItemStack} with specified quantity of this item.
@@ -23,18 +23,18 @@
package appeng.api.util; package appeng.api.util;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.dimension.Dimension; import net.minecraft.world.dimension.DimensionType;
/** /**
* Represents a location in the Minecraft Universe * Represents a location in the Minecraft Universe
*/ */
public class DimensionalCoord extends WorldCoord { public class DimensionalCoord extends WorldCoord {
private final IWorld world; private final WorldAccess world;
private final Dimension dimension; private final DimensionType dimension;
public DimensionalCoord(final DimensionalCoord coordinate) { public DimensionalCoord(final DimensionalCoord coordinate) {
super(coordinate.x, coordinate.y, coordinate.z); super(coordinate.x, coordinate.y, coordinate.z);
@@ -42,19 +42,19 @@ public class DimensionalCoord extends WorldCoord {
this.dimension = coordinate.dimension; this.dimension = coordinate.dimension;
} }
public DimensionalCoord(final TileEntity tileEntity) { public DimensionalCoord(final BlockEntity tileEntity) {
super(tileEntity); super(tileEntity);
this.world = tileEntity.getWorld(); this.world = tileEntity.getWorld();
this.dimension = this.world.getDimension(); this.dimension = this.world.getDimension();
} }
public DimensionalCoord(final IWorld world, final int x, final int y, final int z) { public DimensionalCoord(final WorldAccess world, final int x, final int y, final int z) {
super(x, y, z); super(x, y, z);
this.world = world; this.world = world;
this.dimension = world.getDimension(); this.dimension = world.getDimension();
} }
public DimensionalCoord(final IWorld world, final BlockPos pos) { public DimensionalCoord(final WorldAccess world, final BlockPos pos) {
super(pos); super(pos);
this.world = world; this.world = world;
this.dimension = world.getDimension(); this.dimension = world.getDimension();
@@ -80,11 +80,11 @@ public class DimensionalCoord extends WorldCoord {
return "dimension=" + this.dimension + ", " + super.toString(); return "dimension=" + this.dimension + ", " + super.toString();
} }
public boolean isInWorld(final IWorld world) { public boolean isInWorld(final WorldAccess world) {
return this.world == world; return this.world == world;
} }
public IWorld getWorld() { public WorldAccess getWorld() {
return this.world; return this.world;
} }
@@ -25,7 +25,7 @@ package appeng.api.util;
import java.util.List; import java.util.List;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import appeng.api.storage.cells.ICellInventoryHandler; import appeng.api.storage.cells.ICellInventoryHandler;
import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IAEStack;
@@ -37,6 +37,6 @@ public interface IClientHelper {
* @param handler Cell handler. * @param handler Cell handler.
* @param lines List of lines to add to. * @param lines List of lines to add to.
*/ */
<T extends IAEStack<T>> void addCellInformation(ICellInventoryHandler<T> handler, List<ITextComponent> lines); <T extends IAEStack<T>> void addCellInformation(ICellInventoryHandler<T> handler, List<Text> lines);
} }
@@ -23,7 +23,7 @@
package appeng.api.util; package appeng.api.util;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.hit.HitResult;
/** /**
* Implement on Tile or part to customize if the info gui opens, or an action is * Implement on Tile or part to customize if the info gui opens, or an action is
@@ -31,5 +31,5 @@ import net.minecraft.util.math.RayTraceResult;
*/ */
public interface INetworkToolAgent { public interface INetworkToolAgent {
boolean showNetworkInfo(RayTraceResult where); boolean showNetworkInfo(HitResult where);
} }
@@ -23,7 +23,7 @@
package appeng.api.util; package appeng.api.util;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
/** /**
@@ -38,7 +38,7 @@ public class WorldCoord {
public int y; public int y;
public int z; public int z;
public WorldCoord(final TileEntity s) { public WorldCoord(final BlockEntity s) {
this(s.getPos()); this(s.getPos());
} }
+6
View File
@@ -51,6 +51,10 @@ allprojects {
repositories { repositories {
maven { url = "http://maven.fabricmc.net/" } maven { url = "http://maven.fabricmc.net/" }
maven {
name = "BuildCraft"
url = "https://mod-buildcraft.com/maven"
}
} }
minecraft { minecraft {
@@ -66,6 +70,8 @@ allprojects {
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}" modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
modCompile "alexiil.mc.lib:libblockattributes-all:0.7.0"
compile 'com.google.code.findbugs:jsr305:3.0.2' compile 'com.google.code.findbugs:jsr305:3.0.2'
} }
} }
+3 -3
View File
@@ -37,7 +37,7 @@ import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ToolType; import net.minecraftforge.common.ToolType;
@@ -105,7 +105,7 @@ public abstract class AEBaseBlock extends Block {
/** /**
* Rotates around the given Axis (usually the current up axis). * Rotates around the given Axis (usually the current up axis).
*/ */
public boolean rotateAroundFaceAxis(IWorld w, BlockPos pos, Direction face) { public boolean rotateAroundFaceAxis(WorldAccess w, BlockPos pos, Direction face) {
final IOrientable rotatable = this.getOrientable(w, pos); final IOrientable rotatable = this.getOrientable(w, pos);
if (rotatable != null && rotatable.canBeRotated()) { if (rotatable != null && rotatable.canBeRotated()) {
@@ -216,7 +216,7 @@ public abstract class AEBaseBlock extends Block {
return null; return null;
} }
protected boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, protected boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward,
final Direction up) { final Direction up) {
return true; return true;
} }
@@ -20,6 +20,7 @@ package appeng.block;
import java.util.List; import java.util.List;
import net.fabricmc.api.EnvType;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
@@ -29,10 +30,9 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.Environment;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
@@ -52,14 +52,14 @@ public class AEBaseBlockItem extends BlockItem {
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public final void addInformation(final ItemStack itemStack, final World world, final List<ITextComponent> toolTip, public final void addInformation(final ItemStack itemStack, final World world, final List<Text> toolTip,
final ITooltipFlag advancedTooltips) { final ITooltipFlag advancedTooltips) {
this.addCheckedInformation(itemStack, world, toolTip, advancedTooltips); this.addCheckedInformation(itemStack, world, toolTip, advancedTooltips);
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void addCheckedInformation(final ItemStack itemStack, final World world, final List<ITextComponent> toolTip, public void addCheckedInformation(final ItemStack itemStack, final World world, final List<Text> toolTip,
final ITooltipFlag advancedTooltips) { final ITooltipFlag advancedTooltips) {
this.blockType.addInformation(itemStack, world, toolTip, advancedTooltips); this.blockType.addInformation(itemStack, world, toolTip, advancedTooltips);
} }
@@ -21,16 +21,16 @@ package appeng.block;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.List; import java.util.List;
import net.fabricmc.api.EnvType;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.text.TranslatableText;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.Environment;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.config.AccessRestriction; import appeng.api.config.AccessRestriction;
@@ -45,7 +45,7 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
public AEBaseBlockItemChargeable(Block id, Properties props) { public AEBaseBlockItemChargeable(Block id, Properties props) {
super(id, props); super(id, props);
addPropertyOverride(new ResourceLocation("appliedenergistics2:fill_level"), (is, world, entity) -> { addPropertyOverride(new Identifier("appliedenergistics2:fill_level"), (is, world, entity) -> {
double curPower = getAECurrentPower(is); double curPower = getAECurrentPower(is);
double maxPower = getAEMaxPower(is); double maxPower = getAEMaxPower(is);
@@ -54,8 +54,8 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void addCheckedInformation(final ItemStack stack, final World world, final List<ITextComponent> lines, public void addCheckedInformation(final ItemStack stack, final World world, final List<Text> lines,
final ITooltipFlag advancedTooltips) { final ITooltipFlag advancedTooltips) {
double internalCurrentPower = 0; double internalCurrentPower = 0;
final double internalMaxPower = this.getMaxEnergyCapacity(); final double internalMaxPower = this.getMaxEnergyCapacity();
@@ -70,7 +70,7 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
lines.add(GuiText.StoredEnergy.textComponent() lines.add(GuiText.StoredEnergy.textComponent()
.appendText(':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower)) .appendText(':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower))
.appendSibling(new TranslationTextComponent(PowerUnits.AE.unlocalizedName)) .appendSibling(new TranslatableText(PowerUnits.AE.unlocalizedName))
.appendText(" - " + MessageFormat.format("{0,number,#.##%}", percent))); .appendText(" - " + MessageFormat.format("{0,number,#.##%}", percent)));
} }
} }
+12 -12
View File
@@ -29,21 +29,21 @@ import com.google.common.collect.Lists;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.DyeColor; import net.minecraft.util.DyeColor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemHandlerHelper;
@@ -102,7 +102,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
return null; return null;
} }
final TileEntity te = w.getTileEntity(pos); final BlockEntity te = w.getTileEntity(pos);
// FIXME: This gets called as part of building the block state cache // FIXME: This gets called as part of building the block state cache
if (this.tileEntityClass != null && this.tileEntityClass.isInstance(te)) { if (this.tileEntityClass != null && this.tileEntityClass.isInstance(te)) {
return this.tileEntityClass.cast(te); return this.tileEntityClass.cast(te);
@@ -112,7 +112,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
} }
@Override @Override
public final TileEntity createTileEntity(BlockState state, BlockView world) { public final BlockEntity createTileEntity(BlockState state, BlockView world) {
return this.tileEntityFactory.get(); return this.tileEntityFactory.get();
} }
@@ -145,9 +145,9 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
} }
@Override @Override
public boolean recolorBlock(BlockState state, final IWorld world, final BlockPos pos, final Direction side, public boolean recolorBlock(BlockState state, final WorldAccess world, final BlockPos pos, final Direction side,
final DyeColor color) { final DyeColor color) {
final TileEntity te = this.getTileEntity(world, pos); final BlockEntity te = this.getTileEntity(world, pos);
if (te instanceof IColorableTile) { if (te instanceof IColorableTile) {
final IColorableTile ct = (IColorableTile) te; final IColorableTile ct = (IColorableTile) te;
@@ -166,7 +166,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
@Override @Override
public int getComparatorOutput(BlockState state, final World w, final BlockPos pos) { public int getComparatorOutput(BlockState state, final World w, final BlockPos pos) {
final TileEntity te = this.getTileEntity(w, pos); final BlockEntity te = this.getTileEntity(w, pos);
if (te instanceof AEBaseInvTileEntity) { if (te instanceof AEBaseInvTileEntity) {
AEBaseInvTileEntity invTile = (AEBaseInvTileEntity) te; AEBaseInvTileEntity invTile = (AEBaseInvTileEntity) te;
if (invTile.getInternalInventory().getSlots() > 0) { if (invTile.getInternalInventory().getSlots() > 0) {
@@ -180,7 +180,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
public boolean eventReceived(final BlockState state, final World worldIn, final BlockPos pos, final int eventID, public boolean eventReceived(final BlockState state, final World worldIn, final BlockPos pos, final int eventID,
final int eventParam) { final int eventParam) {
super.eventReceived(state, worldIn, pos, eventID, eventParam); super.eventReceived(state, worldIn, pos, eventID, eventParam);
final TileEntity tileentity = worldIn.getTileEntity(pos); final BlockEntity tileentity = worldIn.getTileEntity(pos);
return tileentity != null ? tileentity.receiveClientEvent(eventID, eventParam) : false; return tileentity != null ? tileentity.receiveClientEvent(eventID, eventParam) : false;
} }
@@ -194,7 +194,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
// I18N strings and we would translate it using the server's locale :-( // I18N strings and we would translate it using the server's locale :-(
AEBaseTileEntity te = this.getTileEntity(w, pos); AEBaseTileEntity te = this.getTileEntity(w, pos);
if (te != null && is.hasDisplayName()) { if (te != null && is.hasDisplayName()) {
ITextComponent displayName = is.getDisplayName(); Text displayName = is.getDisplayName();
if (displayName instanceof StringTextComponent) { if (displayName instanceof StringTextComponent) {
te.setName(((StringTextComponent) displayName).getText()); te.setName(((StringTextComponent) displayName).getText());
} }
@@ -291,7 +291,7 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
* returned unchanged, this is also the case if the given block state does not * returned unchanged, this is also the case if the given block state does not
* belong to this block. * belong to this block.
*/ */
public final BlockState getTileEntityBlockState(BlockState current, TileEntity te) { public final BlockState getTileEntityBlockState(BlockState current, BlockEntity te) {
if (current.getBlock() != this || !tileEntityClass.isInstance(te)) { if (current.getBlock() != this || !tileEntityClass.isInstance(te)) {
return current; return current;
} }
@@ -23,21 +23,21 @@ import javax.annotation.Nullable;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Box;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayer;
@@ -95,8 +95,8 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
} }
@Override @Override
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) { public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
final TileEntity te = w.getTileEntity(pos); final BlockEntity te = w.getTileEntity(pos);
return !(te instanceof CrankTileEntity) || this.isCrankable(w, pos, up.getOpposite()); return !(te instanceof CrankTileEntity) || this.isCrankable(w, pos, up.getOpposite());
} }
@@ -111,7 +111,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
private boolean isCrankable(final BlockView world, final BlockPos pos, final Direction offset) { private boolean isCrankable(final BlockView world, final BlockPos pos, final Direction offset) {
final BlockPos o = pos.offset(offset); final BlockPos o = pos.offset(offset);
final TileEntity te = world.getTileEntity(o); final BlockEntity te = world.getTileEntity(o);
return te instanceof ICrankable && ((ICrankable) te).canCrankAttach(offset.getOpposite()); return te instanceof ICrankable && ((ICrankable) te).canCrankAttach(offset.getOpposite());
} }
@@ -156,7 +156,7 @@ public class CrankBlock extends AEBaseTileBlock<CrankTileEntity> {
final double yOff = -0.15 * up.getYOffset(); final double yOff = -0.15 * up.getYOffset();
final double zOff = -0.15 * up.getZOffset(); final double zOff = -0.15 * up.getZOffset();
return VoxelShapes.create( return VoxelShapes.create(
new AxisAlignedBB(xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85)); new Box(xOff + 0.15, yOff + 0.15, zOff + 0.15, xOff + 0.85, yOff + 0.85, zOff + 0.85));
} }
} }
@@ -23,6 +23,9 @@ import java.util.function.Function;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.util.math.Box;
import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
@@ -38,7 +41,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
@@ -46,8 +48,6 @@ import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.AEApi; import appeng.api.AEApi;
import appeng.api.util.AEAxisAlignedBB; import appeng.api.util.AEAxisAlignedBB;
@@ -91,7 +91,7 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) { public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
if (!AEConfig.instance().isEnableEffects()) { if (!AEConfig.instance().isEnableEffects()) {
return; return;
@@ -168,21 +168,21 @@ public class ChargerBlock extends AEBaseTileBlock<ChargerTileEntity> {
return VoxelShapes.create(bb.getBoundingBox()); return VoxelShapes.create(bb.getBoundingBox());
} }
return VoxelShapes.create(new AxisAlignedBB(0.0, 0, 0.0, 1.0, 1.0, 1.0)); return VoxelShapes.create(new Box(0.0, 0, 0.0, 1.0, 1.0, 1.0));
} }
@Override @Override
public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos, public VoxelShape getCollisionShape(BlockState state, BlockView worldIn, BlockPos pos,
ShapeContext context) { ShapeContext context) {
return VoxelShapes.create(new AxisAlignedBB(0.0, 0.0, 0.0, 1.0, 1.0, 1.0)); return VoxelShapes.create(new Box(0.0, 0.0, 0.0, 1.0, 1.0, 1.0));
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public static Function<TileEntityRendererDispatcher, TileEntityRenderer<ChargerTileEntity>> createTesr() { public static Function<TileEntityRendererDispatcher, TileEntityRenderer<ChargerTileEntity>> createTesr() {
return dispatcher -> new ModularTESR<>(dispatcher, new ItemRenderable<>(ChargerBlock::getRenderedItem)); return dispatcher -> new ModularTESR<>(dispatcher, new ItemRenderable<>(ChargerBlock::getRenderedItem));
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private static Pair<ItemStack, TransformationMatrix> getRenderedItem(ChargerTileEntity tile) { private static Pair<ItemStack, TransformationMatrix> getRenderedItem(ChargerTileEntity tile) {
TransformationMatrix transform = new TransformationMatrix(new Vector3f(0.5f, 0.375f, 0.5f), null, null, null); TransformationMatrix transform = new TransformationMatrix(new Vector3f(0.5f, 0.375f, 0.5f), null, null, null);
return new ImmutablePair<>(tile.getInternalInventory().getStackInSlot(0), transform); return new ImmutablePair<>(tile.getInternalInventory().getStackInSlot(0), transform);
@@ -1,8 +1,8 @@
package appeng.block.misc; package appeng.block.misc;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.bootstrap.TileEntityRendering; import appeng.bootstrap.TileEntityRendering;
import appeng.bootstrap.TileEntityRenderingCustomizer; import appeng.bootstrap.TileEntityRenderingCustomizer;
@@ -11,7 +11,7 @@ import appeng.tile.misc.InscriberTileEntity;
public class InscriberRendering extends TileEntityRenderingCustomizer<InscriberTileEntity> { public class InscriberRendering extends TileEntityRenderingCustomizer<InscriberTileEntity> {
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
@Override @Override
public void customize(TileEntityRendering<InscriberTileEntity> rendering) { public void customize(TileEntityRendering<InscriberTileEntity> rendering) {
rendering.tileEntityRenderer(InscriberTESR::new); rendering.tileEntityRenderer(InscriberTESR::new);
@@ -26,14 +26,14 @@ import net.minecraft.block.Material;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -87,7 +87,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
} }
@Override @Override
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) { public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
return this.canPlaceAt(w, pos, up.getOpposite()); return this.canPlaceAt(w, pos, up.getOpposite());
} }
@@ -108,7 +108,7 @@ public class LightDetectorBlock extends AEBaseTileBlock<LightDetectorTileEntity>
final double yOff = -0.3 * up.getYOffset(); final double yOff = -0.3 * up.getYOffset();
final double zOff = -0.3 * up.getZOffset(); final double zOff = -0.3 * up.getZOffset();
return VoxelShapes return VoxelShapes
.create(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7)); .create(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
} }
@Override @Override
@@ -34,18 +34,18 @@ import net.minecraft.state.BooleanProperty;
import net.minecraft.state.DirectionProperty; import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.api.util.IOrientable; import appeng.api.util.IOrientable;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
@@ -68,7 +68,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
final double yOff = -0.3 * facing.getYOffset(); final double yOff = -0.3 * facing.getYOffset();
final double zOff = -0.3 * facing.getZOffset(); final double zOff = -0.3 * facing.getZOffset();
VoxelShape shape = VoxelShapes VoxelShape shape = VoxelShapes
.create(new AxisAlignedBB(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7)); .create(new Box(xOff + 0.3, yOff + 0.3, zOff + 0.3, xOff + 0.7, yOff + 0.7, zOff + 0.7));
SHAPES.put(facing, shape); SHAPES.put(facing, shape);
} }
} }
@@ -117,7 +117,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
// Break the fixture if the block it is attached to is changed so that it could // Break the fixture if the block it is attached to is changed so that it could
// no longer be placed // no longer be placed
@Override @Override
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld worldIn, public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, WorldAccess worldIn,
BlockPos pos, BlockPos facingPos) { BlockPos pos, BlockPos facingPos) {
Direction fixtureFacing = state.get(FACING); Direction fixtureFacing = state.get(FACING);
if (facing.getOpposite() == fixtureFacing && !canPlaceAt(worldIn, pos, facing)) { if (facing.getOpposite() == fixtureFacing && !canPlaceAt(worldIn, pos, facing)) {
@@ -127,7 +127,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
} }
@Override @Override
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) { public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
// FIXME: I think this entire method -> not required, but not sure... are quartz // FIXME: I think this entire method -> not required, but not sure... are quartz
// fixtures rotateable??? // fixtures rotateable???
return this.canPlaceAt(w, pos, up.getOpposite()); return this.canPlaceAt(w, pos, up.getOpposite());
@@ -146,7 +146,7 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) { public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
if (!AEConfig.instance().isEnableEffects()) { if (!AEConfig.instance().isEnableEffects()) {
return; return;
@@ -20,6 +20,7 @@ package appeng.block.misc;
import java.util.Random; import java.util.Random;
import net.fabricmc.api.EnvType;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.BlockSoundGroup;
@@ -30,8 +31,7 @@ import net.minecraft.state.StateContainer;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
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.api.distmarker.Dist; import net.fabricmc.api.Environment;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.IOrientableBlock; import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
@@ -62,7 +62,7 @@ public class QuartzGrowthAcceleratorBlock extends AEBaseTileBlock<QuartzGrowthAc
builder.add(POWERED); builder.add(POWERED);
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
@Override @Override
public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) { public void animateTick(final BlockState state, final World w, final BlockPos pos, final Random r) {
if (!AEConfig.instance().isEnableEffects()) { if (!AEConfig.instance().isEnableEffects()) {
@@ -18,9 +18,9 @@
package appeng.block.misc; package appeng.block.misc;
import net.fabricmc.api.EnvType;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.Environment;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.bootstrap.BlockRenderingCustomizer; import appeng.bootstrap.BlockRenderingCustomizer;
@@ -32,7 +32,7 @@ import appeng.client.render.StaticItemColor;
public class SecurityStationRendering extends BlockRenderingCustomizer { public class SecurityStationRendering extends BlockRenderingCustomizer {
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void customize(IBlockRendering rendering, IItemRendering itemRendering) { public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
rendering.renderType(RenderType.getCutout()); rendering.renderType(RenderType.getCutout());
rendering.blockColor(ColorableTileBlockColor.INSTANCE); rendering.blockColor(ColorableTileBlockColor.INSTANCE);
@@ -22,13 +22,13 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Box;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -42,7 +42,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
} }
@Override @Override
public boolean isValidOrientation(final IWorld w, final BlockPos pos, final Direction forward, final Direction up) { public boolean isValidOrientation(final WorldAccess w, final BlockPos pos, final Direction forward, final Direction up) {
final SkyCompassTileEntity sc = this.getTileEntity(w, pos); final SkyCompassTileEntity sc = this.getTileEntity(w, pos);
if (sc != null) { if (sc != null) {
return false; return false;
@@ -139,7 +139,7 @@ public class SkyCompassBlock extends AEBaseTileBlock<SkyCompassTileEntity> {
break; break;
} }
return VoxelShapes.create(new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ)); return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
} }
return VoxelShapes.empty(); return VoxelShapes.empty();
} }
@@ -18,8 +18,8 @@
package appeng.block.misc; package appeng.block.misc;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.bootstrap.TileEntityRendering; import appeng.bootstrap.TileEntityRendering;
import appeng.bootstrap.TileEntityRenderingCustomizer; import appeng.bootstrap.TileEntityRenderingCustomizer;
@@ -29,7 +29,7 @@ import appeng.tile.misc.SkyCompassTileEntity;
public class SkyCompassRendering extends TileEntityRenderingCustomizer<SkyCompassTileEntity> { public class SkyCompassRendering extends TileEntityRenderingCustomizer<SkyCompassTileEntity> {
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void customize(TileEntityRendering<SkyCompassTileEntity> rendering) { public void customize(TileEntityRendering<SkyCompassTileEntity> rendering) {
rendering.tileEntityRenderer(SkyCompassTESR::new); rendering.tileEntityRenderer(SkyCompassTESR::new);
} }
@@ -32,7 +32,7 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents; import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Box;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
@@ -41,7 +41,7 @@ import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.Explosion; import net.minecraft.world.Explosion;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld; import net.minecraft.server.world.ServerWorld;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
import appeng.entity.TinyTNTPrimedEntity; import appeng.entity.TinyTNTPrimedEntity;
@@ -49,7 +49,7 @@ import appeng.entity.TinyTNTPrimedEntity;
public class TinyTNTBlock extends AEBaseBlock { public class TinyTNTBlock extends AEBaseBlock {
private static final VoxelShape SHAPE = VoxelShapes private static final VoxelShape SHAPE = VoxelShapes
.create(new AxisAlignedBB(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f)); .create(new Box(0.25f, 0.0f, 0.25f, 0.75f, 0.5f, 0.75f));
public TinyTNTBlock(Settings props) { public TinyTNTBlock(Settings props) {
super(props); super(props);
@@ -24,37 +24,37 @@ import java.util.Random;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleManager; import net.minecraft.client.particle.ParticleManager;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.render.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.IFluidState; import net.minecraft.fluid.IFluidState;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.DyeColor; import net.minecraft.util.DyeColor;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.*; import net.minecraft.util.math.*;
import net.minecraft.util.math.RayTraceResult.Type; import net.minecraft.util.hit.HitResult.Type;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.parts.IFacadeContainer; import appeng.api.parts.IFacadeContainer;
import appeng.api.parts.IFacadePart; import appeng.api.parts.IFacadePart;
@@ -166,7 +166,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public ItemStack getPickBlock(BlockState state, RayTraceResult target, BlockView world, BlockPos pos, public ItemStack getPickBlock(BlockState state, HitResult target, BlockView world, BlockPos pos,
PlayerEntity player) { PlayerEntity player) {
final Vec3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ()); final Vec3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ());
final SelectedPart sp = this.cb(world, pos).selectPart(v3); final SelectedPart sp = this.cb(world, pos).selectPart(v3);
@@ -181,8 +181,8 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public boolean addHitEffects(final BlockState state, final World world, final RayTraceResult target, public boolean addHitEffects(final BlockState state, final World world, final HitResult target,
final ParticleManager effectRenderer) { final ParticleManager effectRenderer) {
// Half the particle rate. Since we're spawning concentrated on a specific spot, // Half the particle rate. Since we're spawning concentrated on a specific spot,
@@ -226,7 +226,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
return true; return true;
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
@Override @Override
public boolean addDestroyEffects(BlockState state, World world, BlockPos pos, ParticleManager effectRenderer) { public boolean addDestroyEffects(BlockState state, World world, BlockPos pos, ParticleManager effectRenderer) {
ICableBusContainer cb = this.cb(world, pos); ICableBusContainer cb = this.cb(world, pos);
@@ -281,7 +281,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
private ICableBusContainer cb(final BlockView w, final BlockPos pos) { private ICableBusContainer cb(final BlockView w, final BlockPos pos) {
final TileEntity te = w.getTileEntity(pos); final BlockEntity te = w.getTileEntity(pos);
ICableBusContainer out = null; ICableBusContainer out = null;
if (te instanceof CableBusTileEntity) { if (te instanceof CableBusTileEntity) {
@@ -293,7 +293,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
@Nullable @Nullable
private IFacadeContainer fc(final BlockView w, final BlockPos pos) { private IFacadeContainer fc(final BlockView w, final BlockPos pos) {
final TileEntity te = w.getTileEntity(pos); final BlockEntity te = w.getTileEntity(pos);
IFacadeContainer out = null; IFacadeContainer out = null;
if (te instanceof CableBusTileEntity) { if (te instanceof CableBusTileEntity) {
@@ -306,7 +306,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
@Override @Override
public void onBlockClicked(BlockState state, World worldIn, BlockPos pos, PlayerEntity player) { public void onBlockClicked(BlockState state, World worldIn, BlockPos pos, PlayerEntity player) {
if (worldIn.isRemote()) { if (worldIn.isRemote()) {
final RayTraceResult rtr = Minecraft.getInstance().objectMouseOver; final HitResult rtr = Minecraft.getInstance().objectMouseOver;
if (rtr instanceof BlockRayTraceResult) { if (rtr instanceof BlockRayTraceResult) {
BlockRayTraceResult brtr = (BlockRayTraceResult) rtr; BlockRayTraceResult brtr = (BlockRayTraceResult) rtr;
if (brtr.getPos().equals(pos)) { if (brtr.getPos().equals(pos)) {
@@ -335,7 +335,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
public boolean recolorBlock(BlockState state, IWorld world, BlockPos pos, Direction side, DyeColor color) { public boolean recolorBlock(BlockState state, WorldAccess world, BlockPos pos, Direction side, DyeColor color) {
return recolorBlock(world, pos, side, color, null); return recolorBlock(world, pos, side, color, null);
} }
@@ -349,7 +349,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) { public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
// do nothing // do nothing
} }
@@ -21,12 +21,12 @@ package appeng.block.networking;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader; import net.minecraft.world.ILightReader;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.parts.CableBusContainer; import appeng.parts.CableBusContainer;
@@ -36,7 +36,7 @@ import appeng.tile.networking.CableBusTileEntity;
* Exposes the cable bus color as tint indices 0 (dark variant), 1 (medium * Exposes the cable bus color as tint indices 0 (dark variant), 1 (medium
* variant) and 2 (bright variant). * variant) and 2 (bright variant).
*/ */
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public class CableBusColor implements IBlockColor { public class CableBusColor implements IBlockColor {
@Override @Override
@@ -45,7 +45,7 @@ public class CableBusColor implements IBlockColor {
AEColor busColor = AEColor.TRANSPARENT; AEColor busColor = AEColor.TRANSPARENT;
if (worldIn != null && pos != null) { if (worldIn != null && pos != null) {
TileEntity tileEntity = worldIn.getTileEntity(pos); BlockEntity tileEntity = worldIn.getTileEntity(pos);
if (tileEntity instanceof CableBusTileEntity) { if (tileEntity instanceof CableBusTileEntity) {
CableBusContainer container = ((CableBusTileEntity) tileEntity).getCableBus(); CableBusContainer container = ((CableBusTileEntity) tileEntity).getCableBus();
busColor = container.getColor(); busColor = container.getColor();
@@ -18,8 +18,8 @@
package appeng.block.networking; package appeng.block.networking;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.bootstrap.BlockRenderingCustomizer; import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering; import appeng.bootstrap.IBlockRendering;
@@ -32,7 +32,7 @@ import appeng.bootstrap.IItemRendering;
public class CableBusRendering extends BlockRenderingCustomizer { public class CableBusRendering extends BlockRenderingCustomizer {
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void customize(IBlockRendering rendering, IItemRendering itemRendering) { public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
rendering.renderType(rt -> true); rendering.renderType(rt -> true);
@@ -26,7 +26,7 @@ import net.minecraft.state.StateContainer;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorld; import net.minecraft.world.WorldAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
@@ -86,7 +86,7 @@ public class ControllerBlock extends AEBaseTileBlock<ControllerTileEntity> {
* texture feel for the controller based on how it is placed. * texture feel for the controller based on how it is placed.
*/ */
@Override @Override
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, WorldAccess world,
BlockPos pos, BlockPos facingPos) { BlockPos pos, BlockPos facingPos) {
// FIXME: this might work, or might _NOT_ work, but needs to be investigated // FIXME: this might work, or might _NOT_ work, but needs to be investigated
@@ -18,6 +18,8 @@
package appeng.block.networking; package appeng.block.networking;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
@@ -26,8 +28,6 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.state.IntegerProperty; import net.minecraft.state.IntegerProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
import appeng.helpers.AEGlassMaterial; import appeng.helpers.AEGlassMaterial;
@@ -42,7 +42,7 @@ public class EnergyCellBlock extends AEBaseTileBlock<EnergyCellTileEntity> {
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) { public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
super.fillItemGroup(group, itemStacks); super.fillItemGroup(group, itemStacks);
@@ -27,7 +27,7 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.IStringSerializable; import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Box;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
@@ -153,7 +153,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
break; break;
} }
return VoxelShapes.create(new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ)); return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
} }
return VoxelShapes.empty(); return VoxelShapes.empty();
} }
@@ -213,7 +213,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
break; break;
} }
return VoxelShapes.create(new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ)); return VoxelShapes.create(new Box(minX, minY, minZ, maxX, maxY, maxZ));
} else { } else {
return VoxelShapes.empty(); return VoxelShapes.empty();
} }
@@ -2,8 +2,8 @@
package appeng.block.networking; package appeng.block.networking;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.bootstrap.BlockRenderingCustomizer; import appeng.bootstrap.BlockRenderingCustomizer;
@@ -13,7 +13,7 @@ import appeng.client.render.StaticBlockColor;
public class WirelessRendering extends BlockRenderingCustomizer { public class WirelessRendering extends BlockRenderingCustomizer {
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void customize(IBlockRendering rendering, IItemRendering itemRendering) { public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
rendering.renderType(RenderType.getCutout()); rendering.renderType(RenderType.getCutout());
rendering.blockColor(new StaticBlockColor(AEColor.TRANSPARENT)); rendering.blockColor(new StaticBlockColor(AEColor.TRANSPARENT));
@@ -13,13 +13,13 @@ import javax.annotation.Nullable;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.render.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material; import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture; import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.data.IDynamicBakedModel; import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
@@ -36,11 +36,11 @@ import appeng.tile.misc.PaintSplotchesTileEntity;
class PaintSplotchesBakedModel implements IDynamicBakedModel { class PaintSplotchesBakedModel implements IDynamicBakedModel {
private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/paint1")); new Identifier(AppEng.MOD_ID, "block/paint1"));
private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/paint2")); new Identifier(AppEng.MOD_ID, "block/paint2"));
private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/paint3")); new Identifier(AppEng.MOD_ID, "block/paint3"));
private final TextureAtlasSprite[] textures; private final TextureAtlasSprite[] textures;
@@ -33,8 +33,8 @@ import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
import appeng.tile.misc.PaintSplotchesTileEntity; import appeng.tile.misc.PaintSplotchesTileEntity;
@@ -48,7 +48,7 @@ public class PaintSplotchesBlock extends AEBaseTileBlock<PaintSplotchesTileEntit
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) { public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
// do nothing // do nothing
} }
@@ -7,14 +7,14 @@ import java.util.function.Function;
import com.mojang.datafixers.util.Pair; import com.mojang.datafixers.util.Pair;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.render.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform; import net.minecraft.client.render.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel; import net.minecraft.client.render.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.render.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material; import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.client.render.model.ModelBakery;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraftforge.client.model.IModelConfiguration; import net.minecraftforge.client.model.IModelConfiguration;
import net.minecraftforge.client.model.geometry.IModelGeometry; import net.minecraftforge.client.model.geometry.IModelGeometry;
@@ -23,13 +23,13 @@ public class PaintSplotchesModel implements IModelGeometry<PaintSplotchesModel>
@Override @Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) { ItemOverrideList overrides, Identifier modelLocation) {
return new PaintSplotchesBakedModel(spriteGetter); return new PaintSplotchesBakedModel(spriteGetter);
} }
@Override @Override
public Collection<Material> getTextures(IModelConfiguration owner, public Collection<Material> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) { Function<Identifier, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return PaintSplotchesBakedModel.getRequiredTextures(); return PaintSplotchesBakedModel.getRequiredTextures();
} }
@@ -2,8 +2,8 @@
package appeng.block.paint; package appeng.block.paint;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.bootstrap.BlockRenderingCustomizer; import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering; import appeng.bootstrap.IBlockRendering;
@@ -12,7 +12,7 @@ import appeng.bootstrap.IItemRendering;
public class PaintSplotchesRendering extends BlockRenderingCustomizer { public class PaintSplotchesRendering extends BlockRenderingCustomizer {
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void customize(IBlockRendering rendering, IItemRendering itemRendering) { public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
rendering.renderType(RenderType.getCutout()); rendering.renderType(RenderType.getCutout());
// Disable auto rotation // Disable auto rotation
@@ -14,14 +14,14 @@ import com.google.common.collect.ImmutableList;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.render.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.render.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material; import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture; import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.data.IDynamicBakedModel; import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.client.model.data.IModelData;
@@ -33,17 +33,17 @@ import appeng.tile.qnb.QuantumBridgeTileEntity;
class QnbFormedBakedModel implements IDynamicBakedModel { class QnbFormedBakedModel implements IDynamicBakedModel {
private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/quantum_link")); new Identifier(AppEng.MOD_ID, "block/quantum_link"));
private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring")); new Identifier(AppEng.MOD_ID, "block/quantum_ring"));
private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring_light")); new Identifier(AppEng.MOD_ID, "block/quantum_ring_light"));
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring_light_corner")); new Identifier(AppEng.MOD_ID, "block/quantum_ring_light_corner"));
private static final Material TEXTURE_CABLE_GLASS = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_CABLE_GLASS = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "parts/cable/glass/transparent")); new Identifier(AppEng.MOD_ID, "parts/cable/glass/transparent"));
private static final Material TEXTURE_COVERED_CABLE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, private static final Material TEXTURE_COVERED_CABLE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "parts/cable/covered/transparent")); new Identifier(AppEng.MOD_ID, "parts/cable/covered/transparent"));
private static final float DEFAULT_RENDER_MIN = 2.0f; private static final float DEFAULT_RENDER_MIN = 2.0f;
private static final float DEFAULT_RENDER_MAX = 14.0f; private static final float DEFAULT_RENDER_MAX = 14.0f;
@@ -7,14 +7,14 @@ import java.util.function.Function;
import com.mojang.datafixers.util.Pair; import com.mojang.datafixers.util.Pair;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.render.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform; import net.minecraft.client.render.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel; import net.minecraft.client.render.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList; import net.minecraft.client.render.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material; import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.client.render.model.ModelBakery;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraftforge.client.model.IModelConfiguration; import net.minecraftforge.client.model.IModelConfiguration;
import net.minecraftforge.client.model.geometry.IModelGeometry; import net.minecraftforge.client.model.geometry.IModelGeometry;
@@ -22,19 +22,19 @@ import appeng.core.AppEng;
public class QnbFormedModel implements IModelGeometry<QnbFormedModel> { public class QnbFormedModel implements IModelGeometry<QnbFormedModel> {
private static final ResourceLocation MODEL_RING = new ResourceLocation(AppEng.MOD_ID, "block/qnb/ring"); private static final Identifier MODEL_RING = new Identifier(AppEng.MOD_ID, "block/qnb/ring");
@Override @Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) { ItemOverrideList overrides, Identifier modelLocation) {
IBakedModel ringModel = bakery.getBakedModel(MODEL_RING, modelTransform, spriteGetter); IBakedModel ringModel = bakery.getBakedModel(MODEL_RING, modelTransform, spriteGetter);
return new QnbFormedBakedModel(ringModel, spriteGetter); return new QnbFormedBakedModel(ringModel, spriteGetter);
} }
@Override @Override
public Collection<Material> getTextures(IModelConfiguration owner, public Collection<Material> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) { Function<Identifier, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return QnbFormedBakedModel.getRequiredTextures(); return QnbFormedBakedModel.getRequiredTextures();
} }
@@ -22,7 +22,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer; import net.minecraft.state.StateContainer;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Box;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
@@ -41,7 +41,7 @@ public abstract class QuantumBaseBlock extends AEBaseTileBlock<QuantumBridgeTile
static { static {
final float shave = 2.0f / 16.0f; final float shave = 2.0f / 16.0f;
SHAPE = VoxelShapes.create(new AxisAlignedBB(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave)); SHAPE = VoxelShapes.create(new Box(shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave));
} }
public QuantumBaseBlock(Settings props) { public QuantumBaseBlock(Settings props) {
@@ -2,8 +2,8 @@
package appeng.block.qnb; package appeng.block.qnb;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.bootstrap.BlockRenderingCustomizer; import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering; import appeng.bootstrap.IBlockRendering;
@@ -12,7 +12,7 @@ import appeng.bootstrap.IItemRendering;
public class QuantumBridgeRendering extends BlockRenderingCustomizer { public class QuantumBridgeRendering extends BlockRenderingCustomizer {
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void customize(IBlockRendering rendering, IItemRendering itemRendering) { public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
rendering.renderType(RenderType.getCutout()); rendering.renderType(RenderType.getCutout());
// Disable auto rotation // Disable auto rotation
@@ -27,7 +27,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Box;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
@@ -52,7 +52,7 @@ public class QuantumLinkChamberBlock extends QuantumBaseBlock {
static { static {
final double onePixel = 2.0 / 16.0; final double onePixel = 2.0 / 16.0;
SHAPE = VoxelShapes.create( SHAPE = VoxelShapes.create(
new AxisAlignedBB(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); new Box(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
} }
public QuantumLinkChamberBlock() { public QuantumLinkChamberBlock() {
@@ -20,7 +20,7 @@ package appeng.block.qnb;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Box;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
@@ -52,6 +52,6 @@ public class QuantumRingBlock extends QuantumBaseBlock {
private static VoxelShape createShape(double onePixel) { private static VoxelShape createShape(double onePixel) {
return VoxelShapes.create( return VoxelShapes.create(
new AxisAlignedBB(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel)); new Box(onePixel, onePixel, onePixel, 1.0 - onePixel, 1.0 - onePixel, 1.0 - onePixel));
} }
} }
@@ -18,6 +18,7 @@
package appeng.block.spatial; package appeng.block.spatial;
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
@@ -35,8 +36,7 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.IWorldReader; import net.minecraft.world.IWorldReader;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.block.AEBaseBlock; import appeng.block.AEBaseBlock;
@@ -59,7 +59,7 @@ public class MatrixFrameBlock extends AEBaseBlock {
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) { public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> itemStacks) {
// do nothing // do nothing
} }
@@ -18,9 +18,9 @@
package appeng.block.storage; package appeng.block.storage;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.util.AEColor; import appeng.api.util.AEColor;
import appeng.bootstrap.BlockRenderingCustomizer; import appeng.bootstrap.BlockRenderingCustomizer;
@@ -32,7 +32,7 @@ import appeng.client.render.StaticItemColor;
public class ChestRendering extends BlockRenderingCustomizer { public class ChestRendering extends BlockRenderingCustomizer {
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public void customize(IBlockRendering rendering, IItemRendering itemRendering) { public void customize(IBlockRendering rendering, IItemRendering itemRendering) {
rendering.renderType(RenderType.getCutout()); rendering.renderType(RenderType.getCutout());
@@ -25,9 +25,9 @@ import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.block.ShapeContext; import net.minecraft.block.ShapeContext;
@@ -88,11 +88,11 @@ public class SkyChestBlock extends AEBaseTileBlock<SkyChestTileEntity> {
@Override @Override
public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) { public VoxelShape getShape(BlockState state, BlockView worldIn, BlockPos pos, ShapeContext context) {
// TODO Cache this! It can't be that hard! // TODO Cache this! It can't be that hard!
AxisAlignedBB aabb = computeAABB(worldIn, pos); Box aabb = computeAABB(worldIn, pos);
return VoxelShapes.create(aabb); return VoxelShapes.create(aabb);
} }
private AxisAlignedBB computeAABB(final BlockView w, final BlockPos pos) { private Box computeAABB(final BlockView w, final BlockPos pos) {
final SkyChestTileEntity sk = this.getTileEntity(w, pos); final SkyChestTileEntity sk = this.getTileEntity(w, pos);
Direction o = Direction.UP; Direction o = Direction.UP;
@@ -119,6 +119,6 @@ public class SkyChestBlock extends AEBaseTileBlock<SkyChestTileEntity> {
final double maxZ = Math.min(1.0, final double maxZ = Math.min(1.0,
1.0 - offsetZ - (o.getZOffset() < 0 ? AABB_OFFSET_TOP : (o.getZOffset() * AABB_OFFSET_BOTTOM))); 1.0 - offsetZ - (o.getZOffset() < 0 ? AABB_OFFSET_TOP : (o.getZOffset() * AABB_OFFSET_BOTTOM)));
return new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ); return new Box(minX, minY, minZ, maxX, maxY, maxZ);
} }
} }
@@ -27,12 +27,12 @@ import java.util.function.Supplier;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlockDefinition;
import appeng.api.features.AEFeature; import appeng.api.features.AEFeature;
@@ -69,10 +69,10 @@ class BlockDefinitionBuilder implements IBlockBuilder {
private BiFunction<Block, Item.Properties, BlockItem> itemFactory; private BiFunction<Block, Item.Properties, BlockItem> itemFactory;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private BlockRendering blockRendering; private BlockRendering blockRendering;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private ItemRendering itemRendering; private ItemRendering itemRendering;
BlockDefinitionBuilder(FeatureFactory factory, String id, Supplier<? extends Block> blockSupplier) { BlockDefinitionBuilder(FeatureFactory factory, String id, Supplier<? extends Block> blockSupplier) {
@@ -132,7 +132,7 @@ class BlockDefinitionBuilder implements IBlockBuilder {
return this; return this;
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private void customizeForClient(BlockRenderingCustomizer callback) { private void customizeForClient(BlockRenderingCustomizer callback) {
callback.customize(this.blockRendering, this.itemRendering); callback.customize(this.blockRendering, this.itemRendering);
} }
@@ -21,13 +21,13 @@ package appeng.bootstrap;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import java.util.function.Predicate; import java.util.function.Predicate;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.render.model.IBakedModel;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.block.AEBaseTileBlock; import appeng.block.AEBaseTileBlock;
import appeng.bootstrap.components.BlockColorComponent; import appeng.bootstrap.components.BlockColorComponent;
@@ -36,26 +36,26 @@ import appeng.client.render.model.AutoRotatingBakedModel;
class BlockRendering implements IBlockRendering { class BlockRendering implements IBlockRendering {
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private BiFunction<ResourceLocation, IBakedModel, IBakedModel> modelCustomizer; private BiFunction<Identifier, IBakedModel, IBakedModel> modelCustomizer;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private IBlockColor blockColor; private IBlockColor blockColor;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private RenderType renderType; private RenderType renderType;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private Predicate<RenderType> renderTypes; private Predicate<RenderType> renderTypes;
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public IBlockRendering modelCustomizer(BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer) { public IBlockRendering modelCustomizer(BiFunction<Identifier, IBakedModel, IBakedModel> customizer) {
this.modelCustomizer = customizer; this.modelCustomizer = customizer;
return this; return this;
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
@Override @Override
public IBlockRendering blockColor(IBlockColor blockColor) { public IBlockRendering blockColor(IBlockColor blockColor) {
this.blockColor = blockColor; this.blockColor = blockColor;
@@ -18,8 +18,8 @@
package appeng.bootstrap; package appeng.bootstrap;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
/** /**
* A callback that allows the rendering of a block to be customized. Sadly this * A callback that allows the rendering of a block to be customized. Sadly this
@@ -28,7 +28,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
*/ */
public abstract class BlockRenderingCustomizer { public abstract class BlockRenderingCustomizer {
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public abstract void customize(IBlockRendering rendering, IItemRendering itemRendering); public abstract void customize(IBlockRendering rendering, IItemRendering itemRendering);
} }
@@ -29,16 +29,16 @@ import java.util.function.BiFunction;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.render.model.IBakedModel;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntityType; import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.api.features.AEFeature; import appeng.api.features.AEFeature;
import appeng.bootstrap.components.ModelOverrideComponent; import appeng.bootstrap.components.ModelOverrideComponent;
@@ -51,7 +51,7 @@ public class FeatureFactory {
private final Map<Class<? extends IBootstrapComponent>, List<IBootstrapComponent>> bootstrapComponents; private final Map<Class<? extends IBootstrapComponent>, List<IBootstrapComponent>> bootstrapComponents;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private ModelOverrideComponent modelOverrideComponent; private ModelOverrideComponent modelOverrideComponent;
public FeatureFactory() { public FeatureFactory() {
@@ -86,7 +86,7 @@ public class FeatureFactory {
} }
public <T extends AEBaseTileEntity> TileEntityBuilder<T> tileEntity(String id, Class<T> teClass, public <T extends AEBaseTileEntity> TileEntityBuilder<T> tileEntity(String id, Class<T> teClass,
Function<TileEntityType<T>, T> factory) { Function<BlockEntityType<T>, T> factory) {
return new TileEntityBuilder<>(this, id, teClass, factory).features(this.defaultFeatures); return new TileEntityBuilder<>(this, id, teClass, factory).features(this.defaultFeatures);
} }
@@ -104,8 +104,8 @@ public class FeatureFactory {
this.bootstrapComponents.computeIfAbsent(eventType, c -> new ArrayList<IBootstrapComponent>()).add(component); this.bootstrapComponents.computeIfAbsent(eventType, c -> new ArrayList<IBootstrapComponent>()).add(component);
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
void addModelOverride(String resourcePath, BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer) { void addModelOverride(String resourcePath, BiFunction<Identifier, IBakedModel, IBakedModel> customizer) {
this.modelOverrideComponent.addOverride(resourcePath, customizer); this.modelOverrideComponent.addOverride(resourcePath, customizer);
} }
@@ -21,12 +21,12 @@ package appeng.bootstrap;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import java.util.function.Predicate; import java.util.function.Predicate;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.render.model.IBakedModel;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
/** /**
* Allows for client-side rendering to be customized in the context of * Allows for client-side rendering to be customized in the context of
@@ -34,16 +34,16 @@ import net.minecraftforge.api.distmarker.OnlyIn;
*/ */
public interface IBlockRendering { public interface IBlockRendering {
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
IBlockRendering modelCustomizer(BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer); IBlockRendering modelCustomizer(BiFunction<Identifier, IBakedModel, IBakedModel> customizer);
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
IBlockRendering blockColor(IBlockColor blockColor); IBlockRendering blockColor(IBlockColor blockColor);
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
IBlockRendering renderType(RenderType type); IBlockRendering renderType(RenderType type);
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
IBlockRendering renderType(Predicate<RenderType> type); IBlockRendering renderType(Predicate<RenderType> type);
} }
@@ -19,8 +19,8 @@
package appeng.bootstrap; package appeng.bootstrap;
import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.client.renderer.color.IItemColor;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
/** /**
* Allows the rendering of an item to be customized. * Allows the rendering of an item to be customized.
@@ -31,7 +31,7 @@ public interface IItemRendering {
* Registers a custom item color definition that inspects an item stack and tint * Registers a custom item color definition that inspects an item stack and tint
* and returns a color multiplier. * and returns a color multiplier.
*/ */
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
IItemRendering color(IItemColor itemColor); IItemRendering color(IItemColor itemColor);
} }
@@ -30,8 +30,8 @@ import net.minecraft.block.DispenserBlock;
import net.minecraft.dispenser.IDispenseItemBehavior; import net.minecraft.dispenser.IDispenseItemBehavior;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.api.features.AEFeature; import appeng.api.features.AEFeature;
import appeng.bootstrap.components.IInitComponent; import appeng.bootstrap.components.IInitComponent;
@@ -58,7 +58,7 @@ class ItemDefinitionBuilder implements IItemBuilder {
private Supplier<IDispenseItemBehavior> dispenserBehaviorSupplier; private Supplier<IDispenseItemBehavior> dispenserBehaviorSupplier;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private ItemRendering itemRendering; private ItemRendering itemRendering;
private ItemGroup itemGroup = CreativeTab.INSTANCE; private ItemGroup itemGroup = CreativeTab.INSTANCE;
@@ -118,7 +118,7 @@ class ItemDefinitionBuilder implements IItemBuilder {
return this; return this;
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private void customizeForClient(ItemRenderingCustomizer callback) { private void customizeForClient(ItemRenderingCustomizer callback) {
callback.customize(this.itemRendering); callback.customize(this.itemRendering);
} }
@@ -18,20 +18,20 @@
package appeng.bootstrap; package appeng.bootstrap;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.bootstrap.components.ItemColorComponent; import appeng.bootstrap.components.ItemColorComponent;
class ItemRendering implements IItemRendering { class ItemRendering implements IItemRendering {
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private IItemColor itemColor; private IItemColor itemColor;
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public IItemRendering color(IItemColor itemColor) { public IItemRendering color(IItemColor itemColor) {
this.itemColor = itemColor; this.itemColor = itemColor;
return this; return this;
@@ -18,8 +18,8 @@
package appeng.bootstrap; package appeng.bootstrap;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.Environment;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.EnvType;
/** /**
* A callback that allows the rendering of a item to be customized. Sadly this * A callback that allows the rendering of a item to be customized. Sadly this
@@ -28,6 +28,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
*/ */
public abstract class ItemRenderingCustomizer { public abstract class ItemRenderingCustomizer {
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public abstract void customize(IItemRendering rendering); public abstract void customize(IItemRendering rendering);
} }
@@ -9,10 +9,10 @@ import java.util.function.Supplier;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntityType; import net.minecraft.block.entity.BlockEntityType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.client.registry.ClientRegistry;
@@ -42,12 +42,12 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
// The tile entity class // The tile entity class
private final Class<T> tileClass; private final Class<T> tileClass;
private TileEntityType<T> type; private BlockEntityType<T> type;
// The factory for creating tile entity objects // The factory for creating tile entity objects
private final Function<TileEntityType<T>, T> supplier; private final Function<BlockEntityType<T>, T> supplier;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private TileEntityRendering<T> tileEntityRendering; private TileEntityRendering<T> tileEntityRendering;
private final List<Block> blocks = new ArrayList<>(); private final List<Block> blocks = new ArrayList<>();
@@ -55,7 +55,7 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
private final EnumSet<AEFeature> features = EnumSet.noneOf(AEFeature.class); private final EnumSet<AEFeature> features = EnumSet.noneOf(AEFeature.class);
public TileEntityBuilder(FeatureFactory factory, String registryName, Class<T> tileClass, public TileEntityBuilder(FeatureFactory factory, String registryName, Class<T> tileClass,
Function<TileEntityType<T>, T> supplier) { Function<BlockEntityType<T>, T> supplier) {
this.factory = factory; this.factory = factory;
this.registryName = registryName; this.registryName = registryName;
this.tileClass = tileClass; this.tileClass = tileClass;
@@ -78,7 +78,7 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
} }
public TileEntityBuilder<T> rendering(TileEntityRenderingCustomizer<T> customizer) { public TileEntityBuilder<T> rendering(TileEntityRenderingCustomizer<T> customizer) {
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> customizer.customize(tileEntityRendering)); DistExecutor.runWhenOn(EnvType.CLIENT, () -> () -> customizer.customize(tileEntityRendering));
return this; return this;
} }
@@ -91,7 +91,7 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
} }
Supplier<T> factory = () -> supplier.apply(type); Supplier<T> factory = () -> supplier.apply(type);
type = TileEntityType.Builder.create(factory, blocks.toArray(new Block[0])).build(null); type = BlockEntityType.Builder.create(factory, blocks.toArray(new Block[0])).build(null);
type.setRegistryName(AppEng.MOD_ID, registryName); type.setRegistryName(AppEng.MOD_ID, registryName);
registry.register(type); registry.register(type);
@@ -105,13 +105,13 @@ public class TileEntityBuilder<T extends AEBaseTileEntity> {
} }
}); });
DistExecutor.runWhenOn(Dist.CLIENT, () -> this::buildClient); DistExecutor.runWhenOn(EnvType.CLIENT, () -> this::buildClient);
return new TileEntityDefinition(this::addBlock); return new TileEntityDefinition(this::addBlock);
} }
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
private void buildClient() { private void buildClient() {
this.factory.addBootstrapComponent((IClientSetupComponent) () -> { this.factory.addBootstrapComponent((IClientSetupComponent) () -> {
if (tileEntityRendering.tileEntityRenderer != null) { if (tileEntityRendering.tileEntityRenderer != null) {
@@ -22,17 +22,17 @@ import java.util.function.Function;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.tile.AEBaseTileEntity; import appeng.tile.AEBaseTileEntity;
public class TileEntityRendering<T extends AEBaseTileEntity> { public class TileEntityRendering<T extends AEBaseTileEntity> {
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
Function<TileEntityRendererDispatcher, TileEntityRenderer<T>> tileEntityRenderer; Function<TileEntityRendererDispatcher, TileEntityRenderer<T>> tileEntityRenderer;
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public TileEntityRendering<T> tileEntityRenderer( public TileEntityRendering<T> tileEntityRenderer(
Function<TileEntityRendererDispatcher, TileEntityRenderer<T>> tileEntityRenderer) { Function<TileEntityRendererDispatcher, TileEntityRenderer<T>> tileEntityRenderer) {
this.tileEntityRenderer = tileEntityRenderer; this.tileEntityRenderer = tileEntityRenderer;
@@ -18,8 +18,8 @@
package appeng.bootstrap; package appeng.bootstrap;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import appeng.tile.AEBaseTileEntity; import appeng.tile.AEBaseTileEntity;
@@ -30,7 +30,7 @@ import appeng.tile.AEBaseTileEntity;
*/ */
public abstract class TileEntityRenderingCustomizer<T extends AEBaseTileEntity> { public abstract class TileEntityRenderingCustomizer<T extends AEBaseTileEntity> {
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public abstract void customize(TileEntityRendering<T> rendering); public abstract void customize(TileEntityRendering<T> rendering);
} }
@@ -1,13 +1,13 @@
package appeng.bootstrap.components; package appeng.bootstrap.components;
import net.fabricmc.api.EnvType;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.IForgeRegistry;
import appeng.bootstrap.IBootstrapComponent; import appeng.bootstrap.IBootstrapComponent;
@FunctionalInterface @FunctionalInterface
public interface IBlockRegistrationComponent extends IBootstrapComponent { public interface IBlockRegistrationComponent extends IBootstrapComponent {
void blockRegistration(Dist dist, IForgeRegistry<Block> blockRegistry); void blockRegistration(EnvType dist, IForgeRegistry<Block> blockRegistry);
} }
@@ -2,12 +2,12 @@
package appeng.bootstrap.components; package appeng.bootstrap.components;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.IForgeRegistry;
import appeng.bootstrap.IBootstrapComponent; import appeng.bootstrap.IBootstrapComponent;
@FunctionalInterface @FunctionalInterface
public interface IItemRegistrationComponent extends IBootstrapComponent { public interface IItemRegistrationComponent extends IBootstrapComponent {
void itemRegistration(Dist dist, IForgeRegistry<Item> itemRegistry); void itemRegistration(EnvType dist, IForgeRegistry<Item> itemRegistry);
} }
@@ -1,13 +1,13 @@
package appeng.bootstrap.components; package appeng.bootstrap.components;
import net.fabricmc.api.EnvType;
import net.minecraft.item.crafting.IRecipeSerializer; import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.IForgeRegistry;
import appeng.bootstrap.IBootstrapComponent; import appeng.bootstrap.IBootstrapComponent;
@FunctionalInterface @FunctionalInterface
public interface IRecipeRegistrationComponent extends IBootstrapComponent { public interface IRecipeRegistrationComponent extends IBootstrapComponent {
void recipeRegistration(Dist dist, IForgeRegistry<IRecipeSerializer<?>> recipeRegistry); void recipeRegistration(EnvType dist, IForgeRegistry<IRecipeSerializer<?>> recipeRegistry);
} }
@@ -1,11 +1,11 @@
package appeng.bootstrap.components; package appeng.bootstrap.components;
import net.minecraft.tileentity.TileEntityType; import net.minecraft.block.entity.BlockEntityType;
import net.minecraftforge.registries.IForgeRegistry; import net.minecraftforge.registries.IForgeRegistry;
import appeng.bootstrap.IBootstrapComponent; import appeng.bootstrap.IBootstrapComponent;
@FunctionalInterface @FunctionalInterface
public interface ITileEntityRegistrationComponent extends IBootstrapComponent { public interface ITileEntityRegistrationComponent extends IBootstrapComponent {
void register(IForgeRegistry<TileEntityType<?>> registry); void register(IForgeRegistry<BlockEntityType<?>> registry);
} }
@@ -25,9 +25,9 @@ import java.util.function.BiFunction;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.render.model.IBakedModel;
import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.client.render.model.ModelBakery;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraftforge.client.event.ModelBakeEvent; import net.minecraftforge.client.event.ModelBakeEvent;
import appeng.core.AppEng; import appeng.core.AppEng;
@@ -35,19 +35,19 @@ import appeng.core.AppEng;
public class ModelOverrideComponent implements IModelBakeComponent { public class ModelOverrideComponent implements IModelBakeComponent {
// Maps from resource path to customizer // Maps from resource path to customizer
private final Map<String, BiFunction<ResourceLocation, IBakedModel, IBakedModel>> customizer = new HashMap<>(); private final Map<String, BiFunction<Identifier, IBakedModel, IBakedModel>> customizer = new HashMap<>();
public void addOverride(String resourcePath, BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer) { public void addOverride(String resourcePath, BiFunction<Identifier, IBakedModel, IBakedModel> customizer) {
this.customizer.put(resourcePath, customizer); this.customizer.put(resourcePath, customizer);
} }
@Override @Override
public void onModelBakeEvent(final ModelBakeEvent event) { public void onModelBakeEvent(final ModelBakeEvent event) {
Map<ResourceLocation, IBakedModel> modelRegistry = event.getModelRegistry(); Map<Identifier, IBakedModel> modelRegistry = event.getModelRegistry();
Set<ResourceLocation> keys = Sets.newHashSet(modelRegistry.keySet()); Set<Identifier> keys = Sets.newHashSet(modelRegistry.keySet());
IBakedModel missingModel = modelRegistry.get(ModelBakery.MODEL_MISSING); IBakedModel missingModel = modelRegistry.get(ModelBakery.MODEL_MISSING);
for (ResourceLocation location : keys) { for (Identifier location : keys) {
if (!location.getNamespace().equals(AppEng.MOD_ID)) { if (!location.getNamespace().equals(AppEng.MOD_ID)) {
continue; continue;
} }
@@ -59,7 +59,7 @@ public class ModelOverrideComponent implements IModelBakeComponent {
continue; continue;
} }
BiFunction<ResourceLocation, IBakedModel, IBakedModel> customizer = this.customizer.get(location.getPath()); BiFunction<Identifier, IBakedModel, IBakedModel> customizer = this.customizer.get(location.getPath());
if (customizer != null) { if (customizer != null) {
IBakedModel newModel = customizer.apply(location, orgModel); IBakedModel newModel = customizer.apply(location, orgModel);
@@ -21,9 +21,9 @@ package appeng.capabilities;
import java.util.List; import java.util.List;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.server.ServerWorld; import net.minecraft.server.world.ServerWorld;
import appeng.api.storage.ISpatialDimension; import appeng.api.storage.ISpatialDimension;
@@ -48,7 +48,7 @@ class NullSpatialDimension implements ISpatialDimension {
} }
@Override @Override
public void addCellDimensionTooltip(DimensionType cellDim, List<ITextComponent> tooltip) { public void addCellDimensionTooltip(DimensionType cellDim, List<Text> tooltip) {
} }
@Override @Override
@@ -27,9 +27,9 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding; import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.util.InputMappings; import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.event.InputEvent; import net.minecraftforge.client.event.InputEvent;
@@ -74,7 +74,7 @@ public class ClientHelper extends ServerHelper {
} }
@Override @Override
public void bindTileEntitySpecialRenderer(final Class<? extends TileEntity> tile, final AEBaseBlock blk) { public void bindTileEntitySpecialRenderer(final Class<? extends BlockEntity> tile, final AEBaseBlock blk) {
} }
@@ -125,7 +125,7 @@ public class ClientHelper extends ServerHelper {
} }
@Override @Override
public RayTraceResult getRTR() { public HitResult getRTR() {
return Minecraft.getInstance().objectMouseOver; return Minecraft.getInstance().objectMouseOver;
} }
@@ -25,7 +25,7 @@ import java.util.Locale;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Slot; import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
@@ -36,7 +36,7 @@ import appeng.core.localization.ButtonToolTips;
public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseScreen<T> { public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseScreen<T> {
public AEBaseMEScreen(T container, PlayerInventory playerInventory, ITextComponent title) { public AEBaseMEScreen(T container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
} }
@@ -51,8 +51,8 @@ import net.minecraft.inventory.container.ClickType;
import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot; import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.Identifier;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.FluidAttributes; import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fml.client.gui.GuiUtils; import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -100,7 +100,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
private Slot bl_clicked; private Slot bl_clicked;
protected final List<CustomSlotWidget> guiSlots = new ArrayList<>(); protected final List<CustomSlotWidget> guiSlots = new ArrayList<>();
public AEBaseScreen(T container, PlayerInventory playerInventory, ITextComponent title) { public AEBaseScreen(T container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
} }
@@ -587,7 +587,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
} }
public void bindTexture(final String base, final String file) { public void bindTexture(final String base, final String file) {
final ResourceLocation loc = new ResourceLocation(base, "textures/" + file); final Identifier loc = new Identifier(base, "textures/" + file);
getMinecraft().getTextureManager().bindTexture(loc); getMinecraft().getTextureManager().bindTexture(loc);
} }
@@ -646,7 +646,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
final Fluid fluid = fs.getFluid(); final Fluid fluid = fs.getFluid();
FluidAttributes fluidAttributes = fluid.getAttributes(); FluidAttributes fluidAttributes = fluid.getAttributes();
bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE); bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
ResourceLocation fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack()); Identifier fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack());
final TextureAtlasSprite sprite = getMinecraft() final TextureAtlasSprite sprite = getMinecraft()
.getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStillTexture); .getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStillTexture);
@@ -762,11 +762,11 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
} }
public void bindTexture(final String file) { public void bindTexture(final String file) {
final ResourceLocation loc = new ResourceLocation(AppEng.MOD_ID, "textures/" + file); final Identifier loc = new Identifier(AppEng.MOD_ID, "textures/" + file);
getMinecraft().getTextureManager().bindTexture(loc); getMinecraft().getTextureManager().bindTexture(loc);
} }
public void bindTexture(final ResourceLocation loc) { public void bindTexture(final Identifier loc) {
getMinecraft().getTextureManager().bindTexture(loc); getMinecraft().getTextureManager().bindTexture(loc);
} }
@@ -6,8 +6,8 @@ import javax.annotation.Nonnull;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.Slot; import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist; import net.fabricmc.api.EnvType;
import net.minecraftforge.api.distmarker.OnlyIn; import net.fabricmc.api.Environment;
import net.minecraftforge.items.SlotItemHandler; import net.minecraftforge.items.SlotItemHandler;
/** /**
@@ -58,7 +58,7 @@ class Size1Slot extends SlotItemHandler {
} }
@Override @Override
@OnlyIn(Dist.CLIENT) @Environment(EnvType.CLIENT)
public boolean isEnabled() { public boolean isEnabled() {
return this.delegate.isEnabled(); return this.delegate.isEnabled();
} }
@@ -20,9 +20,9 @@ package appeng.client.gui.implementations;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraftforge.fml.client.gui.GuiUtils; import net.minecraftforge.fml.client.gui.GuiUtils;
import net.minecraftforge.items.IItemHandler; import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.config.ActionItems; import appeng.api.config.ActionItems;
import appeng.api.config.CopyMode; import appeng.api.config.CopyMode;
@@ -43,7 +43,7 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
private ToggleButton copyMode; private ToggleButton copyMode;
public CellWorkbenchScreen(CellWorkbenchContainer container, PlayerInventory playerInventory, public CellWorkbenchScreen(CellWorkbenchContainer container, PlayerInventory playerInventory,
ITextComponent title) { Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
this.ySize = 251; this.ySize = 251;
} }
@@ -118,7 +118,7 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
this.copyMode.setState(this.container.getCopyMode() == CopyMode.CLEAR_ON_REMOVE); this.copyMode.setState(this.container.getCopyMode() == CopyMode.CLEAR_ON_REMOVE);
boolean hasFuzzy = false; boolean hasFuzzy = false;
final IItemHandler inv = this.container.getCellUpgradeInventory(); final ItemTransferable inv = this.container.getCellUpgradeInventory();
for (int x = 0; x < inv.getSlots(); x++) { for (int x = 0; x < inv.getSlots(); x++) {
final ItemStack is = inv.getStackInSlot(x); final ItemStack is = inv.getStackInSlot(x);
if (!is.isEmpty() && is.getItem() instanceof IUpgradeModule) { if (!is.isEmpty() && is.getItem() instanceof IUpgradeModule) {
@@ -19,7 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraftforge.fml.client.gui.GuiUtils; import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.client.gui.AEBaseScreen; import appeng.client.gui.AEBaseScreen;
@@ -32,7 +32,7 @@ import appeng.core.sync.packets.SwitchGuisPacket;
public class ChestScreen extends AEBaseScreen<ChestContainer> { public class ChestScreen extends AEBaseScreen<ChestContainer> {
public ChestScreen(ChestContainer container, PlayerInventory playerInventory, ITextComponent title) { public ChestScreen(ChestContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
this.ySize = 166; this.ySize = 166;
} }
@@ -19,7 +19,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraftforge.fml.client.gui.GuiUtils; import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.config.CondenserOutput; import appeng.api.config.CondenserOutput;
@@ -36,7 +36,7 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
private SettingToggleButton<CondenserOutput> mode; private SettingToggleButton<CondenserOutput> mode;
public CondenserScreen(CondenserContainer container, PlayerInventory playerInventory, ITextComponent title) { public CondenserScreen(CondenserContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
this.ySize = 197; this.ySize = 197;
} }
@@ -21,7 +21,7 @@ package appeng.client.gui.implementations;
import net.minecraft.client.gui.widget.button.Button; import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.util.InputMappings; import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraftforge.fml.client.gui.GuiUtils; import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.client.gui.AEBaseScreen; import appeng.client.gui.AEBaseScreen;
@@ -39,7 +39,7 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
private Button next; private Button next;
public CraftAmountScreen(CraftAmountContainer container, PlayerInventory playerInventory, ITextComponent title) { public CraftAmountScreen(CraftAmountContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
this.subGui = new AESubScreen(this, container.getTarget()); this.subGui = new AESubScreen(this, container.getTarget());
} }
@@ -30,7 +30,7 @@ import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.util.InputMappings; import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraftforge.fml.client.gui.GuiUtils; import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.AEApi; import appeng.api.AEApi;
@@ -64,7 +64,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
private Button selectCPU; private Button selectCPU;
private int tooltip = -1; private int tooltip = -1;
public CraftConfirmScreen(CraftConfirmContainer container, PlayerInventory playerInventory, ITextComponent title) { public CraftConfirmScreen(CraftConfirmContainer container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
this.subGui = new AESubScreen(this, container.getTarget()); this.subGui = new AESubScreen(this, container.getTarget());
this.xSize = 238; this.xSize = 238;
@@ -31,7 +31,7 @@ import org.apache.commons.lang3.time.DurationFormatUtils;
import net.minecraft.client.gui.widget.button.Button; import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent; import net.minecraft.text.Text;
import net.minecraftforge.fml.client.gui.GuiUtils; import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.AEApi; import appeng.api.AEApi;
@@ -90,7 +90,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
private Button cancel; private Button cancel;
private int tooltip = -1; private int tooltip = -1;
public CraftingCPUScreen(T container, PlayerInventory playerInventory, ITextComponent title) { public CraftingCPUScreen(T container, PlayerInventory playerInventory, Text title) {
super(container, playerInventory, title); super(container, playerInventory, title);
this.ySize = GUI_HEIGHT; this.ySize = GUI_HEIGHT;
this.xSize = GUI_WIDTH; this.xSize = GUI_WIDTH;

Some files were not shown because too many files have changed in this diff Show More