Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Update mappings to stable_43 #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {

minecraft {
version = '1.13'
mappings = 'snapshot_20180908'
mappings = 'stable_43'
runDir = 'run'
tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
makeObfSourceJar = false
Expand Down
2 changes: 1 addition & 1 deletion src/debug/java/org/dimdev/testmod/ItemPacketTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public EnumActionResult onItemUse(ItemUseContext context) {

int data = (int) (Math.random() * 1000);
log.info("Sending test packet and message to server: " + data);
Minecraft.getMinecraft().getConnection().sendPacket(new CPacketTest(data));
Minecraft.getInstance().getConnection().sendPacket(new CPacketTest(data));

new TestMessage(data).sendToServer();

Expand Down
8 changes: 4 additions & 4 deletions src/debug/java/org/dimdev/testmod/TestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public void registerBlocks() {

@Override
public void registerItems() {
Item.registerItemBlock(WHITE_BLOCK, ItemGroup.BUILDING_BLOCKS);
Item.registerItemBlock(TRANSLUCENT_WHITE_BLOCK, ItemGroup.BUILDING_BLOCKS);
Item.registerItem(new ResourceLocation("testmod", "packet_tester"), PACKET_TESTER);
Item.register(WHITE_BLOCK, ItemGroup.BUILDING_BLOCKS);
Item.register(TRANSLUCENT_WHITE_BLOCK, ItemGroup.BUILDING_BLOCKS);
Item.register(new ResourceLocation("testmod", "packet_tester"), PACKET_TESTER);
}

@Override
Expand Down Expand Up @@ -107,6 +107,6 @@ public Set<? extends DimensionType> getDimensionTypes() {

@Override
public void registerMessages(RegistryNamespaced<ResourceLocation, Class<? extends Message>> registry) {
registry.putObject(new ResourceLocation("testmod", "test_message"), TestMessage.class);
registry.put(new ResourceLocation("testmod", "test_message"), TestMessage.class);
}
}
18 changes: 9 additions & 9 deletions src/debug/java/org/dimdev/testmod/WhiteFluid.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Item getFilledBucket() {
}

@Override
public void randomDisplayTick(World world, BlockPos pos, IFluidState state, Random random) {}
public void randomTick(World world, BlockPos pos, IFluidState state, Random random) {}

@Override @Nullable
public IParticleData getDripParticleData() {
Expand All @@ -74,11 +74,11 @@ public int getSlopeFindDistance(IWorldReaderBase worldIn) {

@Override
public IBlockState getBlockState(IFluidState state) {
return TestMod.BLOCK_WHITE_FLUID.getDefaultState().withProperty(BlockFlowingFluid.LEVEL, getLevelFromState(state));
return TestMod.BLOCK_WHITE_FLUID.getDefaultState().with(BlockFlowingFluid.LEVEL, getLevelFromState(state));
}

@Override
public boolean isSameAs(Fluid fluid) {
public boolean isEquivalentTo(Fluid fluid) {
return fluid == TestMod.WHITE_FLUID || fluid == TestMod.FLOWING_WHITE_FLUID;
}

Expand All @@ -104,12 +104,12 @@ protected float getExplosionResistance() {

@Override
public TextureAtlasSprite getStillTexture() {
return Minecraft.getMinecraft().getModelManager().getBlockModelShapes().getModelForState(TestMod.BLOCK_WHITE_FLUID.getDefaultState()).getParticleTexture();
return Minecraft.getInstance().getModelManager().getBlockModelShapes().getModel(TestMod.BLOCK_WHITE_FLUID.getDefaultState()).getParticleTexture();
}

@Override
public TextureAtlasSprite getFlowingTexture() {
return Minecraft.getMinecraft().getTextureMapBlocks().getSprite(new ResourceLocation("testmod", "block/white_fluid_flow"));
return Minecraft.getInstance().getTextureMap().getSprite(new ResourceLocation("testmod", "block/white_fluid_flow"));
}

@Override
Expand All @@ -122,14 +122,14 @@ public static class Flowing extends WhiteFluid {
public Flowing() {}

@Override
protected void buildStateContainer(StateContainer.Builder<Fluid, IFluidState> builder) {
super.buildStateContainer(builder);
builder.add(LEVEL_1_TO_8);
protected void fillStateContainer(StateContainer.Builder<Fluid, IFluidState> builder) {
super.fillStateContainer(builder);
builder.add(FlowingFluid.LEVEL_1_8);
}

@Override
public int getLevel(IFluidState getLevel) {
return getLevel.getValue(LEVEL_1_TO_8);
return getLevel.get(FlowingFluid.LEVEL_1_8);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@

@Mixin(VanillaPack.class)
public class MixinVanillaPack {
@Shadow public static Path field_199754_a;
@Shadow public static Path basePath;

/**
* @reason Give priority to resources in the Minecraft jar to avoid them
* from being overwritten by mods.
*/
@Overwrite
@Nullable
protected InputStream func_195782_c(ResourcePackType type, ResourceLocation location) {
protected InputStream getInputStreamVanilla(ResourcePackType type, ResourceLocation location) {
String pathString = type.getDirectoryName() + "/" + location.getNamespace() + "/" + location.getPath();

if (field_199754_a != null) {
Path path = field_199754_a.resolve(pathString);
if (basePath != null) {
Path path = basePath.resolve(pathString);
if (Files.exists(path)) {
try {
return Files.newInputStream(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
public abstract class MixinBlockFluidRenderer {
@Shadow private static boolean isAdjacentFluidSameAs(IBlockReader world, BlockPos pos, EnumFacing side, IFluidState state) { return false; }
@Shadow private static boolean func_209556_a(IBlockReader p_209556_0_, BlockPos p_209556_1_, EnumFacing p_209556_2_, float p_209556_3_) { return false; }
@Shadow protected abstract float func_204504_a(IWorldReaderBase p_204504_1_, BlockPos p_204504_2_, Fluid p_204504_3_);
@Shadow protected abstract int func_204835_a(IWorldReader p_204835_1_, BlockPos p_204835_2_);
@Shadow protected abstract float getFluidHeight(IWorldReaderBase p_204504_1_, BlockPos p_204504_2_, Fluid p_204504_3_);
@Shadow protected abstract int getCombinedLightUpMax(IWorldReader p_204835_1_, BlockPos p_204835_2_);
@Shadow private TextureAtlasSprite atlasSpriteWaterOverlay;

@Overwrite
Expand Down Expand Up @@ -62,10 +62,10 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF

boolean rendered = false;

float var17 = func_204504_a(world, pos, state.getFluid());
float var18 = func_204504_a(world, pos.south(), state.getFluid());
float var19 = func_204504_a(world, pos.east().south(), state.getFluid());
float var20 = func_204504_a(world, pos.east(), state.getFluid());
float var17 = getFluidHeight(world, pos, state.getFluid());
float var18 = getFluidHeight(world, pos.south(), state.getFluid());
float var19 = getFluidHeight(world, pos.east().south(), state.getFluid());
float var20 = getFluidHeight(world, pos.east(), state.getFluid());

double x = pos.getX();
double y = pos.getY();
Expand Down Expand Up @@ -115,7 +115,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
var34 = texture.getInterpolatedV(8 + (-var37 - var36) * 16);
}

int blockLight = func_204835_a(world, pos);
int blockLight = getCombinedLightUpMax(world, pos);
int skyLight = blockLight >> 16;

buffer.pos(x, y + var17, z).color(redMultiplier, greenMultiplier, blueMultiplier, 1).tex(minU, var28).lightmap(skyLight, blockLight).endVertex();
Expand All @@ -136,7 +136,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
minV = stillTexture.getMinV();
maxV = stillTexture.getMaxV();

int blockLight = func_204835_a(world, pos.down());
int blockLight = getCombinedLightUpMax(world, pos.down());
int skyLight = blockLight >> 16;

float darkerRedMultiplier = 0.5F * redMultiplier;
Expand Down Expand Up @@ -212,7 +212,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
float var60 = texture.getInterpolatedV((1 - maxU) * 16 * 0.5);
float var61 = texture.getInterpolatedV((1 - minV) * 16 * 0.5);
float var62 = texture.getInterpolatedV(8);
int var63 = func_204835_a(world, var55);
int var63 = getCombinedLightUpMax(world, var55);
int var64 = var63 >> 16;
float colorDarkness = direction < 2 ? 0.8F : 0.6F;
float var67 = colorDarkness * redMultiplier;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dimdev/rift/mixin/hook/MixinBiome.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private static void onRegisterBiomes(CallbackInfo ci) {
}
}

@Inject(method = "registerBiome", at = @At(value = "RETURN"))
@Inject(method = "register", at = @At(value = "RETURN"))
private static void onRegisterBiome(int biomeId, String biomeName, Biome biome, CallbackInfo ci) {
for (WorldChanger worldChanger : RiftLoader.instance.getListeners(WorldChanger.class)) {
worldChanger.modifyBiome(biomeId, biomeName, biome);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public abstract class MixinMinecraftServer {
@Shadow public abstract GameType getGameType();
@Shadow public abstract boolean canStructuresSpawn();
@Shadow public abstract boolean isHardcore();
@Shadow public abstract void func_195560_a(File p_195560_1_, WorldInfo p_195560_2_);
@Shadow public abstract void loadDataPacks(File p_195560_1_, WorldInfo p_195560_2_);
@Shadow public abstract void initialWorldChunkLoad();
@Shadow public abstract void setDifficultyForAllWorlds(EnumDifficulty p_setDifficultyForAllWorlds_1_);
@Shadow public abstract CustomBossEvents getCustomBossEvents();
Expand All @@ -61,7 +61,7 @@ public abstract class MixinMinecraftServer {
private Map<DimensionType, Integer> dimensionTypeToWorldIndex = new HashMap<>();
private Map<Integer, Integer> dimensionIdToWorldIndex = new HashMap<>();

@Inject(method = "func_195560_a", at = @At(value = "INVOKE", target = "Lnet/minecraft/resources/ResourcePackList;addPackFinder(Lnet/minecraft/resources/IPackFinder;)V", shift = At.Shift.AFTER))
@Inject(method = "loadDataPacks", at = @At(value = "INVOKE", target = "Lnet/minecraft/resources/ResourcePackList;addPackFinder(Lnet/minecraft/resources/IPackFinder;)V", shift = At.Shift.AFTER))
private void afterAddVanillaPackFinder(File serverDirectory, WorldInfo worldInfo, CallbackInfo ci) {
for (DataPackFinderAdder resourcePackFinderAdder : RiftLoader.instance.getListeners(DataPackFinderAdder.class)) {
for (IPackFinder packFinder : resourcePackFinderAdder.getDataPackFinders()) {
Expand Down Expand Up @@ -98,7 +98,7 @@ public void loadAllWorlds(String saveName, String worldName, long seed, WorldTyp
worldInfo.setWorldName(worldName);
}

func_195560_a(saveHandler.getWorldDirectory(), worldInfo);
loadDataPacks(saveHandler.getWorldDirectory(), worldInfo);

// Create overworld
WorldServer overworld = isDemo() ? new WorldServerDemo((MinecraftServer) (Object) this, saveHandler, worldInfo, 0, profiler)
Expand Down Expand Up @@ -164,7 +164,7 @@ protected WorldSettings getWorldSettings(@Nullable WorldInfo worldInfo, long see
return WorldServerDemo.DEMO_WORLD_SETTINGS;
} else {
WorldSettings worldSettings = new WorldSettings(seed, getGameType(), canStructuresSpawn(), isHardcore(), worldType);
worldSettings.func_205390_a(generatorOptions);
worldSettings.setGeneratorOptions(generatorOptions);
if (enableBonusChest) {
worldSettings.enableBonusChest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class MixinTileEntityType {
@Shadow @Final public static RegistryNamespaced<ResourceLocation, TileEntityType<?>> REGISTRY;

@Overwrite
public static <T extends TileEntity> TileEntityType<T> registerTileEntityType(String id, TileEntityType.Builder<T> builder) {
public static <T extends TileEntity> TileEntityType<T> register(String id, TileEntityType.Builder<T> builder) {
Type dataFixerType = null;

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ private void handleModCustomPayload(SPacketCustomPayload packet, CallbackInfo ci
@Inject(method = "handleUpdateTileEntity", at = @At("RETURN"))
private void handleUpdateModTileEntity(SPacketUpdateTileEntity packet, CallbackInfo ci) {
TileEntity tileEntity = world.getTileEntity(packet.getPos());
if (tileEntity == null || packet.getNbtCompound() == null || !packet.getNbtCompound().hasKey("id", 8)) {
if (tileEntity == null || packet.getNbtCompound() == null || !packet.getNbtCompound().contains("id", 8)) {
return;
}

ResourceLocation tileEntityId = TileEntityType.getId(tileEntity.getType());
ResourceLocation packetId = new ResourceLocation(packet.getNbtCompound().getString("id"));
if (packetId != null && !packetId.getNamespace().equals("minecraft") && packetId.equals(tileEntityId)) {
tileEntity.readFromNBT(packet.getNbtCompound());
tileEntity.read(packet.getNbtCompound());
}
}
}