Fix opening guis, still needs some work, but atleast it works now

This commit is contained in:
modmuss50 2019-03-02 18:45:33 +00:00
parent f94d6630fb
commit ff1370a3fd
3 changed files with 10 additions and 14 deletions

2
.gitignore vendored
View file

@ -26,3 +26,5 @@ java_pid2412.hprof
/logs/ /logs/
/classes/ /classes/
/gradle.properties /gradle.properties
/buildSrc/.gradle/
/buildSrc/build/

View file

@ -196,10 +196,10 @@ task renameCrowdin(type: Copy, dependsOn: ['crowdin', 'cleanCrowdin']){
} }
} }
import techreborn.build.GenerateResourcesTask //import techreborn.build.GenerateResourcesTask
task genResources(type: GenerateResourcesTask){ //task genResources(type: GenerateResourcesTask){
outputDir = file("src/main/resources") // outputDir = file("src/main/resources")
} //}
publishing { publishing {
publications { publications {

View file

@ -224,7 +224,7 @@ public enum EGui implements IMachineGuiHandler {
public static EGui byID(ResourceLocation resourceLocation){ public static EGui byID(ResourceLocation resourceLocation){
return Arrays.stream(values()) return Arrays.stream(values())
.filter(eGui -> eGui.name().toLowerCase().equals(resourceLocation.toString())) .filter(eGui -> eGui.name().toLowerCase().equals(resourceLocation.getPath()))
.findFirst() .findFirst()
.orElseThrow(() -> new RuntimeException("Failed to find gui for " + resourceLocation)); .orElseThrow(() -> new RuntimeException("Failed to find gui for " + resourceLocation));
} }
@ -245,12 +245,12 @@ public enum EGui implements IMachineGuiHandler {
@Override @Override
public String getGuiID() { public String getGuiID() {
return gui.name().toLowerCase(); return "techreborn:" + gui.name().toLowerCase();
} }
@Override @Override
public ITextComponent getName() { public ITextComponent getName() {
return new TextComponentString(gui.name().toLowerCase()); return new TextComponentString(getGuiID());
} }
@Override @Override
@ -263,13 +263,7 @@ public enum EGui implements IMachineGuiHandler {
public ITextComponent getCustomName() { public ITextComponent getCustomName() {
return null; return null;
} }
}, new Consumer<PacketBuffer>() { }, packetBuffer -> packetBuffer.writeBlockPos(pos));
@Override
public void accept(PacketBuffer packetBuffer) {
packetBuffer.writeBlockPos(pos);
}
});
//player.openGui(TechReborn.INSTANCE, this.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
} }
} }