mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-14 19:25:23 -05:00
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:
parent
9cd8d660bf
commit
1a47cd78f6
6 changed files with 18 additions and 16 deletions
|
@ -3,9 +3,9 @@ install: true
|
|||
|
||||
jdk:
|
||||
- openjdk8
|
||||
- openjdk11
|
||||
|
||||
script:
|
||||
- chmod +x gradlew
|
||||
- ./gradlew check build publishToMavenLocal --stacktrace
|
||||
|
||||
notifications:
|
||||
|
|
|
@ -111,7 +111,7 @@ allprojects {
|
|||
|
||||
checkstyle {
|
||||
configFile = rootProject.file("checkstyle.xml")
|
||||
toolVersion = '8.25'
|
||||
toolVersion = '8.31'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -28,14 +28,14 @@ import java.util.function.Consumer;
|
|||
import io.netty.util.concurrent.Future;
|
||||
import io.netty.util.concurrent.GenericFutureListener;
|
||||
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.packet.c2s.login.LoginQueryResponseC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.network.packet.c2s.login.LoginQueryResponseC2SPacket;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import net.fabricmc.fabric.api.event.network.C2SPacketTypeCallback;
|
||||
import net.fabricmc.fabric.api.network.PacketContext;
|
||||
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue