mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 20:52:34 +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
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user