From 8576b8db50c74b90e762909707a1d395534b2b67 Mon Sep 17 00:00:00 2001 From: yuesha-yc Date: Fri, 17 Jan 2025 20:41:11 -0800 Subject: [PATCH] An NPE bug --- build.gradle | 2 +- changelog.txt | 3 --- .../frostedheart/data/FHRecipeProvider.java | 23 +++++++++---------- .../java/com/teammoeg/chorda/util/CUtils.java | 4 +++- .../render/TemperatureGoogleRenderer.java | 14 ++++++++++- .../network/FHResearchSyncPacket.java | 5 ++-- .../research/research/effects/Effect.java | 4 ++-- .../research/effects/EffectCrafting.java | 7 ++++-- .../content/scenario/FHScenario.java | 5 +++- .../content/scenario/ScenarioExecutor.java | 13 ++++++----- .../parser/providers/FTBQProvider.java | 2 +- .../scenario/runner/ScenarioConductor.java | 8 ++++--- .../content/steamenergy/HeatNetwork.java | 2 +- .../HeatNetworkResponseS2CPacket.java | 2 +- .../content/steamenergy/HeatPipeBlock.java | 2 +- .../steamenergy/HeatPipeTileEntity.java | 8 +++---- .../steamenergy/creative/HeatBlockEntity.java | 4 ++-- .../content/steamenergy/pipe}/CPipeBlock.java | 5 ++-- .../steamenergy/pipe}/CPipeBlockEntity.java | 2 +- .../recipe/WaterLevelAndEffectRecipe.java | 3 ++- 20 files changed, 69 insertions(+), 49 deletions(-) rename src/main/java/com/teammoeg/{chorda/block => frostedheart/content/steamenergy/pipe}/CPipeBlock.java (98%) rename src/main/java/com/teammoeg/{chorda/blockentity => frostedheart/content/steamenergy/pipe}/CPipeBlockEntity.java (90%) diff --git a/build.gradle b/build.gradle index 33f3d662d..ce9498e0b 100644 --- a/build.gradle +++ b/build.gradle @@ -270,7 +270,7 @@ dependencies { // Caupona compileOnly fg.deobf("curse.maven:caupona-656147:5116975") - implementation fg.deobf("curse.maven:caupona-656147:5116975") +// implementation fg.deobf("curse.maven:caupona-656147:5116975") // LDLib compileOnly fg.deobf("com.lowdragmc.ldlib:ldlib-forge-${minecraft_version}:${ldlib_version}") { transitive = false } diff --git a/changelog.txt b/changelog.txt index 173837b05..e69de29bb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +0,0 @@ - -Fix steam network -Fix inventory drops \ No newline at end of file diff --git a/src/datagen/java/com/teammoeg/frostedheart/data/FHRecipeProvider.java b/src/datagen/java/com/teammoeg/frostedheart/data/FHRecipeProvider.java index 0a7b0eb45..e5379b1be 100644 --- a/src/datagen/java/com/teammoeg/frostedheart/data/FHRecipeProvider.java +++ b/src/datagen/java/com/teammoeg/frostedheart/data/FHRecipeProvider.java @@ -28,7 +28,6 @@ import javax.annotation.Nonnull; import blusunrize.immersiveengineering.api.IETags; -import com.teammoeg.caupona.CPFluids; import com.teammoeg.chorda.util.CRegistries; import com.teammoeg.frostedheart.FHMain; import com.teammoeg.frostedheart.bootstrap.common.FHItems; @@ -70,13 +69,13 @@ protected void buildRecipes(@Nonnull Consumer out) { Item it= CRegistries.getItem(item); if(it==null||it==Items.AIR) { FHMain.LOGGER.warn("TWR Recipe: " + item + " not exist"); - ps.println(item+","+parts[1]); + FHMain.LOGGER.info(item+","+parts[1]); }else { FoodProperties f=it.getFoodProperties(); if(f==null) - ps.println(item+","+parts[1]); + FHMain.LOGGER.info("Food Value: " + item+","+parts[1]); else - ps.println(item+","+f.getNutrition()); + FHMain.LOGGER.info("Food Nutrition: " + item+","+f.getNutrition()); } NutritionRecipeBuilder dvb=new NutritionRecipeBuilder().item(it); float grain=Float.parseFloat(parts[2])*10f; @@ -94,14 +93,14 @@ protected void buildRecipes(@Nonnull Consumer out) { e.printStackTrace(); } - CPFluids.getAll().filter(o->!Arrays.stream(ovride).anyMatch(CRegistries.getRegistryName(o).getPath()::equals)).forEach(f-> { - - out.accept(new WaterLevelFluidRecipe(new ResourceLocation(FHMain.MODID,"water_level/"+ CRegistries.getRegistryName(f).getPath()+"_thermos"),Ingredient.of(ItemTags.create(new ResourceLocation(FHMain.MODID,"thermos"))),f,2,2)); - }); - CPFluids.getAll().filter(o-> CRegistries.getRegistryName(o).getPath().equals("dilute_soup")).forEach(f-> { - - out.accept(new WaterLevelFluidRecipe(new ResourceLocation(FHMain.MODID,"water_level/"+ CRegistries.getRegistryName(f).getPath()+"_thermos"),Ingredient.of(ItemTags.create(new ResourceLocation(FHMain.MODID,"thermos"))),f,3,2)); - }); +// CPFluids.getAll().filter(o->!Arrays.stream(ovride).anyMatch(CRegistries.getRegistryName(o).getPath()::equals)).forEach(f-> { +// +// out.accept(new WaterLevelFluidRecipe(new ResourceLocation(FHMain.MODID,"water_level/"+ CRegistries.getRegistryName(f).getPath()+"_thermos"),Ingredient.of(ItemTags.create(new ResourceLocation(FHMain.MODID,"thermos"))),f,2,2)); +// }); +// CPFluids.getAll().filter(o-> CRegistries.getRegistryName(o).getPath().equals("dilute_soup")).forEach(f-> { +// +// out.accept(new WaterLevelFluidRecipe(new ResourceLocation(FHMain.MODID,"water_level/"+ CRegistries.getRegistryName(f).getPath()+"_thermos"),Ingredient.of(ItemTags.create(new ResourceLocation(FHMain.MODID,"thermos"))),f,3,2)); +// }); recipeTrade(out); diff --git a/src/main/java/com/teammoeg/chorda/util/CUtils.java b/src/main/java/com/teammoeg/chorda/util/CUtils.java index 830a37c6c..afad9324f 100644 --- a/src/main/java/com/teammoeg/chorda/util/CUtils.java +++ b/src/main/java/com/teammoeg/chorda/util/CUtils.java @@ -20,9 +20,11 @@ package com.teammoeg.chorda.util; import com.google.common.collect.ImmutableList; +import com.teammoeg.chorda.Chorda; import com.teammoeg.chorda.capability.nbt.CNBTCapability; import com.teammoeg.chorda.util.client.ClientUtils; import com.teammoeg.chorda.util.io.NBTSerializable; +import com.teammoeg.frostedheart.FHMain; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; @@ -252,7 +254,7 @@ public static , T> C copyCollection(@Nonnull C collectio return copyCollection; } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { - System.err.println("Failed to copy the collection due to an error: " + e.getMessage()); + Chorda.LOGGER.error("Failed to copy the collection due to an error: " + e.getMessage()); e.printStackTrace(); } return null; diff --git a/src/main/java/com/teammoeg/frostedheart/content/climate/render/TemperatureGoogleRenderer.java b/src/main/java/com/teammoeg/frostedheart/content/climate/render/TemperatureGoogleRenderer.java index eed91f8c4..37e6c43c6 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/climate/render/TemperatureGoogleRenderer.java +++ b/src/main/java/com/teammoeg/frostedheart/content/climate/render/TemperatureGoogleRenderer.java @@ -80,7 +80,19 @@ public class TemperatureGoogleRenderer { public static int hoverTicks = 0; public static BlockPos lastHovered = null; public static BlockPos lastHeatNetworkPos = null; - public static ClientHeatNetworkData lastHeatNetworkData = null; + private static ClientHeatNetworkData lastHeatNetworkData = null; + + public static boolean hasHeatNetworkData() { + return lastHeatNetworkData != null && !lastHeatNetworkData.invalid(); + } + + public static ClientHeatNetworkData getHeatNetworkData() { + return lastHeatNetworkData; + } + + public static void setHeatNetworkData(ClientHeatNetworkData data) { + lastHeatNetworkData = data; + } public static void renderOverlay(ForgeGui gui, GuiGraphics graphics, float partialTicks, int width, int height) { diff --git a/src/main/java/com/teammoeg/frostedheart/content/research/network/FHResearchSyncPacket.java b/src/main/java/com/teammoeg/frostedheart/content/research/network/FHResearchSyncPacket.java index 8e3e2d2f4..b5a5e2f1e 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/research/network/FHResearchSyncPacket.java +++ b/src/main/java/com/teammoeg/frostedheart/content/research/network/FHResearchSyncPacket.java @@ -21,6 +21,7 @@ import java.util.function.Supplier; +import com.mojang.logging.LogUtils; import com.teammoeg.chorda.network.CMessage; import com.teammoeg.frostedheart.content.research.FHResearch; import com.teammoeg.frostedheart.content.research.research.Research; @@ -44,13 +45,13 @@ public FHResearchSyncPacket(FriendlyByteBuf buffer) { public void encode(FriendlyByteBuf buffer) { ObjectWriter.writeObject(buffer, data); - System.out.println("encoded "+key+":"+data); + LogUtils.getLogger().debug("Encoded research "+key+":"+data); buffer.writeUtf(key); } public void handle(Supplier context) { - context.get().enqueueWork(() -> {System.out.println("decoded "+key+":"+data);FHResearch.readOne(key,CodecUtil.decodeOrThrow(Research.CODEC.decode(DataOps.COMPRESSED, data)));}); + context.get().enqueueWork(() -> {LogUtils.getLogger().debug("Decoded research "+key+":"+data);FHResearch.readOne(key,CodecUtil.decodeOrThrow(Research.CODEC.decode(DataOps.COMPRESSED, data)));}); context.get().setPacketHandled(true); } } diff --git a/src/main/java/com/teammoeg/frostedheart/content/research/research/effects/Effect.java b/src/main/java/com/teammoeg/frostedheart/content/research/research/effects/Effect.java index 3050a9b7a..a75981f37 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/research/research/effects/Effect.java +++ b/src/main/java/com/teammoeg/frostedheart/content/research/research/effects/Effect.java @@ -65,13 +65,13 @@ public BaseData(String name, List tooltip, Optional icon, String } } - public static final MapCodec BASE_CODEC=CodecUtil.debugCodec(RecordCodecBuilder.mapCodec(t-> + public static final MapCodec BASE_CODEC=RecordCodecBuilder.mapCodec(t-> t.group( Codec.STRING.optionalFieldOf("name","").forGetter(o->o.name), Codec.list(Codec.STRING).optionalFieldOf("tooltip",Arrays.asList()).forGetter(o->o.tooltip), FHIcons.CODEC.optionalFieldOf("icon").forGetter(o->Optional.ofNullable(o.icon)), Codec.STRING.fieldOf("id").forGetter(o->o.nonce), - Codec.BOOL.optionalFieldOf("hidden",false).forGetter(o->o.hidden)).apply(t, BaseData::new))); + Codec.BOOL.optionalFieldOf("hidden",false).forGetter(o->o.hidden)).apply(t, BaseData::new)); private static TypedCodecRegistry registry = new TypedCodecRegistry<>(); public static final Codec CODEC=registry.codec(); static { diff --git a/src/main/java/com/teammoeg/frostedheart/content/research/research/effects/EffectCrafting.java b/src/main/java/com/teammoeg/frostedheart/content/research/research/effects/EffectCrafting.java index 31af044b5..f44b3f41c 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/research/research/effects/EffectCrafting.java +++ b/src/main/java/com/teammoeg/frostedheart/content/research/research/effects/EffectCrafting.java @@ -30,6 +30,7 @@ import java.util.stream.Collectors; import com.mojang.datafixers.util.Either; +import com.mojang.logging.LogUtils; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; @@ -172,8 +173,10 @@ private void initItem() { unlocks.clear(); for (Recipe r : CTeamDataManager.getRecipeManager().getRecipes()) { ItemStack result=r.getResultItem(CRegistries.getAccess()); - if(result==null)System.out.println("error null recipe "+r); - if (result!=null&&ingredient.test(result)) { + if(result==null) { + LogUtils.getLogger().debug("Error null recipe "+r); + } + if (ingredient.test(result)) { unlocks.add(r); } } diff --git a/src/main/java/com/teammoeg/frostedheart/content/scenario/FHScenario.java b/src/main/java/com/teammoeg/frostedheart/content/scenario/FHScenario.java index 2388e0bea..51f7b48f6 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/scenario/FHScenario.java +++ b/src/main/java/com/teammoeg/frostedheart/content/scenario/FHScenario.java @@ -30,6 +30,8 @@ import java.util.NoSuchElementException; import java.util.Objects; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; import org.objectweb.asm.Type; import com.teammoeg.frostedheart.FHMain; @@ -63,13 +65,14 @@ import net.minecraftforge.network.PacketDistributor; public class FHScenario { + static Marker MARKER = MarkerManager.getMarker("Scenario Conductor"); public static ScenarioExecutor server = new ScenarioExecutor<>(ScenarioCommandContext.class); private static final List scenarioProviders = new ArrayList<>(); public static Map>> triggers=new HashMap<>(); //private static Map runners=new HashMap<>(); public static void startFor(ServerPlayer pe,String lang) { ScenarioConductor sr = get(pe); - System.out.println("From saved: "+pe.getLanguage()+" From packet: "+lang); + FHMain.LOGGER.debug(MARKER, "From saved: "+pe.getLanguage()+" From packet: "+lang); sr.init(pe,lang); diff --git a/src/main/java/com/teammoeg/frostedheart/content/scenario/ScenarioExecutor.java b/src/main/java/com/teammoeg/frostedheart/content/scenario/ScenarioExecutor.java index c9669e141..52d0943b5 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/scenario/ScenarioExecutor.java +++ b/src/main/java/com/teammoeg/frostedheart/content/scenario/ScenarioExecutor.java @@ -32,6 +32,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; import org.joml.Vector3f; import com.teammoeg.frostedheart.FHMain; @@ -45,6 +47,7 @@ import net.minecraft.core.Vec3i; public class ScenarioExecutor { + static Marker MARKER = MarkerManager.getMarker("Scenario Executor"); private static class MethodInfo implements ScenarioMethod { private static class ParamInfo { String[] paramName; @@ -161,7 +164,6 @@ public void execute(T runner, Map param) { public interface ScenarioMethod { void execute(T scenarioVM, Map param); } - static Logger LOGGER = LogManager.getLogger("ScenarioExecutor"); Class objcls; public ScenarioExecutor(Class objcls) { super(); @@ -295,7 +297,7 @@ public void register(Class clazz) { registerInst(ctor.newInstance()); } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException e) { - FHMain.LOGGER.error("Error registering scenario class",e); + FHMain.LOGGER.error(MARKER, "Error registering scenario class",e); } catch (InvocationTargetException e) { throw new RuntimeException("Error registering scenario class" + e.getTargetException()); } @@ -314,7 +316,7 @@ public void registerInst(Object clazz) { registerCommand(met.getName(), new MethodInfo<>(Modifier.isStatic(met.getModifiers()) ? null : clazz, met, this)); } catch (ScenarioExecutionException ex) { ex.printStackTrace(); - LOGGER.warn(ex.getMessage()); + FHMain.LOGGER.warn(MARKER, ex.getMessage()); } } } @@ -328,15 +330,14 @@ public void registerStatic(Class clazz) { } catch (ScenarioExecutionException ex) { ex.printStackTrace(); - LOGGER.warn(ex.getMessage()); + FHMain.LOGGER.warn(MARKER, ex.getMessage()); } } } } static class Test{ public void test(ScenarioConductor sr,@Param("s")String s,@Param("s")Rect r,@Param("")Rect r1) { - System.out.println(s+":"+r+":"+r1); - + FHMain.LOGGER.error(s+":"+r+":"+r1); } } public static void main(String[] args) throws SecurityException { diff --git a/src/main/java/com/teammoeg/frostedheart/content/scenario/parser/providers/FTBQProvider.java b/src/main/java/com/teammoeg/frostedheart/content/scenario/parser/providers/FTBQProvider.java index 51d3925fe..024fc4d0f 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/scenario/parser/providers/FTBQProvider.java +++ b/src/main/java/com/teammoeg/frostedheart/content/scenario/parser/providers/FTBQProvider.java @@ -72,7 +72,7 @@ public String get(String t,Map param) { if(param.containsKey("call")) b.append("@Return\n"); //b.append("@EndAct\n"); - System.out.println(b.toString()); + // System.out.println(b.toString()); return b.toString(); } diff --git a/src/main/java/com/teammoeg/frostedheart/content/scenario/runner/ScenarioConductor.java b/src/main/java/com/teammoeg/frostedheart/content/scenario/runner/ScenarioConductor.java index 8627108fa..36b21e1fa 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/scenario/runner/ScenarioConductor.java +++ b/src/main/java/com/teammoeg/frostedheart/content/scenario/runner/ScenarioConductor.java @@ -38,6 +38,7 @@ import net.minecraft.nbt.Tag; import net.minecraft.nbt.ListTag; import net.minecraftforge.common.util.LazyOptional; +import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.MarkerManager; /** @@ -47,6 +48,7 @@ * You should define triggers in script file and activate triggers to make it execute. * */ public class ScenarioConductor implements NBTSerializable{ + Marker MARKER = MarkerManager.getMarker("Scenario Conductor"); //Sence control private transient Act currentAct; public Map acts=new HashMap<>(); @@ -203,8 +205,8 @@ public void enterAct(ActNamespace quest) { data.currentLabel=new ExecuteTarget(old.getScenario().name(),null); currentAct=data; copyExecuteInfo(currentAct,old); - System.out.println("new:"+data); - System.out.println("old:"+old); + FHMain.LOGGER.info(MARKER, "Entering new act: "+data); + FHMain.LOGGER.info(MARKER, "Quiting old act: "+old); old.stop(); } @@ -271,7 +273,7 @@ public void save(CompoundTag data, boolean isPacket) { public void load(CompoundTag data, boolean isPacket) { getContext().varData.load(data.getCompound("vars")); getContext().takeSnapshot(); - FHMain.LOGGER.info(MarkerManager.getMarker("Scenario Conductor"), data.getCompound("vars")); + FHMain.LOGGER.info(MARKER, data.getCompound("vars")); ListTag lacts=data.getList("acts", Tag.TAG_COMPOUND); //Act initact=acts.get(init); for(Tag v:lacts) { diff --git a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatNetwork.java b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatNetwork.java index 85c62996f..eebce3d2c 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatNetwork.java +++ b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatNetwork.java @@ -418,7 +418,7 @@ public void tick(Level level) { } else if (interval == 0) { clearConnection(level); // Connect all pipes and endpoints again - System.out.println("full rebuild triggered"); + // System.out.println("full rebuild triggered"); if (onConnect != null) onConnect.run(); interval = -1; diff --git a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatNetworkResponseS2CPacket.java b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatNetworkResponseS2CPacket.java index 705b96ab3..9201ef0f4 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatNetworkResponseS2CPacket.java +++ b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatNetworkResponseS2CPacket.java @@ -40,7 +40,7 @@ public void encode(FriendlyByteBuf buffer) { public void handle(Supplier context) { context.get().enqueueWork(() -> { // on the client side, update HeatNetwork's fields - TemperatureGoogleRenderer.lastHeatNetworkData = data; + TemperatureGoogleRenderer.setHeatNetworkData(data); }); context.get().setPacketHandled(true); } diff --git a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatPipeBlock.java b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatPipeBlock.java index 6e616c15c..8a2c926c0 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatPipeBlock.java +++ b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatPipeBlock.java @@ -20,7 +20,7 @@ package com.teammoeg.frostedheart.content.steamenergy; import com.teammoeg.chorda.block.CEntityBlock; -import com.teammoeg.chorda.block.CPipeBlock; +import com.teammoeg.frostedheart.content.steamenergy.pipe.CPipeBlock; import com.teammoeg.frostedheart.bootstrap.common.FHBlockEntityTypes; import com.teammoeg.frostedheart.content.steamenergy.capabilities.HeatCapabilities; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatPipeTileEntity.java b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatPipeTileEntity.java index 96bfed071..c374b4bdb 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatPipeTileEntity.java +++ b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/HeatPipeTileEntity.java @@ -21,8 +21,8 @@ import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation; import com.teammoeg.chorda.block.CTickableBlockEntity; -import com.teammoeg.chorda.block.CPipeBlock; -import com.teammoeg.chorda.blockentity.CPipeBlockEntity; +import com.teammoeg.frostedheart.content.steamenergy.pipe.CPipeBlock; +import com.teammoeg.frostedheart.content.steamenergy.pipe.CPipeBlockEntity; import com.teammoeg.frostedheart.bootstrap.common.FHBlockEntityTypes; import com.teammoeg.frostedheart.content.climate.render.TemperatureGoogleRenderer; import com.teammoeg.frostedheart.util.client.Lang; @@ -83,8 +83,8 @@ public boolean addToGoggleTooltip(List tooltip, boolean isPlayerSneak Lang.tooltip("heat_stats").forGoggles(tooltip); - if (!TemperatureGoogleRenderer.lastHeatNetworkData.invalid()) { - ClientHeatNetworkData data = TemperatureGoogleRenderer.lastHeatNetworkData; + if (TemperatureGoogleRenderer.hasHeatNetworkData()) { + ClientHeatNetworkData data = TemperatureGoogleRenderer.getHeatNetworkData(); Lang.translate("tooltip", "pressure") .style(GRAY) diff --git a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/creative/HeatBlockEntity.java b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/creative/HeatBlockEntity.java index 5f822323e..ad222e428 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/steamenergy/creative/HeatBlockEntity.java +++ b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/creative/HeatBlockEntity.java @@ -43,8 +43,8 @@ public boolean addToGoggleTooltip(List tooltip, boolean isPlayerSneak Lang.tooltip("heat_stats").forGoggles(tooltip); - if (!TemperatureGoogleRenderer.lastHeatNetworkData.invalid()) { - ClientHeatNetworkData data = TemperatureGoogleRenderer.lastHeatNetworkData; + if (TemperatureGoogleRenderer.hasHeatNetworkData()) { + ClientHeatNetworkData data = TemperatureGoogleRenderer.getHeatNetworkData(); Lang.translate("tooltip", "pressure.network") .style(GRAY) diff --git a/src/main/java/com/teammoeg/chorda/block/CPipeBlock.java b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/pipe/CPipeBlock.java similarity index 98% rename from src/main/java/com/teammoeg/chorda/block/CPipeBlock.java rename to src/main/java/com/teammoeg/frostedheart/content/steamenergy/pipe/CPipeBlock.java index aab4058b6..1d83b1e26 100644 --- a/src/main/java/com/teammoeg/chorda/block/CPipeBlock.java +++ b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/pipe/CPipeBlock.java @@ -17,13 +17,12 @@ * */ -package com.teammoeg.chorda.block; +package com.teammoeg.frostedheart.content.steamenergy.pipe; import java.util.Map; import javax.annotation.Nullable; import com.google.common.collect.Maps; -import com.teammoeg.chorda.blockentity.CPipeBlockEntity; import com.teammoeg.chorda.util.CUtils; import net.minecraft.Util; @@ -253,7 +252,7 @@ public void tick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSour BlockState updated=updateBlockState(state, null, null, worldIn, pos); worldIn.setBlock(pos, updated, 2); worldIn.sendBlockUpdated(pos, state, updated, 2); - System.out.println("update pipe "+pos); +// System.out.println("update pipe "+pos); checkNewConnection(worldIn,pos,state,updated); //System.out.println(pos+" requested update "+updated.getValue(PROPERTY_BY_DIRECTION.get(Direction.UP))); //if(state!=updated) { diff --git a/src/main/java/com/teammoeg/chorda/blockentity/CPipeBlockEntity.java b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/pipe/CPipeBlockEntity.java similarity index 90% rename from src/main/java/com/teammoeg/chorda/blockentity/CPipeBlockEntity.java rename to src/main/java/com/teammoeg/frostedheart/content/steamenergy/pipe/CPipeBlockEntity.java index c4b599875..93b032da6 100644 --- a/src/main/java/com/teammoeg/chorda/blockentity/CPipeBlockEntity.java +++ b/src/main/java/com/teammoeg/frostedheart/content/steamenergy/pipe/CPipeBlockEntity.java @@ -1,4 +1,4 @@ -package com.teammoeg.chorda.blockentity; +package com.teammoeg.frostedheart.content.steamenergy.pipe; import blusunrize.immersiveengineering.common.blocks.IEBaseBlockEntity; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/teammoeg/frostedheart/content/water/recipe/WaterLevelAndEffectRecipe.java b/src/main/java/com/teammoeg/frostedheart/content/water/recipe/WaterLevelAndEffectRecipe.java index f8705b9b3..95118cd48 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/water/recipe/WaterLevelAndEffectRecipe.java +++ b/src/main/java/com/teammoeg/frostedheart/content/water/recipe/WaterLevelAndEffectRecipe.java @@ -4,6 +4,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.teammoeg.frostedheart.FHMain; import net.minecraft.core.RegistryAccess; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.NbtUtils; @@ -101,7 +102,7 @@ public WaterLevelAndEffectRecipe fromJson(ResourceLocation recipeId, JsonObject try { compoundTag = NbtUtils.snbtToStructure(nbt.toString()); } catch (CommandSyntaxException e) { - System.out.println(recipeId + ": no nbt."); + FHMain.LOGGER.error("Water level recipe " + recipeId + " has no nbt."); } //todo debug }