1.15-pre2 loads of new mappings

This commit is contained in:
modmuss50 2019-11-26 19:03:36 +00:00
parent 937b184ace
commit bfdde04892
21 changed files with 45 additions and 42 deletions

View file

@ -73,12 +73,12 @@ license {
group = 'TechReborn'
dependencies {
minecraft "com.mojang:minecraft:1.15-pre1"
mappings "net.fabricmc:yarn:1.15-pre1+build.3:v2"
minecraft "com.mojang:minecraft:1.15-pre2"
mappings "net.fabricmc:yarn:1.15-pre2+build.3:v2"
modCompile "net.fabricmc:fabric-loader:0.7.1+build.173"
//Fabric api
modCompile "net.fabricmc.fabric-api:fabric-api:0.4.13+build.264-1.15"
modCompile "net.fabricmc.fabric-api:fabric-api:0.4.16+build.268-1.15"
modCompileOnly "io.github.prospector:modmenu:1.7.9-unstable.19w34a+build.1"
modCompileOnly ("me.shedaniel:RoughlyEnoughItems:3.2.7-unstable.201911150440")

View file

@ -28,7 +28,6 @@ import com.mojang.datafixers.util.Pair;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
import net.minecraft.class_4730;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.RenderLayers;
import net.minecraft.client.render.model.BakedModel;
@ -37,6 +36,7 @@ import net.minecraft.client.render.model.ModelLoader;
import net.minecraft.client.render.model.UnbakedModel;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.Fluids;
import net.minecraft.item.ItemStack;
@ -86,13 +86,13 @@ public class TechRebornClient implements ClientModInitializer {
}
@Override
public Collection<class_4730> getTextureDependencies(Function<Identifier, UnbakedModel> unbakedModelGetter, Set<Pair<String, String>> unresolvedTextureReferences) {
public Collection<SpriteIdentifier> getTextureDependencies(Function<Identifier, UnbakedModel> unbakedModelGetter, Set<Pair<String, String>> unresolvedTextureReferences) {
return Collections.emptyList();
}
@Nullable
@Override
public BakedModel bake(ModelLoader loader, Function<class_4730, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier modelId) {
public BakedModel bake(ModelLoader loader, Function<SpriteIdentifier, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier modelId) {
return new DynamicCellBakedModel();
}
@ -107,13 +107,13 @@ public class TechRebornClient implements ClientModInitializer {
}
@Override
public Collection<class_4730> getTextureDependencies(Function<Identifier, UnbakedModel> unbakedModelGetter, Set<Pair<String, String>> unresolvedTextureReferences) {
public Collection<SpriteIdentifier> getTextureDependencies(Function<Identifier, UnbakedModel> unbakedModelGetter, Set<Pair<String, String>> unresolvedTextureReferences) {
return Collections.emptyList();
}
@Nullable
@Override
public BakedModel bake(ModelLoader loader, Function<class_4730, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier modelId) {
public BakedModel bake(ModelLoader loader, Function<SpriteIdentifier, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier modelId) {
return new DynamicBucketBakedModel();
}

View file

@ -65,7 +65,7 @@ public class FluidReplicatorRecipe extends RebornFluidRecipe {
if (!blockEntity.getMultiBlock()) {
return false;
}
final BlockPos hole = blockEntity.getPos().method_10079(blockEntity.getFacing().getOpposite(), 2);
final BlockPos hole = blockEntity.getPos().offset(blockEntity.getFacing().getOpposite(), 2);
final Fluid fluid = techreborn.utils.FluidUtils.fluidFromBlock(blockEntity.getWorld().getBlockState(hole).getBlock());
if (fluid == Fluids.EMPTY) {
return true;

View file

@ -61,7 +61,7 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
}
public boolean isSunOut() {
return canSeeSky && !world.isRaining() && !world.isThundering() && world.isDaylight();
return canSeeSky && !world.isRaining() && !world.isThundering() && world.isDay();
}
private void updatePanel() {

View file

@ -70,7 +70,7 @@ public class DistillationTowerBlockEntity extends GenericMachineBlockEntity impl
@Override
public void tick() {
if (multiblockChecker == null) {
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2);
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2);
multiblockChecker = new MultiblockChecker(world, downCenter);
}

View file

@ -74,7 +74,7 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
@Override
public void tick() {
if (multiblockChecker == null) {
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2);
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2);
multiblockChecker = new MultiblockChecker(world, downCenter);
}

View file

@ -63,7 +63,7 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity
}
// Bottom center of multiblock
final BlockPos location = pos.method_10079(getFacing().getOpposite(), 2);
final BlockPos location = pos.offset(getFacing().getOpposite(), 2);
final BlockEntity blockEntity = world.getBlockEntity(location);
if (blockEntity instanceof MachineCasingBlockEntity) {
@ -83,8 +83,8 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity
heat += BlockMachineCasing.getHeatFromState(part.getCachedState());
}
if (world.getBlockState(location.method_10079(Direction.UP, 1)).getMaterial().equals(Material.LAVA)
&& world.getBlockState(location.method_10079(Direction.UP, 2)).getMaterial().equals(Material.LAVA)) {
if (world.getBlockState(location.offset(Direction.UP, 1)).getMaterial().equals(Material.LAVA)
&& world.getBlockState(location.offset(Direction.UP, 2)).getMaterial().equals(Material.LAVA)) {
heat += 500;
}
return heat;
@ -121,7 +121,7 @@ public class IndustrialBlastFurnaceBlockEntity extends GenericMachineBlockEntity
@Override
public void tick() {
if (multiblockChecker == null) {
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2);
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2);
multiblockChecker = new MultiblockChecker(world, downCenter);
}
super.tick();

View file

@ -81,7 +81,7 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl
@Override
public void tick() {
if (multiblockChecker == null) {
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2).method_10079(Direction.DOWN, 1);
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2).offset(Direction.DOWN, 1);
multiblockChecker = new MultiblockChecker(world, downCenter);
}

View file

@ -81,7 +81,7 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
@Override
public void tick() {
if (multiblockChecker == null) {
final BlockPos downCenter = pos.method_10079(getFacing().getOpposite(), 2).method_10079(Direction.DOWN, 1);
final BlockPos downCenter = pos.offset(getFacing().getOpposite(), 2).offset(Direction.DOWN, 1);
multiblockChecker = new MultiblockChecker(world, downCenter);
}

View file

@ -72,7 +72,7 @@ public class VacuumFreezerBlockEntity extends GenericMachineBlockEntity implemen
@Override
public void cancelRemoval() {
super.cancelRemoval();
multiblockChecker = new MultiblockChecker(world, pos.method_10079(Direction.DOWN, 1));
multiblockChecker = new MultiblockChecker(world, pos.offset(Direction.DOWN, 1));
}
// IContainerProvider

View file

@ -129,7 +129,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
requiredSize = 0;
}
if (stacksInSlots[i] > requiredSize) {
if (ingredient.method_8093(stack)) {
if (ingredient.test(stack)) {
if (stack.getItem().getRecipeRemainder() != null) {
if (!hasRoomForExtraItem(new ItemStack(stack.getItem().getRecipeRemainder()))) {
continue;
@ -186,13 +186,13 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
Ingredient ingredient = ingredients.get(i);
// Looks for the best slot to take it from
ItemStack bestSlot = inventory.getInvStack(i);
if (ingredient.method_8093(bestSlot)) {
if (ingredient.test(bestSlot)) {
handleContainerItem(bestSlot);
bestSlot.decrement(1);
} else {
for (int j = 0; j < 9; j++) {
ItemStack stack = inventory.getInvStack(j);
if (ingredient.method_8093(stack)) {
if (ingredient.test(stack)) {
handleContainerItem(stack);
stack.decrement(1);
break;
@ -228,7 +228,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
public boolean hasIngredient(Ingredient ingredient) {
for (int i = 0; i < 9; i++) {
ItemStack stack = inventory.getInvStack(i);
if (ingredient.method_8093(stack)) {
if (ingredient.test(stack)) {
return true;
}
}
@ -255,7 +255,7 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
for (int i = 0; i < recipe.getPreviewInputs().size(); i++) {
ItemStack stackInSlot = inventory.getInvStack(i);
Ingredient ingredient = ingredients.get(i);
if (ingredient != Ingredient.EMPTY && ingredient.method_8093(stack)) {
if (ingredient != Ingredient.EMPTY && ingredient.test(stack)) {
if (stackInSlot.isEmpty()) {
possibleSlots.add(i);
} else if (stackInSlot.getItem() == stack.getItem()) {

View file

@ -214,7 +214,7 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
for (int s = 0; s < currentRecipe.getPreviewInputs().size(); s++) {
ItemStack stackInSlot = inventory.getInvStack(s);
Ingredient ingredient = (Ingredient) currentRecipe.getPreviewInputs().get(s);
if (ingredient != Ingredient.EMPTY && ingredient.method_8093(sourceStack)) {
if (ingredient != Ingredient.EMPTY && ingredient.test(sourceStack)) {
if (stackInSlot.isEmpty()) {
possibleSlots.add(s);
} else if (stackInSlot.getItem() == sourceStack.getItem()) {

View file

@ -115,7 +115,7 @@ public class CableBlock extends BlockWithEntity {
}
private BlockState makeConnections(World world, BlockPos pos) {
Boolean down = canConnectTo(world, pos.method_10079(Direction.DOWN, 1), Direction.UP);
Boolean down = canConnectTo(world, pos.offset(Direction.DOWN, 1), Direction.UP);
Boolean up = canConnectTo(world, pos.up(), Direction.DOWN);
Boolean north = canConnectTo(world, pos.north(), Direction.SOUTH);
Boolean east = canConnectTo(world, pos.east(), Direction.WEST);

View file

@ -107,7 +107,7 @@ public class BlockRubberLog extends LogBlock {
}
if (random.nextInt(50) == 0) {
Direction facing = Direction.fromHorizontal(random.nextInt(4));
if (worldIn.getBlockState(pos.method_10079(Direction.DOWN, 1)).getBlock() == this
if (worldIn.getBlockState(pos.offset(Direction.DOWN, 1)).getBlock() == this
&& worldIn.getBlockState(pos.up()).getBlock() == this) {
worldIn.setBlockState(pos, state.with(HAS_SAP, true).with(SAP_SIDE, facing));
}

View file

@ -143,7 +143,7 @@ public class GuiIndustrialSawmill extends GuiBase<BuiltContainer> {
this.blockEntity.getPos().getX()
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2,
this.blockEntity.getPos().getY() - 1, this.blockEntity.getPos().getZ()
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2).method_10079(blockEntity.getFacing().getOpposite(), 2);
- Direction.byId(this.blockEntity.getFacingInt()).getOffsetY() * 2).offset(blockEntity.getFacing().getOpposite(), 2);
}
} else {
RebornCoreClient.multiblockRenderEvent.setMultiblock(null);

View file

@ -130,7 +130,7 @@ public class GuiVacuumFreezer extends GuiBase<BuiltContainer> {
final MultiblockSet set = new MultiblockSet(multiblock);
RebornCoreClient.multiblockRenderEvent.setMultiblock(set);
RebornCoreClient.multiblockRenderEvent.parent = blockEntity.getPos();
MultiblockRenderEvent.anchor = blockEntity.getPos().method_10079(Direction.DOWN, 1);
MultiblockRenderEvent.anchor = blockEntity.getPos().offset(Direction.DOWN, 1);
}
} else {
RebornCoreClient.multiblockRenderEvent.setMultiblock(null);

View file

@ -24,7 +24,6 @@
package techreborn.client.render;
import net.minecraft.class_4730;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.texture.SpriteAtlasTexture;
@ -40,7 +39,9 @@ public class DynamicBucketBakedModel extends BaseDynamicFluidBakedModel {
@Override
public Sprite getSprite() {
return new class_4730(SpriteAtlasTexture.BLOCK_ATLAS_TEX, new Identifier("minecraft:item/bucket")).method_24148();
return MinecraftClient.getInstance()
.getSpriteAtlas(SpriteAtlasTexture.BLOCK_ATLAS_TEX)
.apply(new Identifier("minecraft:item/bucket"));
}
@Override

View file

@ -25,12 +25,12 @@
package techreborn.client.render;
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
import net.minecraft.class_4730;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.model.BakedModelManager;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import techreborn.TechReborn;
@ -55,7 +55,9 @@ public class DynamicCellBakedModel extends BaseDynamicFluidBakedModel {
@Override
public Sprite getSprite() {
return new class_4730(SpriteAtlasTexture.BLOCK_ATLAS_TEX, new Identifier("techreborn:item/cell_base")).method_24148();
return MinecraftClient.getInstance()
.getSpriteAtlas(SpriteAtlasTexture.BLOCK_ATLAS_TEX)
.apply(new Identifier("techreborn:item/cell_base"));
}
@Override

View file

@ -56,7 +56,7 @@ public class TRRecipeHandler {
if (!recipe.getId().getNamespace().equals(TechReborn.MOD_ID)) {
return false;
}
return !recipe.getPreviewInputs().stream().anyMatch((Predicate<Ingredient>) ingredient -> ingredient.method_8093(TRContent.Parts.UU_MATTER.getStack()));
return !recipe.getPreviewInputs().stream().anyMatch((Predicate<Ingredient>) ingredient -> ingredient.test(TRContent.Parts.UU_MATTER.getStack()));
}
}

View file

@ -50,8 +50,8 @@ public class RubberTreeFeature extends OakTreeFeature {
}
@Override
public boolean method_23402(ModifiableTestableWorld world, Random random, BlockPos blockPos, Set<BlockPos> set, Set<BlockPos> set2, BlockBox blockBox, BranchedTreeFeatureConfig branchedTreeFeatureConfig) {
if(super.method_23402(world, random, blockPos, set, set2, blockBox, branchedTreeFeatureConfig)) {
public boolean generate(ModifiableTestableWorld world, Random random, BlockPos blockPos, Set<BlockPos> set, Set<BlockPos> set2, BlockBox blockBox, BranchedTreeFeatureConfig branchedTreeFeatureConfig) {
if(super.generate(world, random, blockPos, set, set2, blockBox, branchedTreeFeatureConfig)) {
spawnSpike(world, blockPos);
return true;
}

View file

@ -75,7 +75,7 @@ public class WorldGenerator {
}
private static void setupTrees() {
RUBBER_TREE = Registry.register(Registry.FEATURE, new Identifier("techreborn:rubber_tree"), new RubberTreeFeature(BranchedTreeFeatureConfig::method_23426));
RUBBER_TREE = Registry.register(Registry.FEATURE, new Identifier("techreborn:rubber_tree"), new RubberTreeFeature(BranchedTreeFeatureConfig::deserialize2));
WeightedStateProvider logProvider = new WeightedStateProvider();
logProvider.addState(TRContent.RUBBER_LOG.getDefaultState(), 10);
@ -92,11 +92,11 @@ public class WorldGenerator {
logProvider,
new SimpleStateProvider(TRContent.RUBBER_LEAVES.getDefaultState()),
new BlobFoliagePlacer(2, 0))
.method_23428(6) //Base height
.method_23430(2)
.method_23437(3)
.method_23427()
.method_23431();
.baseHeight(6)
.heightRandA(2)
.foliageHeight(3)
.noVines()
.build();
}