mirror of
https://github.com/dragonruler1000/hdm-mod.git
synced 2025-06-29 16:39:32 -05:00
Compare commits
No commits in common. "f7777980c3754030f26b72963a60ea341dbb54c9" and "c1e69d76a56c30aaef153b2bd0ce79912f02ed3e" have entirely different histories.
f7777980c3
...
c1e69d76a5
6 changed files with 5 additions and 68 deletions
|
@ -38,7 +38,7 @@ mod_name=Hdm Mod
|
||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=MIT
|
mod_license=MIT
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=1.2.1
|
mod_version=1.2
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|
|
@ -7,9 +7,7 @@ import net.minecraftforge.event.RegistryEvent;
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.InterModComms;
|
import net.minecraftforge.fml.InterModComms;
|
||||||
import net.minecraftforge.fml.ModLoadingContext;
|
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.config.ModConfig;
|
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||||
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
|
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
|
||||||
|
@ -46,7 +44,6 @@ public class Hdm_mod {
|
||||||
modEventBus1.addListener(this::processIMC);
|
modEventBus1.addListener(this::processIMC);
|
||||||
// Register the doClientStuff method for modloading
|
// Register the doClientStuff method for modloading
|
||||||
modEventBus1.addListener(this::doClientStuff);
|
modEventBus1.addListener(this::doClientStuff);
|
||||||
// ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ModConfig.GENERAL_SPEC, "modconfig.toml");
|
|
||||||
|
|
||||||
// Register ourselves for server and other game events we are interested in
|
// Register ourselves for server and other game events we are interested in
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
|
|
|
@ -11,7 +11,6 @@ import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.state.StateContainer;
|
import net.minecraft.state.StateContainer;
|
||||||
import net.minecraft.util.ActionResultType;
|
import net.minecraft.util.ActionResultType;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.BlockRayTraceResult;
|
import net.minecraft.util.math.BlockRayTraceResult;
|
||||||
import net.minecraft.util.math.shapes.IBooleanFunction;
|
import net.minecraft.util.math.shapes.IBooleanFunction;
|
||||||
|
@ -126,6 +125,10 @@ public class Window extends HorizontalBlock {
|
||||||
SimpleTeleporter teleporter = new SimpleTeleporter(pos, goingToCustom);
|
SimpleTeleporter teleporter = new SimpleTeleporter(pos, goingToCustom);
|
||||||
player.changeDimension(targetWorld, teleporter);
|
player.changeDimension(targetWorld, teleporter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("[DEBUG] Portal activated on server!");
|
||||||
|
player.sendMessage(new StringTextComponent("Teleport logic running!"), player.getUniqueID());
|
||||||
|
player.sendMessage(new StringTextComponent("Teleport attempted!"), player.getUniqueID());
|
||||||
return ActionResultType.SUCCESS;
|
return ActionResultType.SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
//package us.minecraftchest2.hdm_mod.config;
|
|
||||||
//
|
|
||||||
//import net.minecraftforge.common.ForgeConfigSpec;
|
|
||||||
//
|
|
||||||
//public class ModConfig {
|
|
||||||
//public static final ForgeConfigSpec GENERAL_SPEC;
|
|
||||||
//
|
|
||||||
//static {
|
|
||||||
// ForgeConfigSpec.Builder configBuilder = new ForgeConfigSpec.Builder();
|
|
||||||
// setupConfig(configBuilder);
|
|
||||||
// GENERAL_SPEC = configBuilder.build();
|
|
||||||
//}
|
|
||||||
//public static ForgeConfigSpec.IntValue exampleIntConfigEntry;
|
|
||||||
//
|
|
||||||
//private static void setupConfig(ForgeConfigSpec.Builder builder) {
|
|
||||||
// exampleIntConfigEntry = builder.defineInRange("exampleIntConfigEntry", 5, 2, 50);
|
|
||||||
//}
|
|
||||||
//}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package us.minecraftchest2.hdm_mod.config;
|
|
||||||
|
|
||||||
import net.minecraftforge.common.ForgeConfigSpec;
|
|
||||||
|
|
||||||
public class ModConfig {
|
|
||||||
public static final ForgeConfigSpec GENERAL_SPEC;
|
|
||||||
|
|
||||||
static {
|
|
||||||
ForgeConfigSpec.Builder configBuilder = new ForgeConfigSpec.Builder();
|
|
||||||
setupConfig(configBuilder);
|
|
||||||
GENERAL_SPEC = configBuilder.build();
|
|
||||||
}
|
|
||||||
public static ForgeConfigSpec.IntValue exampleIntConfigEntry;
|
|
||||||
|
|
||||||
private static void setupConfig(ForgeConfigSpec.Builder builder) {
|
|
||||||
exampleIntConfigEntry = builder.defineInRange("exampleIntConfigEntry", 5, 2, 50);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,11 +5,8 @@ package us.minecraftchest2.hdm_mod.world.dimension;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.fluid.Fluids;
|
import net.minecraft.fluid.Fluids;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.StringTextComponent;
|
|
||||||
import net.minecraft.world.server.ServerWorld;
|
import net.minecraft.world.server.ServerWorld;
|
||||||
import net.minecraftforge.common.util.ITeleporter;
|
import net.minecraftforge.common.util.ITeleporter;
|
||||||
import us.minecraftchest2.hdm_mod.block.ModBlocks;
|
import us.minecraftchest2.hdm_mod.block.ModBlocks;
|
||||||
|
@ -117,30 +114,6 @@ public class SimpleTeleporter implements ITeleporter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity instanceof PlayerEntity) {
|
|
||||||
PlayerEntity player = (PlayerEntity) entity;
|
|
||||||
ResourceLocation dimensionKey = destinationWorld.getDimensionKey().getLocation();
|
|
||||||
// Only send the welcome message if NOT the overworld
|
|
||||||
if (!dimensionKey.getPath().equals("overworld")) {
|
|
||||||
// (Same nice formatting as before)
|
|
||||||
String path = dimensionKey.getPath();
|
|
||||||
String dimensionName;
|
|
||||||
switch (path) {
|
|
||||||
case "the_nether":
|
|
||||||
dimensionName = "the Nether";
|
|
||||||
break;
|
|
||||||
case "the_end":
|
|
||||||
dimensionName = "the End";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dimensionName = path.replace('_', ' ');
|
|
||||||
dimensionName = dimensionName.substring(0, 1).toUpperCase() + dimensionName.substring(1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
player.sendMessage(new StringTextComponent("Welcome to " + dimensionName + "!"), player.getUniqueID());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue