Update forge mappings to 20200916-1.16.2 (#4749)

This commit is contained in:
yueh
2020-09-19 17:32:23 +02:00
committed by GitHub
parent 76efe6026d
commit 876bb52087
63 changed files with 112 additions and 113 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ artifact_basename=appliedenergistics2
######################################################### #########################################################
minecraft_release=1.16 minecraft_release=1.16
minecraft_version=1.16.3 minecraft_version=1.16.3
mcp_mappings=20200723-1.16.1 mcp_mappings=20200916-1.16.2
forge_version=34.0.8 forge_version=34.0.8
######################################################### #########################################################
@@ -46,19 +46,19 @@ public class DimensionalCoord extends WorldCoord {
public DimensionalCoord(final TileEntity tileEntity) { public DimensionalCoord(final TileEntity tileEntity) {
super(tileEntity); super(tileEntity);
this.world = tileEntity.getWorld(); this.world = tileEntity.getWorld();
this.dimension = this.world.func_230315_m_(); this.dimension = this.world.getDimensionType();
} }
public DimensionalCoord(final World world, final int x, final int y, final int z) { public DimensionalCoord(final World 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.func_230315_m_(); this.dimension = world.getDimensionType();
} }
public DimensionalCoord(final World world, final BlockPos pos) { public DimensionalCoord(final World world, final BlockPos pos) {
super(pos); super(pos);
this.world = world; this.world = world;
this.dimension = world.func_230315_m_(); this.dimension = world.getDimensionType();
} }
@Override @Override
@@ -167,7 +167,7 @@ class PaintSplotchesBakedModel implements IDynamicBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false; return false;
} }
@@ -203,7 +203,7 @@ class QnbFormedBakedModel implements IDynamicBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false; return false;
} }
@@ -160,7 +160,7 @@ class BlockDefinitionBuilder implements IBlockBuilder {
@Override @Override
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public void setup() { public void setup() {
ItemModelsProperties.func_239418_a_(item, new ResourceLocation("appliedenergistics2:fill_level"), ItemModelsProperties.registerProperty(item, new ResourceLocation("appliedenergistics2:fill_level"),
(is, world, entity) -> { (is, world, entity) -> {
double curPower = chargeable.getAECurrentPower(is); double curPower = chargeable.getAECurrentPower(is);
double maxPower = chargeable.getAEMaxPower(is); double maxPower = chargeable.getAEMaxPower(is);
@@ -146,7 +146,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
RenderSystem.popMatrix(); RenderSystem.popMatrix();
RenderSystem.enableDepthTest(); RenderSystem.enableDepthTest();
this.func_230459_a_(matrixStack, mouseX, mouseY); this.renderHoveredTooltip(matrixStack, mouseX, mouseY);
for (final Object c : this.buttons) { for (final Object c : this.buttons) {
if (c instanceof ITooltip) { if (c instanceof ITooltip) {
@@ -211,7 +211,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
try { try {
final long id = Long.parseLong(key.substring(1), Character.MAX_RADIX); final long id = Long.parseLong(key.substring(1), Character.MAX_RADIX);
final CompoundNBT invData = in.getCompound(key); final CompoundNBT invData = in.getCompound(key);
ITextComponent un = ITextComponent.Serializer.func_240643_a_(invData.getString("un")); ITextComponent un = ITextComponent.Serializer.getComponentFromJson(invData.getString("un"));
final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un); final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un);
for (int x = 0; x < current.getInventory().getSlots(); x++) { for (int x = 0; x < current.getInventory().getSlots(); x++) {
@@ -302,7 +302,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
// The stack size renderer expects a 16x16 slot, while the button is normally // The stack size renderer expects a 16x16 slot, while the button is normally
// bigger // bigger
int x = this.craftingStatusBtn.x + (this.craftingStatusBtn.getWidth() - 16) / 2; int x = this.craftingStatusBtn.x + (this.craftingStatusBtn.getWidth() - 16) / 2;
int y = this.craftingStatusBtn.y + (this.craftingStatusBtn.getWidth_CLASH() - 16) / 2; int y = this.craftingStatusBtn.y + (this.craftingStatusBtn.getHeightRealms() - 16) / 2;
StackSizeRenderer.renderSizeLabel(font, x - this.guiLeft, y - this.guiTop, StackSizeRenderer.renderSizeLabel(font, x - this.guiLeft, y - this.guiTop,
String.valueOf(container.activeCraftingJobs)); String.valueOf(container.activeCraftingJobs));
} }
@@ -47,8 +47,8 @@ public abstract class DelegateBakedModel implements IBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return baseModel.func_230044_c_(); return baseModel.isSideLit();
} }
@Override @Override
@@ -60,7 +60,7 @@ public class DummyFluidBakedModel implements IBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false; return false;
} }
@@ -73,8 +73,8 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return getBaseModel().func_230044_c_(); return getBaseModel().isSideLit();
} }
@Override @Override
@@ -86,7 +86,7 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel {
public ItemOverrideList getOverrides() { public ItemOverrideList getOverrides() {
return new ItemOverrideList() { return new ItemOverrideList() {
@Override @Override
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world, public IBakedModel getOverrideModel(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) { LivingEntity entity) {
if (!(stack.getItem() instanceof FluidDummyItem)) { if (!(stack.getItem() instanceof FluidDummyItem)) {
return originalModel; return originalModel;
@@ -80,7 +80,7 @@ public class FacadeBakedItemModel extends DelegateBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false; return false;
} }
@@ -50,7 +50,7 @@ public class FacadeDispatcherBakedModel extends DelegateBakedModel {
public ItemOverrideList getOverrides() { public ItemOverrideList getOverrides() {
return new ItemOverrideList() { return new ItemOverrideList() {
@Override @Override
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world, public IBakedModel getOverrideModel(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) { LivingEntity entity) {
if (!(stack.getItem() instanceof FacadeItem)) { if (!(stack.getItem() instanceof FacadeItem)) {
return originalModel; return originalModel;
@@ -331,7 +331,7 @@ public class CableBusBakedModel implements IBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false;// TODO return false;// TODO
} }
@@ -100,7 +100,7 @@ public class P2PTunnelFrequencyBakedModel implements IDynamicBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false;// TODO return false;// TODO
} }
@@ -276,7 +276,7 @@ abstract class CraftingCubeBakedModel implements IDynamicBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false; return false;
} }
@@ -86,8 +86,8 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
// This determines diffuse lighting in the UI, and since we want to render // This determines diffuse lighting in the UI, and since we want to render
// the outputModel in the UI, we need to use it's setting here // the outputModel in the UI, we need to use it's setting here
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return outputModel.func_230044_c_(); return outputModel.isSideLit();
} }
} }
@@ -112,7 +112,7 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
@Nullable @Nullable
@Override @Override
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world, public IBakedModel getOverrideModel(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world,
@Nullable LivingEntity entity) { @Nullable LivingEntity entity) {
boolean shiftHeld = Screen.hasShiftDown(); boolean shiftHeld = Screen.hasShiftDown();
if (shiftHeld) { if (shiftHeld) {
@@ -122,12 +122,12 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
IBakedModel realModel = Minecraft.getInstance().getItemRenderer().getItemModelMesher() IBakedModel realModel = Minecraft.getInstance().getItemRenderer().getItemModelMesher()
.getItemModel(output); .getItemModel(output);
// Give the item model a chance to handle the overrides as well // Give the item model a chance to handle the overrides as well
realModel = realModel.getOverrides().func_239290_a_(realModel, output, world, entity); realModel = realModel.getOverrides().getOverrideModel(realModel, output, world, entity);
return new ShiftHoldingModelWrapper(getBaseModel(), realModel); return new ShiftHoldingModelWrapper(getBaseModel(), realModel);
} }
} }
return getBaseModel().getOverrides().func_239290_a_(originalModel, stack, world, entity); return getBaseModel().getOverrides().getOverrideModel(originalModel, stack, world, entity);
} }
} }
@@ -107,7 +107,7 @@ public class AutoRotatingBakedModel extends DelegateBakedModel {
// when piping it // when piping it
// to the AO lighter, thus fixing our problem. // to the AO lighter, thus fixing our problem.
BakedQuad packedQuad = new BakedQuad(unpackedQuad.getVertexData(), quad.getTintIndex(), BakedQuad packedQuad = new BakedQuad(unpackedQuad.getVertexData(), quad.getTintIndex(),
unpackedQuad.getFace(), quad.func_187508_a(), quad.func_239287_f_()); unpackedQuad.getFace(), quad.getSprite(), quad.applyDiffuseLighting());
rotated.add(packedQuad); rotated.add(packedQuad);
} }
return rotated; return rotated;
@@ -120,7 +120,7 @@ class BiometricCardBakedModel implements IBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false;// TODO return false;// TODO
} }
@@ -143,7 +143,7 @@ class BiometricCardBakedModel implements IBakedModel {
public ItemOverrideList getOverrides() { public ItemOverrideList getOverrides() {
return new ItemOverrideList() { return new ItemOverrideList() {
@Override @Override
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world, public IBakedModel getOverrideModel(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) { LivingEntity entity) {
String username = ""; String username = "";
if (stack.getItem() instanceof IBiometricCard) { if (stack.getItem() instanceof IBiometricCard) {
@@ -50,19 +50,19 @@ class ColorApplicatorBakedModel implements IBakedModel {
for (BakedQuad quad : quads) { for (BakedQuad quad : quads) {
int tint; int tint;
if (quad.func_187508_a() == texDark) { if (quad.getSprite() == texDark) {
tint = 1; tint = 1;
} else if (quad.func_187508_a() == texMedium) { } else if (quad.getSprite() == texMedium) {
tint = 2; tint = 2;
} else if (quad.func_187508_a() == texBright) { } else if (quad.getSprite() == texBright) {
tint = 3; tint = 3;
} else { } else {
result.add(quad); result.add(quad);
continue; continue;
} }
BakedQuad newQuad = new BakedQuad(quad.getVertexData(), tint, quad.getFace(), quad.func_187508_a(), BakedQuad newQuad = new BakedQuad(quad.getVertexData(), tint, quad.getFace(), quad.getSprite(),
quad.func_239287_f_()); quad.applyDiffuseLighting());
result.add(newQuad); result.add(newQuad);
} }
@@ -88,7 +88,7 @@ class ColorApplicatorBakedModel implements IBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false;// TODO return false;// TODO
} }
@@ -157,7 +157,7 @@ class GlassBakedModel implements IDynamicBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
// TODO: Forge: Auto-generated method stub // TODO: Forge: Auto-generated method stub
return false; return false;
} }
@@ -105,7 +105,7 @@ class MemoryCardBakedModel implements IBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false;// TODO return false;// TODO
} }
@@ -128,7 +128,7 @@ class MemoryCardBakedModel implements IBakedModel {
public ItemOverrideList getOverrides() { public ItemOverrideList getOverrides() {
return new ItemOverrideList() { return new ItemOverrideList() {
@Override @Override
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world, public IBakedModel getOverrideModel(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) { LivingEntity entity) {
try { try {
if (stack.getItem() instanceof IMemoryCard) { if (stack.getItem() instanceof IMemoryCard) {
@@ -122,7 +122,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false; return false;
} }
@@ -149,7 +149,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
*/ */
return new ItemOverrideList() { return new ItemOverrideList() {
@Override @Override
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world, public IBakedModel getOverrideModel(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world,
@Nullable LivingEntity entity) { @Nullable LivingEntity entity) {
// FIXME: This check prevents compasses being held by OTHERS from getting the // FIXME: This check prevents compasses being held by OTHERS from getting the
// rotation, BUT do we actually still need this??? // rotation, BUT do we actually still need this???
@@ -181,7 +181,7 @@ class SpatialPylonBakedModel implements IDynamicBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false; return false;
} }
@@ -149,7 +149,7 @@ public class ChestTileEntityRenderer extends TileEntityRenderer<ChestTileEntity>
for (int i = 0; i < quads.size(); i++) { for (int i = 0; i < quads.size(); i++) {
BakedQuad quad = quads.get(i); BakedQuad quad = quads.get(i);
quads.set(i, new BakedQuad(quad.getVertexData(), quad.getTintIndex(), r.rotate(quad.getFace()), quads.set(i, new BakedQuad(quad.getVertexData(), quad.getTintIndex(), r.rotate(quad.getFace()),
quad.func_187508_a(), quad.func_239287_f_())); quad.getSprite(), quad.applyDiffuseLighting()));
} }
return quads; return quads;
@@ -69,7 +69,7 @@ public final class ContainerLocator {
private final AEPartLocation side; private final AEPartLocation side;
private ContainerLocator(Type type, int itemIndex, World world, BlockPos blockPos, AEPartLocation side) { private ContainerLocator(Type type, int itemIndex, World world, BlockPos blockPos, AEPartLocation side) {
this(type, itemIndex, world.func_234923_W_().func_240901_a_(), blockPos, side); this(type, itemIndex, world.getDimensionKey().getLocation(), blockPos, side);
} }
private ContainerLocator(Type type, int itemIndex, ResourceLocation worldId, BlockPos blockPos, private ContainerLocator(Type type, int itemIndex, ResourceLocation worldId, BlockPos blockPos,
@@ -127,7 +127,7 @@ public class SyncData {
String json = (String) val; String json = (String) val;
ITextComponent text = null; ITextComponent text = null;
if (!json.isEmpty()) { if (!json.isEmpty()) {
text = ITextComponent.Serializer.func_240643_a_((String) val); text = ITextComponent.Serializer.getComponentFromJson((String) val);
} }
this.updateTextComponent(text); this.updateTextComponent(text);
} else { } else {
+1 -1
View File
@@ -595,7 +595,7 @@ public final class AEConfig {
this.spawnChargedChance = builder.defineInRange("spawnChargedChance", 0.08, 0.0, 1.0); this.spawnChargedChance = builder.defineInRange("spawnChargedChance", 0.08, 0.0, 1.0);
this.meteoriteMaximumSpawnHeight = builder.define("meteoriteMaximumSpawnHeight", 180); this.meteoriteMaximumSpawnHeight = builder.define("meteoriteMaximumSpawnHeight", 180);
List<String> defaultDimensionWhitelist = new ArrayList<>(); List<String> defaultDimensionWhitelist = new ArrayList<>();
defaultDimensionWhitelist.add(World.field_234918_g_.getRegistryName().toString()); defaultDimensionWhitelist.add(World.OVERWORLD.getRegistryName().toString());
this.meteoriteDimensionWhitelist = builder.defineList("meteoriteDimensionWhitelist", this.meteoriteDimensionWhitelist = builder.defineList("meteoriteDimensionWhitelist",
defaultDimensionWhitelist, obj -> true); defaultDimensionWhitelist, obj -> true);
@@ -54,7 +54,7 @@ public final class AppEngBootstrap {
public synchronized static void enhanceBiomes() { public synchronized static void enhanceBiomes() {
// add to all standard biomes // add to all standard biomes
// TODO: This means we'll not add these things to newly created biomes // TODO: This means we'll not add these things to newly created biomes
WorldGenRegistries.field_243657_i.forEach(b -> { WorldGenRegistries.BIOME.forEach(b -> {
addMeteoriteWorldGen(b); addMeteoriteWorldGen(b);
addQuartzWorldGen(b, quartzOreFeature, chargedQuartzOreFeature); addQuartzWorldGen(b, quartzOreFeature, chargedQuartzOreFeature);
}); });
+1 -1
View File
@@ -652,7 +652,7 @@ final class Registration {
* world gen * world gen
*/ */
for (final IWorldGen.WorldGenType type : IWorldGen.WorldGenType.values()) { for (final IWorldGen.WorldGenType type : IWorldGen.WorldGenType.values()) {
registries.worldgen().disableWorldGenForDimension(type, World.field_234919_h_.getRegistryName()); registries.worldgen().disableWorldGenForDimension(type, World.THE_NETHER.getRegistryName());
} }
// whitelist from config // whitelist from config
@@ -221,7 +221,7 @@ public final class ApiItems implements IItems {
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public void setup() { public void setup() {
ColorApplicatorItem colorApplicatorItem = (ColorApplicatorItem) item; ColorApplicatorItem colorApplicatorItem = (ColorApplicatorItem) item;
ItemModelsProperties.func_239418_a_(item, new ResourceLocation(AppEng.MOD_ID, "colored"), ItemModelsProperties.registerProperty(item, new ResourceLocation(AppEng.MOD_ID, "colored"),
(itemStack, world, entity) -> { (itemStack, world, entity) -> {
// If the stack has no color, don't use the colored model since the impact of // If the stack has no color, don't use the colored model since the impact of
// calling getColor for every quad is extremely high, if the stack tries to // calling getColor for every quad is extremely high, if the stack tries to
@@ -67,7 +67,7 @@ public final class WorldGenRegistry implements IWorldGen {
throw new IllegalArgumentException("Bad Provider Passed"); throw new IllegalArgumentException("Bad Provider Passed");
} }
ResourceLocation id = w.func_234923_W_().func_240901_a_(); ResourceLocation id = w.getDimensionKey().getLocation();
final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains(id); final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains(id);
final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains(id); final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains(id);
@@ -119,7 +119,7 @@ public class NetworkHandler {
public void sendToAllAround(final BasePacket message, final TargetPoint point) { public void sendToAllAround(final BasePacket message, final TargetPoint point) {
IPacket<?> pkt = message.toPacket(NetworkDirection.PLAY_TO_CLIENT); IPacket<?> pkt = message.toPacket(NetworkDirection.PLAY_TO_CLIENT);
getServer().getPlayerList().sendToAllNearExcept(point.excluded, point.x, point.y, point.z, point.r2, getServer().getPlayerList().sendToAllNearExcept(point.excluded, point.x, point.y, point.z, point.r2,
point.world.func_234923_W_(), pkt); point.world.getDimensionKey(), pkt);
} }
public void sendToServer(final BasePacket message) { public void sendToServer(final BasePacket message) {
@@ -61,7 +61,7 @@ public final class WorldData implements IWorldData {
Preconditions.checkNotNull(overworld); Preconditions.checkNotNull(overworld);
// Attach shared data to the server's overworld dimension // Attach shared data to the server's overworld dimension
if (overworld.func_234923_W_() != ServerWorld.field_234918_g_) { if (overworld.getDimensionKey() != ServerWorld.OVERWORLD) {
throw new IllegalStateException("The server doesn't have an overworld we could store our data on!"); throw new IllegalStateException("The server doesn't have an overworld we could store our data on!");
} }
@@ -94,7 +94,7 @@ public final class WorldData implements IWorldData {
throw new IllegalStateException("No server set."); throw new IllegalStateException("No server set.");
} }
ServerWorld overworld = server.getWorld(ServerWorld.field_234918_g_); ServerWorld overworld = server.getWorld(ServerWorld.OVERWORLD);
instance = new WorldData(overworld); instance = new WorldData(overworld);
} }
return instance; return instance;
@@ -65,11 +65,10 @@ public class BlockDropProvider extends BlockLootTables implements IAE2DataProvid
public void act(@Nonnull DirectoryCache cache) throws IOException { public void act(@Nonnull DirectoryCache cache) throws IOException {
for (Map.Entry<RegistryKey<Block>, Block> entry : ForgeRegistries.BLOCKS.getEntries()) { for (Map.Entry<RegistryKey<Block>, Block> entry : ForgeRegistries.BLOCKS.getEntries()) {
LootTable.Builder builder; LootTable.Builder builder;
if (entry.getKey().func_240901_a_().getNamespace().equals(AppEng.MOD_ID)) { if (entry.getKey().getLocation().getNamespace().equals(AppEng.MOD_ID)) {
builder = overrides.getOrDefault(entry.getValue(), this::defaultBuilder).apply(entry.getValue()); builder = overrides.getOrDefault(entry.getValue(), this::defaultBuilder).apply(entry.getValue());
IDataProvider.save(GSON, cache, toJson(builder), IDataProvider.save(GSON, cache, toJson(builder), getPath(outputFolder, entry.getKey().getLocation()));
getPath(outputFolder, entry.getKey().func_240901_a_()));
} }
} }
} }
@@ -64,7 +64,7 @@ public class ChunkLoaderTileEntity extends AEBaseTileEntity implements ITickable
ServerWorld serverWorld = (ServerWorld) world; ServerWorld serverWorld = (ServerWorld) world;
if (!serverWorld.getForcedChunks().contains(chunkPos.asLong())) { if (!serverWorld.getForcedChunks().contains(chunkPos.asLong())) {
AELog.debug("Force-loading chunk @ %d,%d in %s", chunkPos.x, chunkPos.z, serverWorld.func_234923_W_()); AELog.debug("Force-loading chunk @ %d,%d in %s", chunkPos.x, chunkPos.z, serverWorld.getDimensionKey());
serverWorld.forceChunk(chunkPos.x, chunkPos.z, false); serverWorld.forceChunk(chunkPos.x, chunkPos.z, false);
} }
} }
@@ -101,7 +101,7 @@ public class ReplicatorCardItem extends AEBaseItem {
tag.putInt("y", y); tag.putInt("y", y);
tag.putInt("z", z); tag.putInt("z", z);
tag.putInt("side", side.ordinal()); tag.putInt("side", side.ordinal());
tag.putString("w", world.func_234923_W_().func_240901_a_().toString()); tag.putString("w", world.getDimensionKey().getLocation().toString());
tag.putInt("r", 0); tag.putInt("r", 0);
this.outputMsg(player, "Set replicator source"); this.outputMsg(player, "Set replicator source");
@@ -117,7 +117,7 @@ public class ReplicatorCardItem extends AEBaseItem {
final int src_side = ish.getInt("side"); final int src_side = ish.getInt("side");
final String worldId = ish.getString("w"); final String worldId = ish.getString("w");
final World src_w = world.getServer() final World src_w = world.getServer()
.getWorld(RegistryKey.func_240903_a_(Registry.WORLD_KEY, new ResourceLocation(worldId))); .getWorld(RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation(worldId)));
final int replications = ish.getInt("r") + 1; final int replications = ish.getInt("r") + 1;
final TileEntity te = src_w.getTileEntity(new BlockPos(src_x, src_y, src_z)); final TileEntity te = src_w.getTileEntity(new BlockPos(src_x, src_y, src_z));
@@ -176,7 +176,7 @@ public final class GrowingCrystalEntity extends AEBaseItemEntity {
BlockPos.Mutable testPos = new BlockPos.Mutable(); BlockPos.Mutable testPos = new BlockPos.Mutable();
for (Direction direction : Direction.values()) { for (Direction direction : Direction.values()) {
if (this.isPoweredAccelerator(testPos.func_239622_a_(pos, direction))) { if (this.isPoweredAccelerator(testPos.setAndMove(pos, direction))) {
count++; count++;
} }
} }
@@ -158,7 +158,7 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
} }
@Override @Override
protected void func_230459_a_(MatrixStack matrixStack, int mouseX, int mouseY) { protected void renderHoveredTooltip(MatrixStack matrixStack, int mouseX, int mouseY) {
final Slot slot = this.getSlot(mouseX, mouseY); final Slot slot = this.getSlot(mouseX, mouseY);
if (slot instanceof IMEFluidSlot && slot.isEnabled()) { if (slot instanceof IMEFluidSlot && slot.isEnabled()) {
@@ -181,7 +181,7 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
return; return;
} }
} }
super.func_230459_a_(matrixStack, mouseX, mouseY); super.renderHoveredTooltip(matrixStack, mouseX, mouseY);
} }
private <S extends Enum<S>> void toggleServerSetting(SettingToggleButton<S> btn, boolean backwards) { private <S extends Enum<S>> void toggleServerSetting(SettingToggleButton<S> btn, boolean backwards) {
@@ -111,7 +111,7 @@ public class CrystalSeedItem extends AEBaseItem implements IGrowableCrystal {
} }
// Check for the normal supported fluid // Check for the normal supported fluid
if (world != null && world.func_234923_W_() == World.field_234919_h_) { if (world != null && world.getDimensionKey() == World.THE_NETHER) {
// In the nether, use Lava as the "normal" fluid // In the nether, use Lava as the "normal" fluid
return state.getFluidState().isTagged(FluidTags.LAVA) ? 1 : 0; return state.getFluidState().isTagged(FluidTags.LAVA) ? 1 : 0;
} else { } else {
@@ -23,7 +23,7 @@ public class CrystalSeedRendering implements IClientSetupComponent {
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public void setup() { public void setup() {
// Expose the growth of the seed to the model system // Expose the growth of the seed to the model system
ItemModelsProperties.func_239418_a_(item, new ResourceLocation("appliedenergistics2:growth"), ItemModelsProperties.registerProperty(item, new ResourceLocation("appliedenergistics2:growth"),
(is, w, p) -> CrystalSeedItem.getGrowthTicks(is) / (float) CrystalSeedItem.GROWTH_TICKS_REQUIRED); (is, w, p) -> CrystalSeedItem.getGrowthTicks(is) / (float) CrystalSeedItem.GROWTH_TICKS_REQUIRED);
} }
} }
@@ -143,7 +143,7 @@ public class SpatialStorageCellItem extends AEBaseItem implements ISpatialStorag
} }
// Store some information about this transition in the plot // Store some information about this transition in the plot
TransitionInfo info = new TransitionInfo(w.func_234923_W_().func_240901_a_(), min.getBlockPos(), TransitionInfo info = new TransitionInfo(w.getDimensionKey().getLocation(), min.getBlockPos(),
max.getBlockPos(), Instant.now()); max.getBlockPos(), Instant.now());
manager.setLastTransition(plot.getId(), info); manager.setLastTransition(plot.getId(), info);
@@ -162,7 +162,7 @@ public class QuantumCluster implements ILocatable, IAECluster {
// until the center // until the center
// tile begins ticking normally. // tile begins ticking normally.
if (theWorld.isBlockLoaded(qc.center.getPos())) { if (theWorld.isBlockLoaded(qc.center.getPos())) {
final World cur = theWorld.getServer().getWorld(theWorld.func_234923_W_()); final World cur = theWorld.getServer().getWorld(theWorld.getDimensionKey());
final TileEntity te = theWorld.getTileEntity(qc.center.getPos()); final TileEntity te = theWorld.getTileEntity(qc.center.getPos());
return te != qc.center || theWorld != cur; return te != qc.center || theWorld != cur;
@@ -10,7 +10,7 @@ import net.minecraft.world.gen.feature.IFeatureConfig;
@Mixin(Features.class) @Mixin(Features.class)
public interface ConfiguredFeaturesAccessor { public interface ConfiguredFeaturesAccessor {
@Invoker("func_243968_a") @Invoker("register")
static <FC extends IFeatureConfig> ConfiguredFeature<FC, ?> register(String id, static <FC extends IFeatureConfig> ConfiguredFeature<FC, ?> register(String id,
ConfiguredFeature<FC, ?> configuredFeature) { ConfiguredFeature<FC, ?> configuredFeature) {
throw new AssertionError(); throw new AssertionError();
@@ -20,8 +20,8 @@ public class BiomesMixin {
@Inject(method = "<clinit>", at = @At("TAIL")) @Inject(method = "<clinit>", at = @At("TAIL"))
private static void registerBiomes(CallbackInfo ci) { private static void registerBiomes(CallbackInfo ci) {
WorldGenRegistries.func_243664_a(WorldGenRegistries.field_243657_i, WorldGenRegistries.register(WorldGenRegistries.BIOME, SpatialStorageDimensionIds.BIOME_KEY.getLocation(),
SpatialStorageDimensionIds.BIOME_KEY.func_240901_a_(), SpatialStorageBiome.INSTANCE); SpatialStorageBiome.INSTANCE);
} }
} }
@@ -39,28 +39,28 @@ public class DimensionTypeMixin {
throw new AssertionError(); throw new AssertionError();
} }
@Inject(method = "func_236027_a_", at = @At("TAIL")) @Inject(method = "registerTypes", at = @At("TAIL"))
private static void addRegistryDefaults(DynamicRegistries.Impl registryTracker, CallbackInfoReturnable<?> cir) { private static void addRegistryDefaults(DynamicRegistries.Impl registryTracker, CallbackInfoReturnable<?> cir) {
DimensionType dimensionType = create(OptionalLong.of(12000), false, false, false, false, 1.0, false, false, DimensionType dimensionType = create(OptionalLong.of(12000), false, false, false, false, 1.0, false, false,
false, false, 256, BlockTags.INFINIBURN_OVERWORLD.getName(), false, false, 256, BlockTags.INFINIBURN_OVERWORLD.getName(),
SpatialStorageDimensionIds.SKY_PROPERTIES_ID, 1.0f); SpatialStorageDimensionIds.SKY_PROPERTIES_ID, 1.0f);
Registry.register(registryTracker.func_230520_a_(), Registry.register(registryTracker.func_230520_a_(), SpatialStorageDimensionIds.DIMENSION_TYPE_ID.getLocation(),
SpatialStorageDimensionIds.DIMENSION_TYPE_ID.func_240901_a_(), dimensionType); dimensionType);
} }
/** /**
* Insert our custom dimension into the initial registry. <em>This is what will * Insert our custom dimension into the initial registry. <em>This is what will
* ultimately lead to the creation of a new World.</em> * ultimately lead to the creation of a new World.</em>
*/ */
@Inject(method = "func_242718_a", at = @At("RETURN")) @Inject(method = "getDefaultSimpleRegistry", at = @At("RETURN"))
private static void buildDimensionRegistry(Registry<DimensionType> dimensionTypes, Registry<Biome> biomes, private static void buildDimensionRegistry(Registry<DimensionType> dimensionTypes, Registry<Biome> biomes,
Registry<DimensionSettings> dimensionSettings, long seed, Registry<DimensionSettings> dimensionSettings, long seed,
CallbackInfoReturnable<SimpleRegistry<Dimension>> cir) { CallbackInfoReturnable<SimpleRegistry<Dimension>> cir) {
SimpleRegistry<Dimension> simpleregistry = cir.getReturnValue(); SimpleRegistry<Dimension> simpleregistry = cir.getReturnValue();
simpleregistry.register(SpatialStorageDimensionIds.DIMENSION_ID, new Dimension(() -> { simpleregistry.register(SpatialStorageDimensionIds.DIMENSION_ID, new Dimension(() -> {
return dimensionTypes.func_243576_d(SpatialStorageDimensionIds.DIMENSION_TYPE_ID); return dimensionTypes.getOrThrow(SpatialStorageDimensionIds.DIMENSION_TYPE_ID);
}, new SpatialStorageChunkGenerator(biomes)), Lifecycle.stable()); }, new SpatialStorageChunkGenerator(biomes)), Lifecycle.stable());
} }
@@ -22,7 +22,7 @@ public class EntityMixin {
@Inject(method = "func_241829_a", at = @At("HEAD"), cancellable = true, allow = 1) @Inject(method = "func_241829_a", at = @At("HEAD"), cancellable = true, allow = 1)
public void getTeleportTarget(ServerWorld destination, CallbackInfoReturnable<PortalInfo> cri) { public void getTeleportTarget(ServerWorld destination, CallbackInfoReturnable<PortalInfo> cri) {
// Check if a destination has been set for the entity currently being teleported // Check if a destination has been set for the entity currently being teleported
if (destination.func_234923_W_() == SpatialStorageDimensionIds.WORLD_ID) { if (destination.getDimensionKey() == SpatialStorageDimensionIds.WORLD_ID) {
PortalInfo target = SpatialStorageHelper.getInstance().getTeleportTarget(); PortalInfo target = SpatialStorageHelper.getInstance().getTeleportTarget();
if (target != null) { if (target != null) {
cri.setReturnValue(target); cri.setReturnValue(target);
@@ -23,7 +23,7 @@ public class SkyRenderMixin {
@SuppressWarnings("ConstantConditions") @SuppressWarnings("ConstantConditions")
@Inject(method = "renderSky(Lcom/mojang/blaze3d/matrix/MatrixStack;F)V", at = @At("HEAD"), cancellable = true) @Inject(method = "renderSky(Lcom/mojang/blaze3d/matrix/MatrixStack;F)V", at = @At("HEAD"), cancellable = true)
public void renderSky(MatrixStack matrices, float tickDelta, CallbackInfo ci) { public void renderSky(MatrixStack matrices, float tickDelta, CallbackInfo ci) {
if (mc.world.func_234923_W_() == SpatialStorageDimensionIds.WORLD_ID) { if (mc.world.getDimensionKey() == SpatialStorageDimensionIds.WORLD_ID) {
SpatialSkyRender.getInstance().render(matrices); SpatialSkyRender.getInstance().render(matrices);
ci.cancel(); ci.cancel();
} }
@@ -20,6 +20,6 @@ import net.minecraft.world.gen.feature.structure.Structure;
public interface BiomeAccessor { public interface BiomeAccessor {
@Accessor @Accessor
Map<Integer, List<Structure<?>>> getField_242421_g(); Map<Integer, List<Structure<?>>> getBiomeStructures();
} }
@@ -16,16 +16,16 @@ import net.minecraft.world.gen.feature.StructureFeature;
@Mixin(BiomeGenerationSettings.class) @Mixin(BiomeGenerationSettings.class)
public interface GenerationSettingsAccessor { public interface GenerationSettingsAccessor {
@Accessor("field_242484_f") @Accessor("features")
List<List<Supplier<ConfiguredFeature<?, ?>>>> getFeatures(); List<List<Supplier<ConfiguredFeature<?, ?>>>> getFeatures();
@Accessor("field_242484_f") @Accessor("features")
void setFeatures(List<List<Supplier<ConfiguredFeature<?, ?>>>> features); void setFeatures(List<List<Supplier<ConfiguredFeature<?, ?>>>> features);
@Accessor("field_242485_g") @Accessor("structures")
List<Supplier<StructureFeature<?, ?>>> getStructureFeatures(); List<Supplier<StructureFeature<?, ?>>> getStructureFeatures();
@Accessor("field_242485_g") @Accessor("structures")
void setStructureFeatures(List<Supplier<StructureFeature<?, ?>>> structureFeatures); void setStructureFeatures(List<Supplier<StructureFeature<?, ?>>> structureFeatures);
} }
@@ -433,7 +433,7 @@ public class FormationPlanePart extends AbstractFormationPlanePart<IAEItemStack>
} }
@Override @Override
public boolean func_225518_g_() { public boolean hasSecondaryUseForPlayer() {
return false; return false;
} }
@@ -101,7 +101,7 @@ public class PlaneBakedModel implements IDynamicBakedModel {
} }
@Override @Override
public boolean func_230044_c_() { public boolean isSideLit() {
return false;// TODO return false;// TODO
} }
@@ -90,7 +90,7 @@ public class SpatialStorageCommand implements ISubCommand {
*/ */
private void teleportBack(CommandSource source) { private void teleportBack(CommandSource source) {
if (source.getWorld().func_234923_W_() != SpatialStorageDimensionIds.WORLD_ID) { if (source.getWorld().getDimensionKey() != SpatialStorageDimensionIds.WORLD_ID) {
throw new CommandException(new StringTextComponent("Must be within the spatial storage world.")); throw new CommandException(new StringTextComponent("Must be within the spatial storage world."));
} }
@@ -156,7 +156,7 @@ public class SpatialStorageCommand implements ISubCommand {
sendKeyValuePair(source, "Size", formatBlockPos(plot.getSize(), "x")); sendKeyValuePair(source, "Size", formatBlockPos(plot.getSize(), "x"));
// Show the plot's origin and make it clickable to teleport directly to it // Show the plot's origin and make it clickable to teleport directly to it
String teleportToPlotCommand = getTeleportCommand(SpatialStorageDimensionIds.WORLD_ID.func_240901_a_(), String teleportToPlotCommand = getTeleportCommand(SpatialStorageDimensionIds.WORLD_ID.getLocation(),
plot.getOrigin()); plot.getOrigin());
sendKeyValuePair(source, "Origin", new StringTextComponent(formatBlockPos(plot.getOrigin(), ",")) sendKeyValuePair(source, "Origin", new StringTextComponent(formatBlockPos(plot.getOrigin(), ","))
.modifyStyle(makeCommandLink(teleportToPlotCommand, "Teleport into plot"))); .modifyStyle(makeCommandLink(teleportToPlotCommand, "Teleport into plot")));
@@ -188,7 +188,7 @@ public class SpatialStorageCommand implements ISubCommand {
private static void teleportToPlot(CommandSource source, int plotId) { private static void teleportToPlot(CommandSource source, int plotId) {
SpatialStoragePlot plot = getPlot(plotId); SpatialStoragePlot plot = getPlot(plotId);
String teleportCommand = getTeleportCommand(SpatialStorageDimensionIds.WORLD_ID.func_240901_a_(), String teleportCommand = getTeleportCommand(SpatialStorageDimensionIds.WORLD_ID.getLocation(),
plot.getOrigin()); plot.getOrigin());
runCommandFor(source, teleportCommand); runCommandFor(source, teleportCommand);
@@ -302,7 +302,7 @@ public class SpatialStorageCommand implements ISubCommand {
* Gets the spatial storage plot that the command source is currently in. * Gets the spatial storage plot that the command source is currently in.
*/ */
private static SpatialStoragePlot getCurrentPlot(CommandSource source) { private static SpatialStoragePlot getCurrentPlot(CommandSource source) {
if (source.getWorld().func_234923_W_() != SpatialStorageDimensionIds.WORLD_ID) { if (source.getWorld().getDimensionKey() != SpatialStorageDimensionIds.WORLD_ID) {
throw new CommandException(new StringTextComponent("Must be within the spatial storage world.")); throw new CommandException(new StringTextComponent("Must be within the spatial storage world."));
} }
@@ -87,8 +87,8 @@ public class TestMeteoritesCommand implements ISubCommand {
world = player.getServerWorld(); world = player.getServerWorld();
centerBlock = new BlockPos(player.getPosX(), 0, player.getPosZ()); centerBlock = new BlockPos(player.getPosX(), 0, player.getPosZ());
} else { } else {
world = srv.getWorld(World.field_234918_g_); world = srv.getWorld(World.OVERWORLD);
centerBlock = world.func_241135_u_(); centerBlock = world.getSpawnPoint();
} }
ChunkPos center = new ChunkPos(centerBlock); ChunkPos center = new ChunkPos(centerBlock);
@@ -172,7 +172,7 @@ public class TestMeteoritesCommand implements ISubCommand {
msg.append(getClickablePosition(world, settings, pos)).append(restOfLine); msg.append(getClickablePosition(world, settings, pos)).append(restOfLine);
// Add a tooltip // Add a tooltip
String biomeId = world.func_242406_i(pos).map(bk -> bk.func_240901_a_().toString()).orElse("unknown"); String biomeId = world.func_242406_i(pos).map(bk -> bk.getLocation().toString()).orElse("unknown");
ITextComponent tooltip = new StringTextComponent(settings.toString() + "\nBiome: ").deepCopy() ITextComponent tooltip = new StringTextComponent(settings.toString() + "\nBiome: ").deepCopy()
.appendString(biomeId); .appendString(biomeId);
msg.modifyStyle(style -> style.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, tooltip))); msg.modifyStyle(style -> style.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, tooltip)));
@@ -68,8 +68,8 @@ public class TestOreGenCommand implements ISubCommand {
world = player.getServerWorld(); world = player.getServerWorld();
center = new BlockPos(player.getPosX(), 0, player.getPosZ()); center = new BlockPos(player.getPosX(), 0, player.getPosZ());
} catch (CommandSyntaxException e) { } catch (CommandSyntaxException e) {
world = srv.getWorld(World.field_234918_g_); world = srv.getWorld(World.OVERWORLD);
center = world.func_241135_u_(); center = world.getSpawnPoint();
} }
ChunkPos tl = new ChunkPos(center.add(-radius, 0, -radius)); ChunkPos tl = new ChunkPos(center.add(-radius, 0, -radius));
@@ -31,14 +31,14 @@ import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
public class SpatialStorageBiome { public class SpatialStorageBiome {
public static final Biome INSTANCE = new Biome.Builder() public static final Biome INSTANCE = new Biome.Builder()
.func_242457_a(new BiomeGenerationSettings.Builder().func_242517_a( .withGenerationSettings(new BiomeGenerationSettings.Builder().withSurfaceBuilder(
new ConfiguredSurfaceBuilder<>(SurfaceBuilder.NOPE, SurfaceBuilder.STONE_STONE_GRAVEL_CONFIG)) new ConfiguredSurfaceBuilder<>(SurfaceBuilder.NOPE, SurfaceBuilder.STONE_STONE_GRAVEL_CONFIG))
.func_242508_a()) .build())
.precipitation(Biome.RainType.NONE).category(Biome.Category.NONE).depth(0).scale(1) .precipitation(Biome.RainType.NONE).category(Biome.Category.NONE).depth(0).scale(1)
// Copied from the vanilla void biome // Copied from the vanilla void biome
.temperature(0.5F).downfall(0.5F) .temperature(0.5F).downfall(0.5F)
.func_235097_a_(new BiomeAmbience.Builder().setWaterColor(4159204).setWaterFogColor(329011).setFogColor(0) .setEffects(new BiomeAmbience.Builder().setWaterColor(4159204).setWaterFogColor(329011).setFogColor(0)
.func_242539_d(0x111111).build()) .withSkyColor(0x111111).build())
.func_242458_a(new MobSpawnInfo.Builder().func_242572_a(0).func_242577_b()).func_242455_a(); .withMobSpawnSettings(new MobSpawnInfo.Builder().withCreatureSpawnProbability(0).copy()).build();
} }
@@ -58,7 +58,7 @@ public class SpatialStorageChunkGenerator extends ChunkGenerator {
* uses an identity hashmap internally. * uses an identity hashmap internally.
*/ */
public static final Codec<SpatialStorageChunkGenerator> CODEC = RegistryLookupCodec public static final Codec<SpatialStorageChunkGenerator> CODEC = RegistryLookupCodec
.func_244331_a(Registry.BIOME_KEY) .getLookUpCodec(Registry.BIOME_KEY)
.xmap(SpatialStorageChunkGenerator::new, SpatialStorageChunkGenerator::getBiomeRegistry).stable().codec(); .xmap(SpatialStorageChunkGenerator::new, SpatialStorageChunkGenerator::getBiomeRegistry).stable().codec();
private final Registry<Biome> biomeRegistry; private final Registry<Biome> biomeRegistry;
@@ -85,8 +85,7 @@ public class SpatialStorageChunkGenerator extends ChunkGenerator {
} }
private static SingleBiomeProvider createBiomeSource(Registry<Biome> biomeRegistry) { private static SingleBiomeProvider createBiomeSource(Registry<Biome> biomeRegistry) {
return new SingleBiomeProvider( return new SingleBiomeProvider(biomeRegistry.getOrThrow(SpatialStorageDimensionIds.BIOME_KEY));
biomeRegistry.func_243576_d/* getOrThrow */(SpatialStorageDimensionIds.BIOME_KEY));
} }
public Registry<Biome> getBiomeRegistry() { public Registry<Biome> getBiomeRegistry() {
@@ -22,7 +22,7 @@ public final class SpatialStorageDimensionIds {
* This is defined in {@link DimensionTypeMixin}. * This is defined in {@link DimensionTypeMixin}.
*/ */
public static final RegistryKey<DimensionType> DIMENSION_TYPE_ID = RegistryKey public static final RegistryKey<DimensionType> DIMENSION_TYPE_ID = RegistryKey
.func_240903_a_(Registry.DIMENSION_TYPE_KEY, AppEng.makeId("spatial_storage")); .getOrCreateKey(Registry.DIMENSION_TYPE_KEY, AppEng.makeId("spatial_storage"));
/** /**
* ID of the {@link net.minecraft.world.gen.ChunkGenerator} used for the spatial * ID of the {@link net.minecraft.world.gen.ChunkGenerator} used for the spatial
@@ -34,7 +34,7 @@ public final class SpatialStorageDimensionIds {
* ID of the {@link net.minecraft.world.biome.Biome} used for the spatial * ID of the {@link net.minecraft.world.biome.Biome} used for the spatial
* storage world. * storage world.
*/ */
public static final RegistryKey<Biome> BIOME_KEY = RegistryKey.func_240903_a_(Registry.BIOME_KEY, public static final RegistryKey<Biome> BIOME_KEY = RegistryKey.getOrCreateKey(Registry.BIOME_KEY,
AppEng.makeId("spatial_storage")); AppEng.makeId("spatial_storage"));
/** /**
@@ -42,14 +42,14 @@ public final class SpatialStorageDimensionIds {
* <p> * <p>
* This is defined in {@link appeng.mixins.spatial.DimensionTypeMixin}. * This is defined in {@link appeng.mixins.spatial.DimensionTypeMixin}.
*/ */
public static final RegistryKey<Dimension> DIMENSION_ID = RegistryKey.func_240903_a_(Registry.DIMENSION_KEY, public static final RegistryKey<Dimension> DIMENSION_ID = RegistryKey.getOrCreateKey(Registry.DIMENSION_KEY,
AppEng.makeId("spatial_storage")); AppEng.makeId("spatial_storage"));
/** /**
* ID of the {@link World} that is instantiated from the dimension/dimension * ID of the {@link World} that is instantiated from the dimension/dimension
* type. * type.
*/ */
public static final RegistryKey<World> WORLD_ID = RegistryKey.func_240903_a_(Registry.WORLD_KEY, public static final RegistryKey<World> WORLD_ID = RegistryKey.getOrCreateKey(Registry.WORLD_KEY,
AppEng.makeId("spatial_storage")); AppEng.makeId("spatial_storage"));
/** /**
@@ -109,7 +109,7 @@ public class SpatialStorageHelper {
newWorld.getChunkProvider().getChunk(MathHelper.floor(link.x) >> 4, MathHelper.floor(link.z) >> 4, newWorld.getChunkProvider().getChunk(MathHelper.floor(link.x) >> 4, MathHelper.floor(link.z) >> 4,
ChunkStatus.FULL, true); ChunkStatus.FULL, true);
if (entity instanceof ServerPlayerEntity && link.dim.func_234923_W_() == SpatialStorageDimensionIds.WORLD_ID) { if (entity instanceof ServerPlayerEntity && link.dim.getDimensionKey() == SpatialStorageDimensionIds.WORLD_ID) {
AppEng.instance().getAdvancementTriggers().getSpatialExplorer().trigger((ServerPlayerEntity) entity); AppEng.instance().getAdvancementTriggers().getSpatialExplorer().trigger((ServerPlayerEntity) entity);
} }
@@ -25,7 +25,7 @@ public final class BiomeModifier {
@SuppressWarnings("ConstantConditions") @SuppressWarnings("ConstantConditions")
public BiomeModifier(Biome biome) { public BiomeModifier(Biome biome) {
this.biomeAccessor = (BiomeAccessor) (Object) biome; this.biomeAccessor = (BiomeAccessor) (Object) biome;
this.generationSettingsAccessor = (GenerationSettingsAccessor) biome.func_242440_e(); this.generationSettingsAccessor = (GenerationSettingsAccessor) biome.getGenerationSettings();
} }
public void addFeature(GenerationStage.Decoration step, ConfiguredFeature<?, ?> feature) { public void addFeature(GenerationStage.Decoration step, ConfiguredFeature<?, ?> feature) {
@@ -55,7 +55,7 @@ public final class BiomeModifier {
// Add it to the structures that will generate pieces within this biome, // Add it to the structures that will generate pieces within this biome,
// this is only half-correct since a structure can start in an adjacent biome // this is only half-correct since a structure can start in an adjacent biome
// and extend into biomes that would usually not start the structure // and extend into biomes that would usually not start the structure
Map<Integer, List<Structure<?>>> structuresByStage = biomeAccessor.getField_242421_g(); Map<Integer, List<Structure<?>>> structuresByStage = biomeAccessor.getBiomeStructures();
int step = structure.field_236268_b_.func_236396_f_().ordinal(); int step = structure.field_236268_b_.func_236396_f_().ordinal();
if (!structuresByStage.containsKey(step)) { if (!structuresByStage.containsKey(step)) {
structuresByStage.put(step, new ArrayList<>()); structuresByStage.put(step, new ArrayList<>());
@@ -13,8 +13,8 @@ import net.minecraft.world.gen.feature.ReplaceBlockConfig;
public class ChargedQuartzOreConfig implements IFeatureConfig { public class ChargedQuartzOreConfig implements IFeatureConfig {
public static final Codec<ChargedQuartzOreConfig> CODEC = RecordCodecBuilder.create((instance) -> instance public static final Codec<ChargedQuartzOreConfig> CODEC = RecordCodecBuilder.create((instance) -> instance
.group(BlockState.BLOCKSTATE_CODEC.fieldOf("target").forGetter((config) -> config.target), .group(BlockState.CODEC.fieldOf("target").forGetter((config) -> config.target),
BlockState.BLOCKSTATE_CODEC.fieldOf("state").forGetter((config) -> config.state), BlockState.CODEC.fieldOf("state").forGetter((config) -> config.state),
Codec.FLOAT.fieldOf("chance").orElse(0f).forGetter((config) -> config.chance)) Codec.FLOAT.fieldOf("chance").orElse(0f).forGetter((config) -> config.chance))
.apply(instance, ChargedQuartzOreConfig::new)); .apply(instance, ChargedQuartzOreConfig::new));
@@ -27,9 +27,9 @@ import appeng.worldgen.meteorite.fallout.FalloutMode;
public class MeteoriteStructureStart extends StructureStart<NoFeatureConfig> { public class MeteoriteStructureStart extends StructureStart<NoFeatureConfig> {
private final ITag<Block> sandTag = BlockTags.getCollection().func_241834_b(new ResourceLocation("minecraft:sand")); private final ITag<Block> sandTag = BlockTags.getCollection().getTagByID(new ResourceLocation("minecraft:sand"));
private final ITag<Block> terracottaTag = BlockTags.getCollection() private final ITag<Block> terracottaTag = BlockTags.getCollection()
.func_241834_b(new ResourceLocation("forge:terracotta")); .getTagByID(new ResourceLocation("forge:terracotta"));
public MeteoriteStructureStart(Structure<NoFeatureConfig> p_i225815_1_, int p_i225815_2_, int p_i225815_3_, public MeteoriteStructureStart(Structure<NoFeatureConfig> p_i225815_1_, int p_i225815_2_, int p_i225815_3_,
MutableBoundingBox p_i225815_4_, int p_i225815_5_, long p_i225815_6_) { MutableBoundingBox p_i225815_4_, int p_i225815_5_, long p_i225815_6_) {
@@ -76,7 +76,8 @@ public class MeteoriteStructureStart extends StructureStart<NoFeatureConfig> {
boolean craterLake = this.locateWaterAroundTheCrater(generator, actualPos, meteoriteRadius); boolean craterLake = this.locateWaterAroundTheCrater(generator, actualPos, meteoriteRadius);
CraterType craterType = this.determineCraterType(spawnBiome); CraterType craterType = this.determineCraterType(spawnBiome);
boolean pureCrater = this.rand.nextFloat() > .9f; boolean pureCrater = this.rand.nextFloat() > .9f;
FalloutMode fallout = getFalloutFromBaseBlock(spawnBiome.func_242440_e().func_242502_e().getTop()); FalloutMode fallout = getFalloutFromBaseBlock(
spawnBiome.getGenerationSettings().getSurfaceBuilderConfig().getTop());
components.add( components.add(
new MeteoriteStructurePiece(actualPos, meteoriteRadius, craterType, fallout, pureCrater, craterLake)); new MeteoriteStructurePiece(actualPos, meteoriteRadius, craterType, fallout, pureCrater, craterLake));
@@ -121,7 +122,7 @@ public class MeteoriteStructureStart extends StructureStart<NoFeatureConfig> {
private CraterType determineCraterType(Biome biome) { private CraterType determineCraterType(Biome biome) {
// The temperature thresholds below are taken from older Vanilla code // The temperature thresholds below are taken from older Vanilla code
// (temperature categories) // (temperature categories)
final float temp = biome.func_242445_k(); final float temp = biome.getTemperature();
final Category category = biome.getCategory(); final Category category = biome.getCategory();
// No craters in oceans // No craters in oceans
@@ -36,7 +36,7 @@ public class FalloutCopy extends Fallout {
public FalloutCopy(final IWorld w, BlockPos pos, final MeteoriteBlockPutter putter, final BlockState skyStone) { public FalloutCopy(final IWorld w, BlockPos pos, final MeteoriteBlockPutter putter, final BlockState skyStone) {
super(putter, skyStone); super(putter, skyStone);
this.putter = putter; this.putter = putter;
this.block = w.getBiome(pos).func_242440_e().func_242502_e().getTop(); this.block = w.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTop();
} }
@Override @Override