Skip to content

Commit

Permalink
Merge branch '1.16.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed Sep 12, 2020
2 parents dd334e3 + c1a5839 commit d343777
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 71 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ repositories {
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_major}.${forge_minor}"
//JEI
compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
// compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
// runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
// deobfCompile "team.chisel.ctm:CTM:MC${minecraft_version}-${ctm_version}:api"
// deobfCompile "refinedstorage:refinedstorage:${rs_version}:api"
// runtime "team.chisel.ctm:CTM:MC${minecraft_version}-${ctm_version}"
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

# Build specific
minecraft_version=1.16.2
forge_major=33.0
forge_minor=61
minecraft_version=1.16.3
forge_major=34.0
forge_minor=1
mcp_mappings=20200820-1.16.1

# Mod specific
version=3.6.0
version=3.7.0
jei_version=1.16.2:7.3.2.25
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
package com.direwolf20.buildinggadgets.client;

import com.direwolf20.buildinggadgets.client.screen.TemplateManagerGUI;
import com.direwolf20.buildinggadgets.common.items.AbstractGadget;
import com.direwolf20.buildinggadgets.common.items.OurItems;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.gui.handlers.IGuiContainerHandler;
import mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter;
import mezz.jei.api.registration.IGuiHandlerRegistration;
import mezz.jei.api.registration.ISubtypeRegistration;
import net.minecraft.client.renderer.Rectangle2d;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@JeiPlugin
public class BuildingGadgetsJEI implements IModPlugin {
@Override
public ResourceLocation getPluginUid() {
return new ResourceLocation(Reference.MODID, "jei_plugin");
}

@Override
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
registration.addGuiContainerHandler(TemplateManagerGUI.class, new GuiContainerHandler());
}

@Override
public void registerItemSubtypes(ISubtypeRegistration registration) {
List<Item> gadgets = new ArrayList<Item>(){{
add(OurItems.BUILDING_GADGET_ITEM.get());
add(OurItems.EXCHANGING_GADGET_ITEM.get());
add(OurItems.DESTRUCTION_GADGET_ITEM.get());
add(OurItems.COPY_PASTE_GADGET_ITEM.get());
}};

for(Item gadget : gadgets) {
registration.registerSubtypeInterpreter(gadget, itemStack -> {
if (!(itemStack.getItem() instanceof AbstractGadget))
return ISubtypeInterpreter.NONE;

double energy = itemStack.getOrCreateTag().getDouble("energy");
if (energy == 0)
return "empty";
else if (energy == ((AbstractGadget) itemStack.getItem()).getEnergyMax())
return "charged";

return ISubtypeInterpreter.NONE;
});
}
}

private static class GuiContainerHandler implements IGuiContainerHandler<TemplateManagerGUI> {
@Override
public List<Rectangle2d> getGuiExtraAreas(TemplateManagerGUI containerScreen) {
return new ArrayList<>(Collections.singleton(new Rectangle2d((containerScreen.width / 2) + 80, (containerScreen.height / 2) - 80, 60, 120)));
}
}
}
//import com.direwolf20.buildinggadgets.client.screen.TemplateManagerGUI;
//import com.direwolf20.buildinggadgets.common.items.AbstractGadget;
//import com.direwolf20.buildinggadgets.common.items.OurItems;
//import com.direwolf20.buildinggadgets.common.util.ref.Reference;
//import mezz.jei.api.IModPlugin;
//import mezz.jei.api.JeiPlugin;
//import mezz.jei.api.gui.handlers.IGuiContainerHandler;
//import mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter;
//import mezz.jei.api.registration.IGuiHandlerRegistration;
//import mezz.jei.api.registration.ISubtypeRegistration;
//import net.minecraft.client.renderer.Rectangle2d;
//import net.minecraft.item.Item;
//import net.minecraft.util.ResourceLocation;
//
//import java.util.ArrayList;
//import java.util.Collections;
//import java.util.List;
//
//@JeiPlugin
//public class BuildingGadgetsJEI implements IModPlugin {
// @Override
// public ResourceLocation getPluginUid() {
// return new ResourceLocation(Reference.MODID, "jei_plugin");
// }
//
// @Override
// public void registerGuiHandlers(IGuiHandlerRegistration registration) {
// registration.addGuiContainerHandler(TemplateManagerGUI.class, new GuiContainerHandler());
// }
//
// @Override
// public void registerItemSubtypes(ISubtypeRegistration registration) {
// List<Item> gadgets = new ArrayList<Item>(){{
// add(OurItems.BUILDING_GADGET_ITEM.get());
// add(OurItems.EXCHANGING_GADGET_ITEM.get());
// add(OurItems.DESTRUCTION_GADGET_ITEM.get());
// add(OurItems.COPY_PASTE_GADGET_ITEM.get());
// }};
//
// for(Item gadget : gadgets) {
// registration.registerSubtypeInterpreter(gadget, itemStack -> {
// if (!(itemStack.getItem() instanceof AbstractGadget))
// return ISubtypeInterpreter.NONE;
//
// double energy = itemStack.getOrCreateTag().getDouble("energy");
// if (energy == 0)
// return "empty";
// else if (energy == ((AbstractGadget) itemStack.getItem()).getEnergyMax())
// return "charged";
//
// return ISubtypeInterpreter.NONE;
// });
// }
// }
//
// private static class GuiContainerHandler implements IGuiContainerHandler<TemplateManagerGUI> {
// @Override
// public List<Rectangle2d> getGuiExtraAreas(TemplateManagerGUI containerScreen) {
// return new ArrayList<>(Collections.singleton(new Rectangle2d((containerScreen.width / 2) + 80, (containerScreen.height / 2) - 80, 60, 120)));
// }
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Optional<Undo> peek() {
void read(CompoundNBT nbt) {
this.history.clear();
INBT list = nbt.get(NBTKeys.WORLD_SAVE_UNDO_HISTORY);
System.out.println(list);
if (list instanceof ListNBT) {
NBTHelper.deserializeCollection((ListNBT) list, history, inbt -> Undo.deserialize((CompoundNBT) inbt));
ensureSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public final class TemplateHeader {
public static final String VERSION = "2-beta";
private static final String MC_VERSION = "1.16.2";
private static final String MC_VERSION = "1.16.3";

private static final ComparableVersion COMP_VERSION = new ComparableVersion(VERSION);

Expand Down
7 changes: 6 additions & 1 deletion update.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"1.16.2": {
"3.6.0": "Changelog: https://github.com/Direwolf20-MC/BuildingGadgets/wiki/Changelog-1.16"
},
"1.16.3": {
"3.7.0": "Changelog: https://github.com/Direwolf20-MC/BuildingGadgets/wiki/Changelog-1.16"
},
"promos": {
"1.12.2-latest": "2.8.2",
"1.12.2-recommended": "2.8.2",
Expand All @@ -46,6 +49,8 @@
"1.16.1-latest": "3.5.1",
"1.16.1-recommended": "3.5.1",
"1.16.2-latest": "3.6.0",
"1.16.2-recommended": "3.6.0"
"1.16.2-recommended": "3.6.0",
"1.16.3-latest": "3.7.0",
"1.16.3-recommended": "3.7.0"
}
}

0 comments on commit d343777

Please sign in to comment.