Skip to content

Commit

Permalink
Update for MC/Forge 1.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Aug 16, 2020
1 parent 010abdc commit a528174
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 49 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
org.gradle.jvmargs=-Xmx3G

minecraft_base_version=1.16
minecraft_version=1.16.1
forge_version=1.16.1-32.0.25
forge_mappings=20200514-1.16
mod_version=8.0.0
minecraft_version=1.16.2
forge_version=1.16.2-33.0.5
forge_mappings=20200723-1.16.1
mod_version=8.1.0

jei_version=6.0.0.11
hwyla_version=1.10.5-B66_1.14.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public static EnumBasicDrawer byMetadata (int meta) {

@Override
public String toString () {
return func_176610_l();
return getString();
}

@Override
@Nonnull
public String func_176610_l () {
public String getString () {
return name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public static EnumCompDrawer byOpenSlots (int openSlots) {

@Override
public String toString () {
return func_176610_l();
return getString();
}

@Override
public String func_176610_l () {
public String getString () {
return name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public static EnumKeyType byMetadata (int meta) {

@Override
@Nonnull
public String func_176610_l () {
public String getString () {
return name;
}

@Override
public String toString () {
return func_176610_l();
return getString();
}

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void injectPortableData (TileDataShim shim) {
}

@Override
public final void func_230337_a_ (BlockState state, CompoundNBT tag) {
super.func_230337_a_(state, tag);
public final void read (BlockState state, CompoundNBT tag) {
super.read(state, tag);

failureSnapshot = null;

Expand All @@ -59,7 +59,7 @@ public final void func_230337_a_ (BlockState state, CompoundNBT tag) {
}

public final void read (CompoundNBT tag) {
func_230337_a_(null, tag);
read(null, tag);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void renderFastItemSet (TileEntityDrawers tile, BlockState state, Matrix
if (tile.getDrawerAttributes().isShowingQuantity()) {
PlayerEntity player = Minecraft.getInstance().player;
BlockPos blockPos = tile.getPos().add(.5, .5, .5);
double distance = Math.sqrt(blockPos.distanceSq(player.func_233580_cy_()));
double distance = Math.sqrt(blockPos.distanceSq(player.getPosition()));

float alpha = 1;
if (distance > 4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ public static void registerTileEntities(RegistryEvent.Register<TileEntityType<?>
private static Block registerDrawerBlock(RegistryEvent.Register<Block> event, String name, int drawerCount, boolean halfDepth) {
return registerBlock(event, name, new BlockStandardDrawers(drawerCount, halfDepth, Block.Properties.create(Material.WOOD)
.sound(SoundType.WOOD).hardnessAndResistance(5f)
.func_235842_b_(Registration::predFalse) // isSuffocating
.func_235847_c_(Registration::predFalse))); // causesSuffocation
.setSuffocates(Registration::predFalse)
.setOpaque(Registration::predFalse)));
}

private static Block registerTrimBlock(RegistryEvent.Register<Block> event, String name) {
Expand All @@ -265,8 +265,8 @@ private static Block registerTrimBlock(RegistryEvent.Register<Block> event, Stri
private static Block registerCompactingDrawerBlock(RegistryEvent.Register<Block> event, String name) {
return registerBlock(event, name, new BlockCompDrawers(Block.Properties.create(Material.ROCK)
.sound(SoundType.STONE).hardnessAndResistance(10f)
.func_235842_b_(Registration::predFalse) // isSuffocating
.func_235847_c_(Registration::predFalse))); // causesSuffocation
.setSuffocates(Registration::predFalse)
.setOpaque(Registration::predFalse)));
}

private static Block registerBlock(RegistryEvent.Register<Block> event, String name, Block block) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@ public Compacting(ContainerDrawers container, PlayerInventory playerInv, ITextCo
}
}

@Override // init
protected void func_231160_c_ () {
super.func_231160_c_();
@Override
protected void init () {
super.init();

if (storageItemRender == null) {
ItemRenderer defaultRenderItem = field_230706_i_.getItemRenderer(); // minecraft
storageItemRender = new StorageRenderItem(field_230706_i_.getTextureManager(), defaultRenderItem.getItemModelMesher().getModelManager(), field_230706_i_.getItemColors());
ItemRenderer defaultRenderItem = minecraft.getItemRenderer();
storageItemRender = new StorageRenderItem(minecraft.getTextureManager(), defaultRenderItem.getItemModelMesher().getModelManager(), minecraft.getItemColors());
}
}

@Override // render
public void func_230430_a_ (MatrixStack stack, int p_render_1_, int p_render_2_, float p_render_3_) {
@Override
public void render (MatrixStack stack, int p_render_1_, int p_render_2_, float p_render_3_) {
ItemRenderer ri = setItemRender(storageItemRender);
container.activeRenderItem = storageItemRender;

this.func_230446_a_(stack); // renderBackground
super.func_230430_a_(stack, p_render_1_, p_render_2_, p_render_3_); // render
this.func_230459_a_(stack, p_render_1_, p_render_2_); // renderHoveredTooltip
this.renderBackground(stack);
super.render(stack, p_render_1_, p_render_2_, p_render_3_);
this.func_230459_a_(stack, p_render_1_, p_render_2_);

container.activeRenderItem = null;
storageItemRender.overrideStack = ItemStack.EMPTY;
Expand All @@ -87,25 +87,25 @@ public void func_230430_a_ (MatrixStack stack, int p_render_1_, int p_render_2_,
}

@Override
protected void func_230451_b_ (MatrixStack stack, int mouseX, int mouseY) { // drawContainerForegroundLayer
this.field_230712_o_.func_238422_b_(stack, this.field_230704_d_, 8.0F, 6.0F, 4210752); // drawString
this.field_230712_o_.func_238421_b_(stack, I18n.format("container.storagedrawers.upgrades"), 8, 75, 4210752);
this.field_230712_o_.func_238422_b_(stack, this.playerInventory.getDisplayName(), 8, this.ySize - 96 + 2, 4210752);
protected void drawGuiContainerForegroundLayer (MatrixStack stack, int mouseX, int mouseY) {
this.font.drawString(stack, this.title.getString(), 8.0F, 6.0F, 4210752);
this.font.drawString(stack, I18n.format("container.storagedrawers.upgrades"), 8, 75, 4210752);
this.font.drawString(stack, this.playerInventory.getDisplayName().getString(), 8, this.ySize - 96 + 2, 4210752);
}

@Override
protected void func_230450_a_ (MatrixStack stack, float partialTicks, int mouseX, int mouseY) {
protected void drawGuiContainerBackgroundLayer (MatrixStack stack, float partialTicks, int mouseX, int mouseY) {
GlStateManager.color4f(1, 1, 1, 1);

field_230706_i_.getTextureManager().bindTexture(background);
minecraft.getTextureManager().bindTexture(background);

int guiX = (field_230708_k_ - xSize) / 2;
int guiY = (field_230709_l_ - ySize) / 2;
func_238474_b_(stack, guiX, guiY, 0, 0, xSize, ySize); // blit
int guiX = (width - xSize) / 2;
int guiY = (height - ySize) / 2;
blit(stack, guiX, guiY, 0, 0, xSize, ySize);

List<Slot> storageSlots = container.getStorageSlots();
for (Slot slot : storageSlots) {
func_238474_b_(stack, guiX + slot.xPos, guiY + slot.yPos, smDisabledX, smDisabledY, 16, 16); // blit
blit(stack, guiX + slot.xPos, guiY + slot.yPos, smDisabledX, smDisabledY, 16, 16);
}

/*List<Slot> upgradeSlots = container.getUpgradeSlots();
Expand Down Expand Up @@ -135,8 +135,8 @@ protected boolean isPointInRegion (int x, int y, int width, int height, double o
}

private ItemRenderer setItemRender (ItemRenderer renderItem) {
ItemRenderer prev = field_230707_j_;
field_230707_j_ = renderItem;
ItemRenderer prev = itemRenderer;
itemRenderer = renderItem;

return prev;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public String toString () {
}

@Override
public String func_176610_l () {
public String getString () {
return name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public String toString () {
}

@Override
public String func_176610_l () {
public String getString () {
return name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public String toString () {
}

@Override
public String func_176610_l () {
public String getString () {
return name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public String toString () {
}

@Override
public String func_176610_l () {
public String getString () {
return name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public void addInformation (ItemStack stack, @Nullable World worldIn, List<IText
//}

ITextComponent textCapacity = new TranslationTextComponent("tooltip.storagedrawers.drawers.capacity", getCapacityForBlock(stack));
tooltip.add(new StringTextComponent("").func_230529_a_(textCapacity).func_240699_a_(TextFormatting.GRAY));
tooltip.add(new StringTextComponent("").append(textCapacity).mergeStyle(TextFormatting.GRAY));

if (stack.hasTag() && stack.getTag().contains("tile")) {
ITextComponent textSealed = new TranslationTextComponent("tooltip.storagedrawers.drawers.sealed");
tooltip.add(new StringTextComponent("").func_230529_a_(textSealed).func_240699_a_(TextFormatting.YELLOW));
tooltip.add(new StringTextComponent("").append(textSealed).mergeStyle(TextFormatting.YELLOW));
}

//tooltip.add(getDescription().applyTextStyle(TextFormatting.GRAY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ItemKey(Item.Properties properties) {
super(properties);

ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder();
builder.put(Attributes.field_233823_f_, new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double)2, AttributeModifier.Operation.ADDITION));
builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double)2, AttributeModifier.Operation.ADDITION));
modifiers = builder.build();
}

Expand All @@ -55,7 +55,7 @@ public boolean canPlayerBreakBlockWhileHolding(BlockState state, World worldIn,
@OnlyIn(Dist.CLIENT)
public void addInformation (ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
super.addInformation(stack, worldIn, tooltip, flagIn);
tooltip.add(new StringTextComponent("").func_230529_a_(getDescription()).func_240699_a_(TextFormatting.GRAY));
tooltip.add(new StringTextComponent("").append(getDescription()).mergeStyle(TextFormatting.GRAY));
}

@OnlyIn(Dist.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public int getUpgradeGroup() {
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation (@Nonnull ItemStack itemStack, @Nullable World world, List<ITextComponent> list, ITooltipFlag advanced) {
list.add(new StringTextComponent("").func_230529_a_(getDescription()).func_240699_a_(TextFormatting.GRAY));
list.add(new StringTextComponent("").append(getDescription()).mergeStyle(TextFormatting.GRAY));
}

@OnlyIn(Dist.CLIENT)
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ loaderVersion="[32,)"
issueTrackerURL="https://github.com/jaquadro/StorageDrawers/issues"
displayURL="https://minecraft.curseforge.com/projects/storagedrawers"
authors="Texelsaur"
license="MIT"

[[mods]]
modId="storagedrawers"
Expand Down

0 comments on commit a528174

Please sign in to comment.