Edivad99/SolarGeneration

[1.14.4] Display issue on the client side in the solar panel container with a dedicated server

Closed this issue · 4 comments

The value wrappes around at 32000 into the minus values and up again.
grafik

This is due to the trackInt method that casts the integer to a short value:

trackInt(new IntReferenceHolder() {
@Override
public int get()
{
return getEnergy();
}
@Override
public void set(int value)
{
tileEntitySolarPanel.getCapability(CapabilityEnergy.ENERGY).ifPresent(h -> ((MyEnergyStorage) h).setEnergy(value));
}
});

To fix this you must use custom packets like this custom tracker here:
https://github.com/MC-U-Team/U-Team-Core/blob/153fd57f88a0d2d71a8f69072f86dc57a89970de/src/main/java/info/u_team/u_team_core/container/UContainer.java#L97-L103

Hi, I tried to look at your code, but since I'm still inexperienced, I can't understand much of it. If you want to help me it would be great.

No problem.
I make a pr soon.

Done. Your build system seems to bug though

Thanks fixed with #15