Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
HyCraftHD opened this issue Nov 15, 2019 · 4 comments
Labels
bug

Comments

@HyCraftHD
Copy link

@HyCraftHD HyCraftHD commented Nov 15, 2019

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

@HyCraftHD HyCraftHD changed the title [1.14.4] Display issue on the client side in the solar panel container [1.14.4] Display issue on the client side in the solar panel container with a dedicated server Nov 15, 2019
@Edivad99 Edivad99 added the bug label Nov 16, 2019
@Edivad99

This comment has been minimized.

Copy link
Owner

@Edivad99 Edivad99 commented Nov 20, 2019

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.

@HyCraftHD

This comment has been minimized.

Copy link
Author

@HyCraftHD HyCraftHD commented Nov 20, 2019

No problem.
I make a pr soon.

HyCraftHD added a commit to HyCraftHD/SolarGeneration that referenced this issue Nov 20, 2019
@HyCraftHD

This comment has been minimized.

Copy link
Author

@HyCraftHD HyCraftHD commented Nov 20, 2019

Done. Your build system seems to bug though

Edivad99 added a commit that referenced this issue Nov 21, 2019
Implement custom int tracker (Should fix #14)
@HyCraftHD

This comment has been minimized.

Copy link
Author

@HyCraftHD HyCraftHD commented Nov 21, 2019

Thanks fixed with #15

@HyCraftHD HyCraftHD closed this Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.