mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Initial 1.13.2 update. Major thing to note is that Dimensions have been completely revamped.
DimensionType is not unique per Dimension. See DimensionManager for more details. Vanilla now has a chunk loading system, so Forge's will need to be deprecated/adapted.
This commit is contained in:
1 parent
9a1688599a
commit
ca72710937
361 files changed
+3166
-3547
No files matched your search
@@ -43,7 +43,7 @@ public class ClientRegistry
|
||||
*/
|
||||
public static synchronized <T extends TileEntity> void bindTileEntitySpecialRenderer(Class<T> tileEntityClass, TileEntityRenderer<? super T> specialRenderer)
|
||||
{
|
||||
TileEntityRendererDispatcher.instance.renderers.put(tileEntityClass, specialRenderer);
|
||||
TileEntityRendererDispatcher.instance.setSpecialRenderer(tileEntityClass, specialRenderer);
|
||||
specialRenderer.setRendererDispatcher(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,17 +23,23 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class PlayerEvent extends Event {
|
||||
public final EntityPlayer player;
|
||||
private final EntityPlayer player;
|
||||
private PlayerEvent(EntityPlayer player)
|
||||
{
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public EntityPlayer getPlayer()
|
||||
{
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public static class ItemPickupEvent extends PlayerEvent {
|
||||
/**
|
||||
* Original EntityItem with current remaining stack size
|
||||
@@ -61,23 +67,40 @@ public class PlayerEvent extends Event {
|
||||
|
||||
public static class ItemCraftedEvent extends PlayerEvent {
|
||||
@Nonnull
|
||||
public final ItemStack crafting;
|
||||
public final IInventory craftMatrix;
|
||||
private final ItemStack crafting;
|
||||
private final IInventory craftMatrix;
|
||||
public ItemCraftedEvent(EntityPlayer player, @Nonnull ItemStack crafting, IInventory craftMatrix)
|
||||
{
|
||||
super(player);
|
||||
this.crafting = crafting;
|
||||
this.craftMatrix = craftMatrix;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public ItemStack getCrafting()
|
||||
{
|
||||
return this.crafting;
|
||||
}
|
||||
|
||||
public IInventory getInventory()
|
||||
{
|
||||
return this.craftMatrix;
|
||||
}
|
||||
}
|
||||
public static class ItemSmeltedEvent extends PlayerEvent {
|
||||
@Nonnull
|
||||
public final ItemStack smelting;
|
||||
private final ItemStack smelting;
|
||||
public ItemSmeltedEvent(EntityPlayer player, @Nonnull ItemStack crafting)
|
||||
{
|
||||
super(player);
|
||||
this.smelting = crafting;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public ItemStack getSmelting()
|
||||
{
|
||||
return this.smelting;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PlayerLoggedInEvent extends PlayerEvent {
|
||||
@@ -116,13 +139,23 @@ public class PlayerEvent extends Event {
|
||||
}
|
||||
|
||||
public static class PlayerChangedDimensionEvent extends PlayerEvent {
|
||||
public final int fromDim;
|
||||
public final int toDim;
|
||||
public PlayerChangedDimensionEvent(EntityPlayer player, int fromDim, int toDim)
|
||||
private final DimensionType fromDim;
|
||||
private final DimensionType toDim;
|
||||
public PlayerChangedDimensionEvent(EntityPlayer player, DimensionType fromDim, DimensionType toDim)
|
||||
{
|
||||
super(player);
|
||||
this.fromDim = fromDim;
|
||||
this.toDim = toDim;
|
||||
}
|
||||
|
||||
public DimensionType getFrom()
|
||||
{
|
||||
return this.fromDim;
|
||||
}
|
||||
|
||||
public DimensionType getTo()
|
||||
{
|
||||
return this.toDim;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class VillagerRegistry
|
||||
return instance().villageCreationHandlers.get(villagePiece.villagePieceClass).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, facing, p5);
|
||||
}
|
||||
|
||||
RegistryNamespaced<ResourceLocation, VillagerProfession> REGISTRY = GameData.getWrapper(VillagerProfession.class);
|
||||
RegistryNamespaced<VillagerProfession> REGISTRY = GameData.getWrapper(VillagerProfession.class);
|
||||
|
||||
private void register(VillagerProfession prof, int id)
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraftforge.client.model.animation.Animation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
@@ -43,7 +44,7 @@ public class BasicEventHooks
|
||||
MinecraftForge.EVENT_BUS.post(new InputEvent.KeyInputEvent());
|
||||
}
|
||||
|
||||
public static void firePlayerChangedDimensionEvent(EntityPlayer player, int fromDim, int toDim)
|
||||
public static void firePlayerChangedDimensionEvent(EntityPlayer player, DimensionType fromDim, DimensionType toDim)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new PlayerEvent.PlayerChangedDimensionEvent(player, fromDim, toDim));
|
||||
}
|
||||
|
||||
@@ -22,10 +22,9 @@ package net.minecraftforge.fml.network;
|
||||
import io.netty.util.AttributeKey;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.server.network.NetHandlerLoginServer;
|
||||
import net.minecraft.network.NetHandlerLoginServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.fml.Logging;
|
||||
import net.minecraftforge.fml.network.simple.SimpleChannel;
|
||||
import net.minecraftforge.fml.util.ThreeConsumer;
|
||||
import net.minecraftforge.registries.RegistryManager;
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.fml.ExtensionPoint;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraft.util.registry.IRegistry;
|
||||
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
|
||||
import java.util.UUID;
|
||||
@@ -50,7 +51,7 @@ public class FMLPlayMessages
|
||||
SpawnEntity(Entity e)
|
||||
{
|
||||
this.entity = e;
|
||||
this.typeId = EntityType.REGISTRY.getId(e.getType());
|
||||
this.typeId = IRegistry.field_212629_r.getId(e.getType());
|
||||
this.entityId = e.getEntityId();
|
||||
this.uuid = e.getUniqueID();
|
||||
this.posX = e.posX;
|
||||
@@ -121,7 +122,7 @@ public class FMLPlayMessages
|
||||
public static void handle(SpawnEntity msg, Supplier<NetworkEvent.Context> ctx)
|
||||
{
|
||||
ctx.get().enqueueWork(() -> {
|
||||
EntityType<?> type = EntityType.REGISTRY.get(msg.typeId);
|
||||
EntityType<?> type = IRegistry.field_212629_r.get(msg.typeId);
|
||||
if (type == null)
|
||||
{
|
||||
throw new RuntimeException(String.format("Could not spawn entity (id %d) with unknown type at (%f, %f, %f)", msg.entityId, msg.posX, msg.posY, msg.posZ));
|
||||
|
||||
@@ -28,7 +28,7 @@ import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.handshake.client.CPacketHandshake;
|
||||
import net.minecraft.server.network.NetHandlerLoginServer;
|
||||
import net.minecraft.network.NetHandlerLoginServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.IInteractionObject;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
Reference in new issue
Block a user