-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #337 from FTBTeam/dev
Dev
- Loading branch information
Showing
23 changed files
with
250 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
common/src/main/java/dev/ftb/mods/ftbchunks/client/PointerIconMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package dev.ftb.mods.ftbchunks.client; | ||
|
||
import dev.ftb.mods.ftblibrary.config.NameMap; | ||
|
||
public enum PointerIconMode { | ||
FACE(true, false), | ||
POINTER(false, true), | ||
BOTH(true, true), | ||
; | ||
|
||
public static final NameMap<PointerIconMode> NAME_MAP = NameMap.of(BOTH, values()).baseNameKey("ftbchunks.minimap.pointer_icon_mode").create(); | ||
|
||
private final boolean face; | ||
private final boolean pointer; | ||
|
||
PointerIconMode(boolean face, boolean pointer) { | ||
this.face = face; | ||
this.pointer = pointer; | ||
} | ||
|
||
public boolean showFace() { | ||
return face; | ||
} | ||
|
||
public boolean showPointer() { | ||
return pointer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
common/src/main/java/dev/ftb/mods/ftbchunks/client/minimap/MinimapComponentConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package dev.ftb.mods.ftbchunks.client.minimap; | ||
|
||
import dev.ftb.mods.ftbchunks.client.gui.MinimapInfoSortScreen; | ||
import dev.ftb.mods.ftblibrary.config.ConfigCallback; | ||
import dev.ftb.mods.ftblibrary.config.ConfigGroup; | ||
import dev.ftb.mods.ftblibrary.config.ConfigValue; | ||
import dev.ftb.mods.ftblibrary.snbt.config.SNBTConfig; | ||
import dev.ftb.mods.ftblibrary.snbt.config.StringMapValue; | ||
import dev.ftb.mods.ftblibrary.ui.Widget; | ||
import dev.ftb.mods.ftblibrary.ui.input.MouseButton; | ||
import net.minecraft.network.chat.Component; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Map; | ||
|
||
public class MinimapComponentConfig extends StringMapValue { | ||
|
||
public MinimapComponentConfig(@Nullable SNBTConfig c, String n, Map<String, String> def) { | ||
super(c, n, def); | ||
} | ||
|
||
|
||
@Override | ||
public void createClientConfig(ConfigGroup group) { | ||
group.add(key, new MinimapComponentConfigValue(), get(), stringBooleanMap -> { | ||
}, defaultValue); | ||
} | ||
|
||
public static class MinimapComponentConfigValue extends ConfigValue<Map<String, String>> { | ||
|
||
@Override | ||
public void onClicked(Widget clickedWidget, MouseButton button, ConfigCallback callback) { | ||
new MinimapInfoSortScreen().openGui(); | ||
} | ||
|
||
@Override | ||
public Component getStringForGUI(@Nullable Map<String, String> v) { | ||
if (v == null) { | ||
return super.getStringForGUI(null); | ||
} | ||
return Component.translatable("ftbchunks.gui.sort_minimap_info"); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
common/src/main/java/dev/ftb/mods/ftbchunks/core/mixin/PistonBaseBlockMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package dev.ftb.mods.ftbchunks.core.mixin; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import dev.architectury.platform.Platform; | ||
import dev.ftb.mods.ftbchunks.api.FTBChunksProperties; | ||
import dev.ftb.mods.ftbchunks.util.PistonHelper; | ||
import dev.ftb.mods.ftbteams.api.property.PrivacyProperty; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.piston.PistonBaseBlock; | ||
import net.minecraft.world.level.block.piston.PistonStructureResolver; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(PistonBaseBlock.class) | ||
public class PistonBaseBlockMixin { | ||
@Inject(method = "moveBlocks", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/piston/PistonStructureResolver;getToPush()Ljava/util/List;"), cancellable = true) | ||
public void onMoveBlocks(Level level, BlockPos blockPos, Direction direction, boolean extending, CallbackInfoReturnable<Boolean> cir, @Local PistonStructureResolver pistonStructureResolver) { | ||
if (PistonHelper.shouldPreventPistonMovement(level, blockPos, pistonStructureResolver)) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
} |
Oops, something went wrong.