Skip to content

Commit

Permalink
Update to 1.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fuj1n committed Aug 7, 2020
1 parent 8a5ac2f commit 343006f
Show file tree
Hide file tree
Showing 34 changed files with 312 additions and 321 deletions.
9 changes: 6 additions & 3 deletions build.gradle
Expand Up @@ -31,7 +31,7 @@ repositories {
}
maven {
name "Tehnut Maven FS"
url "http://tehnut.info/maven"
url "http://maven.tehnut.info"
}
}

Expand Down Expand Up @@ -82,8 +82,11 @@ dependencies {
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
// at runtime, use the full JEI jar
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}")

compile fg.deobf("mcp.mobius.waila:Hwyla:${hwyla_version}")

// Compile against the Hwyla API, but do not include it at runtime
compileOnly fg.deobf("mcp.mobius.waila:Hwyla:${hwyla_version}_${minecraft_version}:api")
// At runtime, use the full Hwyla jar
runtimeOnly fg.deobf("mcp.mobius.waila:Hwyla:${hwyla_version}_${minecraft_version}")
}

sourceSets {
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Expand Up @@ -5,17 +5,17 @@ org.gradle.daemon=false

mod_version=2.2.0

minecraft_version=1.15.2
minecraft_version_short=1.15
minecraft_version=1.16.1
minecraft_version_short=1.16

forge_version=31.1.0
forge_version_toml=31
forge_version=32.0.106
forge_version_toml=32

mappings_channel=snapshot
mappings_version=20200423-1.15.1
mappings_version=20200723-1.16.1

mantle_version=1.5.15
mantle_version=1.6.21
tinkers_version=0
jei_version=6.0.0.3
jei_version=7.0.0.6

hwyla_version=1.10.8-B72_1.15.2
hwyla_version=1.10.10-B77
2 changes: 1 addition & 1 deletion src/main/java/slimeknights/tmechworks/TMechworks.java
Expand Up @@ -48,6 +48,7 @@ public TMechworks() {
MinecraftForge.EVENT_BUS.addListener(MechworksFakePlayer::onWorldUnload);

content = new MechworksContent();
content.initRegisters();
bus.register(content);
}

Expand All @@ -58,7 +59,6 @@ private void preInit(final FMLCommonSetupEvent event) {
proxy.preInit();

content.preInit(event);
DistExecutor.runWhenOn(Dist.CLIENT, () -> content::registerScreenFactories);

PacketHandler.register();
}
Expand Down
@@ -1,22 +1,22 @@
package slimeknights.tmechworks.api.disguisestate;

import net.minecraft.block.BlockState;
import net.minecraft.state.IProperty;
import net.minecraft.state.Property;

import java.util.Collection;

public abstract class BasicDisguiseState<T extends Comparable<T>> extends DisguiseState<T> {
private final IProperty<T> property;
private final Property<T> property;
private final T defaultValue;

public BasicDisguiseState(IProperty<T> property, T defaultValue) {
public BasicDisguiseState(Property<T> property, T defaultValue) {
this.property = property;
this.defaultValue = defaultValue;
}

@Override
public boolean canApplyTo(BlockState state) {
return state.has(property);
return state.hasProperty(property);
}

@Override
Expand Down
Expand Up @@ -23,6 +23,7 @@ public ResourceLocation getIconSheet() {

@OnlyIn(Dist.CLIENT)
public final int unsafeGetIconFor(Object value) {
//noinspection unchecked
return getIconFor((T) value);
}

Expand Down
Expand Up @@ -7,7 +7,7 @@
public class AxisFacingProvider extends FacingProvider {
@Override
public boolean canApplyTo(BlockState state, Direction facing) {
return state.has(BlockStateProperties.AXIS);
return state.hasProperty(BlockStateProperties.AXIS);
}

@Override
Expand Down
Expand Up @@ -7,7 +7,7 @@
public class FacingExceptUpFacingProvider extends FacingProvider {
@Override
public boolean canApplyTo(BlockState state, Direction facing) {
return state.has(BlockStateProperties.FACING_EXCEPT_UP) && facing != Direction.UP;
return state.hasProperty(BlockStateProperties.FACING_EXCEPT_UP) && facing != Direction.UP;
}

@Override
Expand Down
Expand Up @@ -6,7 +6,7 @@

public class FacingProvider {
public boolean canApplyTo(BlockState state, Direction facing) {
return state.has(BlockStateProperties.FACING);
return state.hasProperty(BlockStateProperties.FACING);
}

public BlockState applyTo(BlockState state, Direction facing) {
Expand Down
Expand Up @@ -7,7 +7,7 @@
public class HorizontalAxisFacingProvider extends FacingProvider {
@Override
public boolean canApplyTo(BlockState state, Direction facing) {
return state.has(BlockStateProperties.HORIZONTAL_AXIS) && facing != Direction.UP && facing != Direction.DOWN;
return state.hasProperty(BlockStateProperties.HORIZONTAL_AXIS) && facing != Direction.UP && facing != Direction.DOWN;
}

@Override
Expand Down
Expand Up @@ -7,7 +7,7 @@
public class HorizontalFacingProvider extends FacingProvider {
@Override
public boolean canApplyTo(BlockState state, Direction facing) {
return state.has(BlockStateProperties.HORIZONTAL_FACING) && facing != Direction.UP && facing != Direction.DOWN;
return state.hasProperty(BlockStateProperties.HORIZONTAL_FACING) && facing != Direction.UP && facing != Direction.DOWN;
}

@Override
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/slimeknights/tmechworks/client/ClientProxy.java
Expand Up @@ -4,9 +4,12 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import slimeknights.mantle.client.book.BookLoader;
import slimeknights.mantle.client.book.data.BookData;
import slimeknights.mantle.client.book.repository.FileRepository;
import slimeknights.tmechworks.TMechworks;
import slimeknights.tmechworks.common.CommonProxy;
import slimeknights.tmechworks.common.MechworksContent;
import slimeknights.tmechworks.common.event.ModelBakeEventListener;
Expand All @@ -23,12 +26,14 @@ public void preInit() {
public void init() {
super.init();

registerDisguiseBlock(MechworksContent.Blocks.drawbridge);
registerDisguiseBlock(MechworksContent.Blocks.firestarter);
registerDisguiseBlock(MechworksContent.Blocks.drawbridge.get());
registerDisguiseBlock(MechworksContent.Blocks.firestarter.get());
}

@Override
public void setupClient() {
DistExecutor.runWhenOn(Dist.CLIENT, () -> TMechworks.content::registerScreenFactories);

// TODO mod config gui
}

Expand Down
@@ -1,5 +1,6 @@
package slimeknights.tmechworks.client.gui;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.block.BlockState;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
Expand Down Expand Up @@ -31,15 +32,15 @@ public static DisguiseScreen create(DisguiseContainer container, PlayerInventory
protected void init() {
super.init();

disguiseWidget = new DisguiseStateWidget(guiLeft + 99, guiTop + 30, container.getTileEntity());
disguiseWidget = new DisguiseStateWidget(guiLeft + 99, guiTop + 30, container.getTile());
addButton(disguiseWidget);
}

@Override
public void tick() {
super.tick();

RedstoneMachineTileEntity te = container.getTileEntity();
RedstoneMachineTileEntity te = container.getTile();
ItemStack disguise = te.getDisguiseBlock();

if (disguise.getItem() instanceof BlockItem) {
Expand All @@ -51,27 +52,27 @@ public void tick() {
}

@Override
public void render(int mouseX, int mouseY, float partialTicks) {
this.renderBackground();
super.render(mouseX, mouseY, partialTicks);
this.renderHoveredToolTip(mouseX, mouseY);
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(matrixStack);
super.render(matrixStack, mouseX, mouseY, partialTicks);
this.func_230459_a_(matrixStack, mouseX, mouseY); // func_230459_a_ -> renderHoveredToolTip
}

@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.minecraft.getTextureManager().bindTexture(SCREEN_LOCATION);

blit(guiLeft, guiTop, 0, 0, xSize, ySize); // Background
blit(matrixStack, guiLeft, guiTop, 0, 0, xSize, ySize); // Background
}

@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);

String s = title.getFormattedText();
font.drawString(s, xSize / 2F - font.getStringWidth(s) / 2F, 6, 4210752);

font.drawString(playerInventory.getDisplayName().getFormattedText(), 8, ySize - 96 + 2, 4210752);
}
// @Override
// protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
// super.drawGuiContainerForegroundLayer(mouseX, mouseY);
//
// String s = title.getFormattedText();
// font.drawString(s, xSize / 2F - font.getStringWidth(s) / 2F, 6, 4210752);
//
// font.drawString(playerInventory.getDisplayName().getFormattedText(), 8, ySize - 96 + 2, 4210752);
// }
}

0 comments on commit 343006f

Please sign in to comment.