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/
/classes/
/gradle.properties
/buildSrc/.gradle/
/buildSrc/build/

View file

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

View file

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