-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Labels
platform: forgestatus: futureThis is something we'd like to do, but we don't have the time nowThis is something we'd like to do, but we don't have the time nowtype: enhancement
Description
First of all awesome plugin! Thank you for the efforts creating this >3
There is one case of valid sideonly usage:
void someFunc() {
if (getSide() == Side.CLIENT)
someClientOnlyMethod();
}
@SideOnly(Side.CLIENT)
void someClientOnlyMethod() { ... }
where getSide() effectively returns FMLCommonHandler.INSTANCE.getEffectiveSide()
.
There are possible variations which are essentially the same:
void someFunc() {
if (isClient())
someClientOnlyMethod();
}
// Maybe wrapped in some utility class
boolean isClient() { return getSide() == Side.CLIENT; }
@SideOnly(Side.CLIENT)
void someClientOnlyMethod() { ... }
Since detecting this kind of usage can be difficult, I suggest using certain annotation (e.g. SuppressWarning("sideonly")
on methods that have this kind of usage.
Metadata
Metadata
Assignees
Labels
platform: forgestatus: futureThis is something we'd like to do, but we don't have the time nowThis is something we'd like to do, but we don't have the time nowtype: enhancement