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

Commit

Permalink
Update to snapshot_20180817 mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
Runemoro committed Aug 17, 2018
1 parent 3e6babf commit 1dd6c5a
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 44 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def travisBuildNumber = System.getenv('TRAVIS_BUILD_NUMBER')
def versionSuffix = travisBuildNumber != null ? travisBuildNumber : 'SNAPSHOT'

group 'org.dimdev'
version '1.0.3-' + versionSuffix
version '1.0.4-' + versionSuffix
archivesBaseName = 'Rift'

sourceCompatibility = 1.8
Expand All @@ -44,7 +44,7 @@ dependencies {

minecraft {
version = '1.13'
mappings = 'snapshot_5'
mappings = 'snapshot_20180817'
runDir = 'run'
tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
makeObfSourceJar = false
Expand Down
4 changes: 2 additions & 2 deletions src/debug/java/org/dimdev/testmod/ItemPacketTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public ItemPacketTester(Builder builder) {
}

@Override
public EnumActionResult func_195939_a(ItemUseContext context) {
if (context.func_195991_k().isRemote) {
public EnumActionResult onItemUse(ItemUseContext context) {
if (context.getWorld().isRemote) {
return EnumActionResult.SUCCESS;
}

Expand Down
10 changes: 5 additions & 5 deletions src/debug/java/org/dimdev/testmod/TestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public class TestMod implements BlockAdder, ItemAdder, FluidAdder, TextureAdder,

@Override
public void registerBlocks() {
Block.registerBlock(new ResourceLocation("testmod", "white_block"), WHITE_BLOCK);
Block.registerBlock(new ResourceLocation("testmod", "translucent_white_block"), TRANSLUCENT_WHITE_BLOCK);
Block.registerBlock(new ResourceLocation("testmod", "white_fluid"), BLOCK_WHITE_FLUID);
Block.register(new ResourceLocation("testmod", "white_block"), WHITE_BLOCK);
Block.register(new ResourceLocation("testmod", "translucent_white_block"), TRANSLUCENT_WHITE_BLOCK);
Block.register(new ResourceLocation("testmod", "white_fluid"), BLOCK_WHITE_FLUID);
}

@Override
Expand All @@ -59,8 +59,8 @@ public void registerItems() {

@Override
public void registerFluids() {
Fluid.registerFluid(new ResourceLocation("testmod", "white_fluid"), WHITE_FLUID);
Fluid.registerFluid(new ResourceLocation("testmod", "flowing_white_fluid"), FLOWING_WHITE_FLUID);
Fluid.register(new ResourceLocation("testmod", "white_fluid"), WHITE_FLUID);
Fluid.register(new ResourceLocation("testmod", "flowing_white_fluid"), FLOWING_WHITE_FLUID);
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions src/debug/java/org/dimdev/testmod/WhiteFluid.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected boolean canSourcesMultiply() {

@Override
protected void beforeReplacingBlock(IWorld world, BlockPos pos, IBlockState state) {
state.spawnItems(world.getWorld(), pos, 0);
state.dropBlockAsItem(world.getWorld(), pos, 0);
}

@Override
Expand Down Expand Up @@ -109,7 +109,7 @@ public TextureAtlasSprite getStillTexture() {

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

@Override
Expand All @@ -124,12 +124,12 @@ public Flowing() {}
@Override
protected void buildStateContainer(StateContainer.Builder<Fluid, IFluidState> builder) {
super.buildStateContainer(builder);
builder.addProperties(LEVEL);
builder.add(LEVEL_1_TO_8);
}

@Override
public int getLevel(IFluidState getLevel) {
return getLevel.getValue(LEVEL);
return getLevel.getValue(LEVEL_1_TO_8);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
boolean isLava = state.isTagged(FluidTags.LAVA);

// Get textures and color multiplier
TextureAtlasSprite stillTexture = MissingTextureSprite.func_195677_a();
TextureAtlasSprite flowingTexture = MissingTextureSprite.func_195677_a();
TextureAtlasSprite stillTexture = MissingTextureSprite.getSprite();
TextureAtlasSprite flowingTexture = MissingTextureSprite.getSprite();
int colorMultiplier = 0xFFFFFF;
if (state.getFluid() instanceof RiftFluid) {
RiftFluid fluid = (RiftFluid) state.getFluid();
Expand Down Expand Up @@ -83,7 +83,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
var18 -= 0.001F;
var19 -= 0.001F;
var20 -= 0.001F;
Vec3d var25 = state.func_206887_a(world, pos);
Vec3d var25 = state.getFlow(world, pos);
float var28;
float var30;
float var32;
Expand Down Expand Up @@ -122,7 +122,7 @@ public boolean render(IWorldReader world, BlockPos pos, BufferBuilder buffer, IF
buffer.pos(x, y + var18, z + 1).color(redMultiplier, greenMultiplier, blueMultiplier, 1).tex(maxU, var30).lightmap(skyLight, blockLight).endVertex();
buffer.pos(x + 1, y + var19, z + 1).color(redMultiplier, greenMultiplier, blueMultiplier, 1).tex(minV, var32).lightmap(skyLight, blockLight).endVertex();
buffer.pos(x + 1, y + var20, z).color(redMultiplier, greenMultiplier, blueMultiplier, 1).tex(maxV, var34).lightmap(skyLight, blockLight).endVertex();
if (state.func_205586_a(world, pos.up())) {
if (state.shouldRenderSides(world, pos.up())) {
buffer.pos(x, y + var17, z).color(redMultiplier, greenMultiplier, blueMultiplier, 1).tex(minU, var28).lightmap(skyLight, blockLight).endVertex();
buffer.pos(x + 1, y + var20, z).color(redMultiplier, greenMultiplier, blueMultiplier, 1).tex(maxV, var34).lightmap(skyLight, blockLight).endVertex();
buffer.pos(x + 1, y + var19, z + 1).color(redMultiplier, greenMultiplier, blueMultiplier, 1).tex(minV, var32).lightmap(skyLight, blockLight).endVertex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public TextureAtlasSprite getStillTexture() {

@Override
public TextureAtlasSprite getFlowingTexture() {
return Minecraft.getMinecraft().getTextureMapBlocks().func_195424_a(ModelBakery.field_207766_d);
return Minecraft.getMinecraft().getTextureMapBlocks().getSprite(ModelBakery.LOCATION_LAVA_FLOW);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public TextureAtlasSprite getStillTexture() {

@Override
public TextureAtlasSprite getFlowingTexture() {
return Minecraft.getMinecraft().getTextureMapBlocks().func_195424_a(ModelBakery.field_207768_f);
return Minecraft.getMinecraft().getTextureMapBlocks().getSprite(ModelBakery.LOCATION_WATER_FLOW);
}

@Override
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/org/dimdev/rift/mixin/hook/MixinEntityType.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,39 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.function.Function;

@Mixin(EntityType.class)
public abstract class MixinEntityType {
@Inject(method = "<clinit>", at = @At("RETURN"))
private static void onRegisterEntityTypes(CallbackInfo ci) {
static {
for (EntityTypeAdder entityTypeAdder : RiftLoader.instance.getListeners(EntityTypeAdder.class)) {
entityTypeAdder.registerEntityTypes();
}
}

@Mixin(EntityType.Builder.class)
public abstract static class Builder<T extends Entity> {
@Shadow private boolean field_200710_b;
@Shadow private boolean serializable;

@Shadow @Final private Class<? extends T> entityClass;
@Shadow @Final private Function<? super World, ? extends T> factory;
@Shadow private boolean field_200711_c;
private static final Logger LOGGER = LogManager.getLogger();;
@Shadow private boolean summonable;
private static final Logger LOGGER = LogManager.getLogger();

@Overwrite
public EntityType<T> build(String id) {
Type<?> dataFixerType = null;

if (field_200710_b) {
if (serializable) {
try {
dataFixerType = DataFixesManager.getDataFixer().getSchema(DataFixUtils.makeKey(1519)).getChoiceType(TypeReferences.ENTITY_TREE, id);
dataFixerType = DataFixesManager.getDataFixer().getSchema(DataFixUtils.makeKey(1519)).getChoiceType(TypeReferences.ENTITY_TYPE, id);
} catch (IllegalStateException | IllegalArgumentException ignored) {
LOGGER.debug("No data fixer registered for entity {}", id);
}
}

return new EntityType<T>(entityClass, factory, field_200710_b, field_200711_c, dataFixerType);
return new EntityType<>(entityClass, factory, serializable, summonable, dataFixerType);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/dimdev/rift/mixin/hook/MixinFluid.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@Mixin(Fluid.class)
public abstract class MixinFluid {
@Inject(method = "registerFluids", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/registry/RegistryNamespacedDefaultedByKey;validateKey()V"))
@Inject(method = "registerAll", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/registry/RegistryNamespacedDefaultedByKey;validateKey()V"))
private static void onRegisterFluids(CallbackInfo ci) {
for (FluidAdder fluidAdder : RiftLoader.instance.getListeners(FluidAdder.class)) {
fluidAdder.registerFluids();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ public void loadAllWorlds(String saveName, String worldName, long seed, WorldTyp
timeOfLastDimensionTick = new long[worlds.length][100];

getPlayerList().setPlayerManager(worlds);
if (worldInfo.func_201357_P() != null) {
getCustomBossEvents().func_201381_a(worldInfo.func_201357_P());
if (worldInfo.getCustomBossEvents() != null) {
getCustomBossEvents().read(worldInfo.getCustomBossEvents());
}

if (overworld.getWorldInfo().getDifficulty() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@Mixin(ParticleType.class)
public abstract class MixinParticleType {
@Inject(method = "registerParticleTypes", at = @At("RETURN"))
@Inject(method = "registerAll", at = @At("RETURN"))
private static void onRegisterParticleTypes(CallbackInfo ci) {
for (ParticleTypeAdder particleTypeAdder : RiftLoader.instance.getListeners(ParticleTypeAdder.class)) {
particleTypeAdder.registerParticles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Set;

@Mixin(ModelBakery.class)
public class MixinModelBakery {
@Shadow @Final private static Set<ResourceLocation> LOCATIONS_BUILTIN_TEXTURES;
@Inject(method = "<clinit>", at = @At("RETURN"))
private static void addBuiltinTextures(CallbackInfo ci) {

static {
for (TextureAdder textureAdder : RiftLoader.instance.getListeners(TextureAdder.class)) {
LOCATIONS_BUILTIN_TEXTURES.addAll(textureAdder.getBuiltinTextures());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void handleUpdateModTileEntity(SPacketUpdateTileEntity packet, CallbackI
return;
}

ResourceLocation tileEntityId = TileEntityType.getId(tileEntity.getTileEntityType());
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());
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/dimdev/rift/resources/ModPack.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected boolean func_195768_c(String path) {
@Override
public Collection<ResourceLocation> getAllResourceLocations(ResourcePackType type, String path, int maxDepth, Predicate<String> filter) {
Set<ResourceLocation> resourceLocations = new HashSet<>();
for (String namespace : getResourceDomains(type)) {
for (String namespace : getResourceNamespaces(type)) {
resourceLocations.addAll(getAllResourceLocations(type, new ResourceLocation(namespace, path), maxDepth, filter));
}
return resourceLocations;
Expand Down Expand Up @@ -90,7 +90,7 @@ private static Collection<ResourceLocation> getAllResourceLocations(int maxDepth
}

@Override
public Set<String> getResourceDomains(ResourcePackType type) {
public Set<String> getResourceNamespaces(ResourcePackType type) {
try {
URI uri = new URL(root + type.func_198956_a() + "/").toURI();
if ("file".equals(uri.getScheme())) {
Expand All @@ -117,7 +117,7 @@ public Set<String> getResourceDomains(ResourcePackType type) {
}
} catch (NoSuchFileException | FileNotFoundException | NotDirectoryException ignored) {
} catch (IOException | URISyntaxException e) {
LOGGER.error("Couldn't get a list of resource domains of '" + getName() + "'", e);
LOGGER.error("Couldn't get a list of resource namespaces of '" + getName() + "'", e);
}

return Collections.emptySet();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/dimdev/rift/resources/ModPackFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public <T extends ResourcePackInfo> void addPackInfosToMap(Map<String, T> nameTo

try (ModPack pack = new ModPack(mod.name != null ? mod.name : mod.id, root)) {
PackMetadataSection meta = pack.func_195760_a(PackMetadataSection.field_198964_a);
if (meta != null && !pack.getResourceDomains(type).isEmpty()) {
if (meta != null && !pack.getResourceNamespaces(type).isEmpty()) {
nameToPackMap.put(mod.id, packInfoFactory.create(mod.id, type == ResourcePackType.CLIENT_RESOURCES, () -> pack, pack, meta, ResourcePackInfo.Priority.TOP));
}
} catch (IOException ignored) {}
Expand Down

0 comments on commit 1dd6c5a

Please sign in to comment.