Skip to content

Commit

Permalink
Updated to 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Emafire003 committed Sep 13, 2023
1 parent 3b22806 commit 3270578
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.1
loader_version=0.14.9
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22


# Mod Properties
mod_version = 1.1.0
mod_version = 1.3.0
maven_group = me.emafire003.dev
archives_base_name = beampass

# Dependencies
fabric_version=0.59.0+1.19.2
#modmenu_version = 4.0.5
#omega_config_version = 1.3
fabric_version=0.88.1+1.20.1

6 changes: 3 additions & 3 deletions src/main/java/me/emafire003/dev/beampass/BeamPass.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.registry.Registries;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -50,7 +50,7 @@ private void initializeBypassableBlocks(){
public static List<String> convertFromBlockList(List<Block> typelist){
List<String> list = new ArrayList<>();
for(Block type : typelist){
list.add(Registry.BLOCK.getId(type).toString());
list.add(Registries.BLOCK.getId(type).toString());
}
return list;
}
Expand All @@ -61,7 +61,7 @@ public static List<String> convertFromBlockList(List<Block> typelist){
public static List<Block> convertToBlockList(List<String> typelist){
List<Block> list = new ArrayList<>();
for(String type : typelist){
Block block = Registry.BLOCK.get(new Identifier(type));
Block block = Registries.BLOCK.get(new Identifier(type));
if(block != null){
list.add(block);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private int addBlock(CommandContext<ServerCommandSource> context) throws Command
BlockState blockState = BlockStateArgumentType.getBlockState(context, "block").getBlockState();
ServerCommandSource source = context.getSource();
BeamPass.addBlock(blockState.getBlock());
source.sendFeedback(Text.literal("The §a" + blockState.getBlock().getName().getString() + " §rblock has been added to the list beam-passable blocks!" ), false);
source.sendFeedback(() -> Text.literal("The §a" + blockState.getBlock().getName().getString() + " §rblock has been added to the list beam-passable blocks!" ), false);
return 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import com.mojang.brigadier.tree.LiteralCommandNode;
import me.emafire003.dev.beampass.BeamPass;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.command.CommandRegistryAccess;
import net.minecraft.command.argument.BlockPosArgumentType;
import net.minecraft.command.argument.BlockStateArgumentType;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.Text;
Expand All @@ -24,10 +21,10 @@ public GetBlocksCommand(CommandRegistryAccess registryAccess) {

private int getBlock(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
ServerCommandSource source = context.getSource();
source.sendFeedback(Text.literal("Sending a list of current BeamPassable blocks, other than vanilla ones:"), false);
source.sendFeedback(() -> Text.literal("Sending a list of current BeamPassable blocks, other than vanilla ones:"), false);

for(Block block : BeamPass.bypassableBlocks){
source.sendFeedback(Text.literal(block.getName().getString()), false);
source.sendFeedback(() ->Text.literal(block.getName().getString()), false);
}
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private int addBlock(CommandContext<ServerCommandSource> context) throws Command
BlockState blockState = BlockStateArgumentType.getBlockState(context, "block").getBlockState();
ServerCommandSource source = context.getSource();
BeamPass.removeBlock(blockState.getBlock());
source.sendFeedback(Text.literal("The §c" + blockState.getBlock().getName().getString() + " §rblock has been removed from the list beam-passable blocks!" ), false);
source.sendFeedback(() ->Text.literal("The §c" + blockState.getBlock().getName().getString() + " §rblock has been removed from the list beam-passable blocks!" ), false);
return 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import me.emafire003.dev.beampass.BeamPass;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.entity.BeaconBlockEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
Expand Down

0 comments on commit 3270578

Please sign in to comment.