Update checkstyle and change tab width to be 4 than 8 (#518)

* Remove unnecessary chmod in travis script
* Update checkstyle and fix indent config
* Travis CI optimizations and checkstyle fixes
This commit is contained in:
liach 2020-04-11 13:21:53 -05:00 committed by Player
parent 24e5bfc827
commit 0036435150
5 changed files with 14 additions and 12 deletions

View file

@ -108,7 +108,7 @@ allprojects {
checkstyle {
configFile = rootProject.file("checkstyle.xml")
toolVersion = '8.25'
toolVersion = '8.31'
}
}

View file

@ -5,6 +5,7 @@
<property name="fileExtensions" value="java"/>
<property name="localeLanguage" value="en"/>
<property name="localeCountry" value="US"/>
<property name="tabWidth" value="4"/>
<module name="NewlineAtEndOfFile"/>
@ -107,11 +108,11 @@
</module>
<module name="Indentation">
<property name="basicOffset" value="8"/>
<property name="basicOffset" value="4"/>
<property name="caseIndent" value="0"/>
<property name="throwsIndent" value="8"/>
<property name="arrayInitIndent" value="8"/>
<property name="lineWrappingIndentation" value="16"/>
<property name="throwsIndent" value="4"/>
<property name="arrayInitIndent" value="4"/>
<property name="lineWrappingIndentation" value="8"/>
</module>
<module name="ParenPad"/>

View file

@ -26,9 +26,10 @@ import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
public interface ItemTooltipCallback {
/** Fired after the game has appended all base tooltip lines to the list. */
Event<ItemTooltipCallback> EVENT = EventFactory.createArrayBacked(ItemTooltipCallback.class, (listeners) ->
(stack, tooltipContext, lines) -> {
/**
* Fired after the game has appended all base tooltip lines to the list.
*/
Event<ItemTooltipCallback> EVENT = EventFactory.createArrayBacked(ItemTooltipCallback.class, (listeners) -> (stack, tooltipContext, lines) -> {
for (ItemTooltipCallback callback : listeners) {
callback.getTooltip(stack, tooltipContext, lines);
}
@ -37,6 +38,7 @@ public interface ItemTooltipCallback {
/**
* Called when an item stack's tooltip is rendered. Text added to {@code lines} will be
* rendered with the tooltip.
*
* @param lines the list containing the lines of text displayed on the stack's tooltip
*/
void getTooltip(ItemStack stack, TooltipContext tooltipContext, List<Text> lines);

View file

@ -94,13 +94,13 @@ public class ServerSidePacketRegistryImpl extends PacketRegistryImpl implements
@Override
protected void onRegister(Identifier id) {
createRegisterTypePacket(PacketTypes.REGISTER, Collections.singleton(id))
.ifPresent((packet) -> forEachHandler((n) -> n.sendPacket(packet)));
.ifPresent((packet) -> forEachHandler((n) -> n.sendPacket(packet)));
}
@Override
protected void onUnregister(Identifier id) {
createRegisterTypePacket(PacketTypes.UNREGISTER, Collections.singleton(id))
.ifPresent((packet) -> forEachHandler((n) -> n.sendPacket(packet)));
.ifPresent((packet) -> forEachHandler((n) -> n.sendPacket(packet)));
}
@Override

View file

@ -20,8 +20,7 @@ import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
public interface HudRenderCallback {
Event<HudRenderCallback> EVENT = EventFactory.createArrayBacked(HudRenderCallback.class, (listeners) ->
(delta) -> {
Event<HudRenderCallback> EVENT = EventFactory.createArrayBacked(HudRenderCallback.class, (listeners) -> (delta) -> {
for (HudRenderCallback event : listeners) {
event.onHudRender(delta);
}