Compiling fixes - IN GAME!

This commit is contained in:
covers1624 authored and cpw committed 2020-06-25 17:55:52 -04:00
1 parent 631230b298
commit 80eb12e59d
364 files changed
+1170 -9853

No files matched your search

@@ -23,6 +23,7 @@ import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.RegistryKey;
import net.minecraft.world.World;
import net.minecraftforge.client.model.animation.Animation;
import net.minecraftforge.common.MinecraftForge;
@@ -32,11 +33,11 @@ import net.minecraftforge.event.TickEvent;
public class BasicEventHooks
{
//TODO Dimensions..
// public static void firePlayerChangedDimensionEvent(PlayerEntity player, DimensionType fromDim, DimensionType toDim)
// {
// MinecraftForge.EVENT_BUS.post(new PlayerEvent.PlayerChangedDimensionEvent(player, fromDim, toDim));
// }
public static void firePlayerChangedDimensionEvent(PlayerEntity player, RegistryKey<World> fromDim, RegistryKey<World> toDim)
{
MinecraftForge.EVENT_BUS.post(new PlayerEvent.PlayerChangedDimensionEvent(player, fromDim, toDim));
}
public static void firePlayerLoggedIn(PlayerEntity player)
{
@@ -308,61 +308,4 @@ public class FMLPlayMessages
return additionalData;
}
}
//TODO Dimensions..
/*public static class DimensionInfoMessage
{
private ResourceLocation dimName;
private boolean skylight;
private int id;
private ResourceLocation modDimensionName;
private PacketBuffer extraData;
DimensionInfoMessage(DimensionType type) {
id = type.getId() + 1;
dimName = type.getRegistryName();
modDimensionName = type.getModType().getRegistryName();
skylight = type.hasSkyLight();
extraData = new PacketBuffer(Unpooled.buffer());
type.getModType().write(extraData, true);
}
DimensionInfoMessage(final int dimId, final ResourceLocation dimname, final ResourceLocation modDimensionName, final boolean skylight, final PacketBuffer extraData) {
id = dimId;
this.dimName = dimname;
this.modDimensionName = modDimensionName;
this.skylight = skylight;
this.extraData = extraData;
}
public static DimensionInfoMessage decode(PacketBuffer buffer) {
int dimId = buffer.readInt();
ResourceLocation dimname = buffer.readResourceLocation();
ResourceLocation moddimname = buffer.readResourceLocation();
boolean skylight = buffer.readBoolean();
PacketBuffer pb = new PacketBuffer(Unpooled.wrappedBuffer(buffer.readByteArray()));
return new DimensionInfoMessage(dimId, dimname, moddimname, skylight, pb);
}
public static void encode(DimensionInfoMessage message, PacketBuffer buffer) {
buffer.writeInt(message.id);
buffer.writeResourceLocation(message.dimName);
buffer.writeResourceLocation(message.modDimensionName);
buffer.writeBoolean(message.skylight);
buffer.writeByteArray(message.extraData.array());
}
private DimensionType makeDummyDimensionType() {
final ModDimension modDim = ForgeRegistries.MOD_DIMENSIONS.getValue(modDimensionName);
// default to overworld if no moddim found
if (modDim == null) return DimensionType.OVERWORLD;
modDim.read(extraData, true);
return new DimensionType(id, "dummy", "dummy", modDim.getFactory(), skylight, FuzzedBiomeMagnifier.INSTANCE, modDim, extraData);
}
public static boolean handle(final DimensionInfoMessage message, final Supplier<NetworkEvent.Context> contextSupplier) {
contextSupplier.get().enqueueWork(()-> NetworkHooks.addCachedDimensionType(message.makeDummyDimensionType(), message.dimName));
return true;
}
}*/
}