Jump to content

[1.4.2]..[1.4.6] Server mods: Chunk Protection and Chat Filter


Recommended Posts

Posted

[1.4.2][1.4.4][1.4.5][1.4.6] Minecraft

[6.0.1][6.3.0][6.4.x][6.5.0] Forge

 

Players can claim a private chunk where other players can't break or build.

 

/chunk gives information about the chunk you are standing on.

/chunk claim lets you claim the chunk you are standing on.

/chunk unclaim makes it public again.

/chunk add [player1] [player2] .. adds players that are allowed to build in this chunk.

/chunk remove [player1] [player2] .. will remove players from the list.

/chunk clear clears the list of players that are allowed to build on this chunk.

/chunk info [on|off] switches the displaying of information when crossing chunk borders.

/chunk maxchunks [playername] [max] changes the number of chunks that player can claim.

/chunk playerinfo [playername] tells how many chunks that player can claim and how many are claimed.

/chunk unclaimall [for ops:[playername]]

 

Make sure the right versions of Forge and Power Tools Shared are installed.

Place the Chunk Protection ".zip" file in the "mods" folder of your Minecraft Forge server.

 

Changelog

0.1.4

QuickFix: Now protects against water and lava buckets as well.

0.1.2

QuickFix: Maximum players from 1024 to 8192. Maximum chunks from 1024 to 65536.

0.1.1

Variable amount of chunks per player.

/chunk maxchunks [playername] [max] changes the number of chunks that player can claim.

/chunk playerinfo [playername] tells how many chunks that player can claim and how many are claimed.

Added command /chunk unclaimall and for ops /chunk unclaimall [playername]

0.1

Chunks will automaticly be unclaimed after 7 days of not being visited by their owner. Can be changed in config file. Set to 0 to disable.

Op's can now claim for other players. Use /chunk claim [playername]

Added config file setting AllPlayersCanClaim=true. Change to false so only op's can claim chunks.

0.0.9

Fixed bug that gave chat spam with more than one player online.

Added config file with setting for maximum amount of chunks players are allowed to claim and

default setting for display of info when crossing chunk borders.

0.0.8

It still has the bug from 0.0.7 that gives chat spam with more than one player online,

but /chunk info off is now default, so you don't see it.

Op's can now add or remove players from chunks and unclaim chunks owned by other players.

0.0.7

Added /chunk info [on|off] command to turn off the info that shows when crossing chunk borders.

'chunkinfo.dat' will now be stored in 'powertools' folder. When upgrading, make a new folder 'powertools'

in the folder the server runs from and move 'chunkinfo.dat' into it.

Fixed bug where chunks couldn't be unclaimed.

Some small changes with colors.

0.0.6

The owner of a chunk can now add a list of players who are allowed to build and break there as well.

Added chat colors.


For the chat filter, use:

/chat normal for the default chat mode.

/chat player [player1] [player2] .. for player mode, chat is sent only to selected players.

/chat remove [player1] [player2] .. to remove players from the list.

/chat clear to remove all players from the list.


Download from: http://powerbeat.org/minecraft/server_mods/

  • 4 weeks later...
Posted
Ive searched around and cant seem to find the config file..
It gets automatically generated when the mod is started the first time.

Only ChunkProtection makes a file, "powertools_chunkprotection.cfg". It is in the "config" folder.

Posted

Ive searched around and cant seem to find the config file..
It gets automatically generated when the mod is started the first time.

Only ChunkProtection makes a file, "powertools_chunkprotection.cfg". It is in the "config" folder.

 

i don't have any issues with it loading, or finding the cfg file.. the issue i have is even op'd i cant use /chunk any commands it tells me i dont have permission and cant find where i should add to have permission

any help? thanks

 

Posted
i don't have any issues with it loading, or finding the cfg file.. the issue i have is even op'd i cant use /chunk any commands it tells me i dont have permission and cant find where i should add to have permission

any help? thanks

The only thing I can think of here, is that you may have Power Login installed as well. Then you have to register and login before you can use any commands.

 

Or do you have any other mods installed that add something with permissions?

Posted

i don't have any issues with it loading, or finding the cfg file.. the issue i have is even op'd i cant use /chunk any commands it tells me i dont have permission and cant find where i should add to have permission

any help? thanks

The only thing I can think of here, is that you may have Power Login installed as well. Then you have to register and login before you can use any commands.

 

Or do you have any other mods installed that add something with permissions?

i'll look thru again.. i dont have the login part, but i'll try removing a few other mods and see what happens..  i had it working while it was on a local machine, then ftp'd to my server host.. and it stopped letting me claim... or anything.. may have to remove all and start again :( not that i want to.. 40 somethn mods to re do kind of sux lol

 

update.. okay i got issue solved.. my own fault :)

  • 4 weeks later...
Posted

Great small mods, wait for a new functional!

 

But i have, maybe, a little bug in "Power Login" mod:

when u logout in water, than re-enter world and don't login, u can't destroy or build blocks, but u can die

Posted

please make bukkitforge a dependeny. i use it already and i think most other people who use your mod use bukkitforge as well. blocking turtlus from destroying claimed chunks would be amazing and i really hope you can make that happen :D good luck with this amazing mod!

Posted

This is almost all I need! Thank you.

 

There are problems, though. Players can destroy the land with "Wand of Excavation" from Thaumcraft 3, even if it is claimed by others. I suppose, something other (like Turtles from ComputerCraft) can destroy other's land too.

Can this be fixed?

Posted

This is almost all I need! Thank you.

 

There are problems, though. Players can destroy the land with "Wand of Excavation" from Thaumcraft 3, even if it is claimed by others. I suppose, something other (like Turtles from ComputerCraft) can destroy other's land too.

Can this be fixed?

 

this cant be fixed right now. i suggest banning those 2 things for now. mining turtles and wand of excavation. mining lasers can destroy it as well, but ic2 uses different crafting ways so u cant ban it. u might also wanna ban portal guns since they can pick up items from protected land. //www.minecraftforum.net/topic/1475847-146-forgeirc-v1014-soul-shards-v126-and-recipe-remover-v11-updated-122013/page__st__400 is the link to the mod that allows you to ban items. hope this helps

Posted
please make bukkitforge a dependeny. i use it already and i think most other people who use your mod use bukkitforge as well. blocking turtlus from destroying claimed chunks would be amazing and i really hope you can make that happen :D good luck with this amazing mod!

This is almost all I need! Thank you.

There are problems, though. Players can destroy the land with "Wand of Excavation" from Thaumcraft 3, even if it is claimed by others. I suppose, something other (like Turtles from ComputerCraft) can destroy other's land too.

Can this be fixed?

I am trying to get this fixed by using the Events API that keepcalm extracted from the BukkitForge project, but as of now, I can't get it to work.
Posted

please make bukkitforge a dependeny. i use it already and i think most other people who use your mod use bukkitforge as well. blocking turtlus from destroying claimed chunks would be amazing and i really hope you can make that happen :D good luck with this amazing mod!

This is almost all I need! Thank you.

There are problems, though. Players can destroy the land with "Wand of Excavation" from Thaumcraft 3, even if it is claimed by others. I suppose, something other (like Turtles from ComputerCraft) can destroy other's land too.

Can this be fixed?

I am trying to get this fixed by using the Events API that keepcalm extracted from the BukkitForge project, but as of now, I can't get it to work.

 

i saw the post "Maxed Gaming Server tools" and although the mod isnt out yet he claims to be using the api so i guess you could try to contact him and maybe find out how he managed to make it work.

  • 3 weeks later...
  • 2 months later...
Posted

As I understand it, Feed the Beast mods do have fakeplayers they create but because the lack of a BreakBlockEvent in Forge they never trigger any event at all before they destroy the block. Perhaps it could be possible to convince/mod these mods to trigger a PlayerInteractEvent and then check if a plugin (Chunk Protection or any grief prevention) has cancelled that event, and then the machine will not break the the block.

 

This is how ComputerCraft in Tekkit works by using Bukkits BreakBlockEvent. Here is the code from the dig function (this is where blocks get broken):

 

Player fakePlayer = FakePlayer.getBukkitEntity(this.world, getTurtleName());
if (fakePlayer != null) {
         CraftWorld craftWorld = ((WorldServer)this.world).getWorld();
         CraftServer craftServer = ((WorldServer)this.world).getServer();
          BlockBreakEvent event = new BlockBreakEvent(craftWorld.getBlockAt(j, k, l), fakePlayer);
         craftServer.getPluginManager().callEvent(event);
          if (event.isCancelled()) {
                   return false;
          }
}

.. etc ..

 

Block block = Block.byId[i1];
this.world.triggerEffect(2001, j, k, l, block.id + (this.world.getData(j, k, l) << 12));
this.world.setTypeId(j, k, l, 0);

 

 

Note that it sends a BlockBreakEvent with the fakePlayer and then if that event is cancelled the dig fuctions returns before breaking the block. The actual "breaking" of the block is setting the block type id to 0, as done with "this.world.setTypeId(j, k, l, 0);"

 

------------------------------

 

Now lets look at similar code in the FTB computercraft:

 

 

if (!canBreakBlock(worldObj, newX, newY, newZ))
{
         return false;
}

 

..etc..

 

int blockID = worldObj.a(newX, newY, newZ);
worldObj.f(2001, newX, newY, newZ, blockID + worldObj.h(newX, newY, newZ) * 4096);
worldObj.e(newX, newY, newZ, 0);

 

 

Here is the canBreakBlock function:

 

protected boolean canBreakBlock(yc world, int x, int y, int z)
{
          int bid = world.a(x, y, z);
          amq block = amq.p[bid];
           if ((bid == 0) || (bid == amq.C.cm) || (block.m(world, x, y, z) <= -1.0F))
          {
                    return false;
           }
          return true;
}

 

 

-----------------

 

So you can see all the FTB computer craft does is check if the block is breakable, exists, and whatever amq.C.cm is. Never is there an event thrown where a third party plugin (such as any grief detection) can intercept and cancel and return the function before the breaking of the block, in this case I think the function "e" is some type of obfuscated name for "setTypeId"

 

 

I have not investigated how IC2 and other mods do it, but I suspect the same. In order to get these mods to stop griefing they have to throw an event for a thirdparty to cancel.  Three things can happen for this to work:

 

1.) Forge needs to make a BlockBreakEvent event and all the mods need to trigger this BlockBreakEvent with their fakePlayer (or owner's name), and prevent the breaking of a block if that event is cancelled in any way (such as by a anti-griefing plugin).

 

2.) The mods must trigger a PlayerInteractEvent (As I understand it, an alternative to bukkit's BlockBreakEvent but perhaps not as good?) with their fakePlayer (or owner's name), and prevent the breaking of a block if that event is cancelled in any way (such as by a anti-griefing plugin).

 

3) Each forge mod must be modified to check if bukkit support exists (via MCPC+ or the like) and if so, use Bukkit's BlockBreakEvent similar in the way it's done in Tekkit. (see tekkit CC code above).

 

 

 

Posted

As I understand it, Feed the Beast mods do have fakeplayers they create but because the lack of a BreakBlockEvent in Forge they never trigger any event at all before they destroy the block. Perhaps it could be possible to convince/mod these mods to trigger a PlayerInteractEvent and then check if a plugin (Chunk Protection or any grief prevention) has cancelled that event, and then the machine will not break the the block.

 

This is how ComputerCraft in Tekkit works by using Bukkits BreakBlockEvent. Here is the code from the dig function (this is where blocks get broken):

 

Player fakePlayer = FakePlayer.getBukkitEntity(this.world, getTurtleName());
if (fakePlayer != null) {
         CraftWorld craftWorld = ((WorldServer)this.world).getWorld();
         CraftServer craftServer = ((WorldServer)this.world).getServer();
          BlockBreakEvent event = new BlockBreakEvent(craftWorld.getBlockAt(j, k, l), fakePlayer);
         craftServer.getPluginManager().callEvent(event);
          if (event.isCancelled()) {
                   return false;
          }
}

.. etc ..

 

Block block = Block.byId[i1];
this.world.triggerEffect(2001, j, k, l, block.id + (this.world.getData(j, k, l) << 12));
this.world.setTypeId(j, k, l, 0);

 

 

Note that it sends a BlockBreakEvent with the fakePlayer and then if that event is cancelled the dig fuctions returns before breaking the block. The actual "breaking" of the block is setting the block type id to 0, as done with "this.world.setTypeId(j, k, l, 0);"

 

------------------------------

 

Now lets look at similar code in the FTB computercraft:

 

 

if (!canBreakBlock(worldObj, newX, newY, newZ))
{
         return false;
}

 

..etc..

 

int blockID = worldObj.a(newX, newY, newZ);
worldObj.f(2001, newX, newY, newZ, blockID + worldObj.h(newX, newY, newZ) * 4096);
worldObj.e(newX, newY, newZ, 0);

 

 

Here is the canBreakBlock function:

 

protected boolean canBreakBlock(yc world, int x, int y, int z)
{
          int bid = world.a(x, y, z);
          amq block = amq.p[bid];
           if ((bid == 0) || (bid == amq.C.cm) || (block.m(world, x, y, z) <= -1.0F))
          {
                    return false;
           }
          return true;
}

 

 

-----------------

 

So you can see all the FTB computer craft does is check if the block is breakable, exists, and whatever amq.C.cm is. Never is there an event thrown where a third party plugin (such as any grief detection) can intercept and cancel and return the function before the breaking of the block, in this case I think the function "e" is some type of obfuscated name for "setTypeId"

 

 

I have not investigated how IC2 and other mods do it, but I suspect the same. In order to get these mods to stop griefing they have to throw an event for a thirdparty to cancel.  Three things can happen for this to work:

 

1.) Forge needs to make a BlockBreakEvent event and all the mods need to trigger this BlockBreakEvent with their fakePlayer (or owner's name), and prevent the breaking of a block if that event is cancelled in any way (such as by a anti-griefing plugin).

 

2.) The mods must trigger a PlayerInteractEvent (As I understand it, an alternative to bukkit's BlockBreakEvent but perhaps not as good?) with their fakePlayer (or owner's name), and prevent the breaking of a block if that event is cancelled in any way (such as by a anti-griefing plugin).

 

3) Each forge mod must be modified to check if bukkit support exists (via MCPC+ or the like) and if so, use Bukkit's BlockBreakEvent similar in the way it's done in Tekkit. (see tekkit CC code above).

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Im trying to build my mod using shade since i use the luaj library however i keep getting this error Reason: Task ':reobfJar' uses this output of task ':shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. So i try adding reobfJar.dependsOn shadowJar  Could not get unknown property 'reobfJar' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. my gradle file plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'com.github.johnrengelman.shadow' version '7.1.2' id 'org.spongepowered.mixin' version '0.7.+' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' apply plugin: 'com.github.johnrengelman.shadow' version = mod_version group = mod_group_id base { archivesName = mod_id } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) //jarJar.enable() println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { mappings channel: mapping_channel, version: mapping_version copyIdeResources = true runs { configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' arg "-mixin.config=derp.mixin.json" mods { "${mod_id}" { source sourceSets.main } } } client { // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. property 'forge.enabledGameTestNamespaces', mod_id } server { property 'forge.enabledGameTestNamespaces', mod_id args '--nogui' } gameTestServer { property 'forge.enabledGameTestNamespaces', mod_id } data { workingDirectory project.file('run-data') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { flatDir { dirs './libs' } maven { url = "https://jitpack.io" } } configurations { shade implementation.extendsFrom shade } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'org.luaj:luaj-jse-3.0.2' implementation fg.deobf("com.github.Virtuoel:Pehkui:${pehkui_version}") annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' minecraftLibrary 'luaj:luaj-jse:3.0.2' shade 'luaj:luaj-jse:3.0.2' } // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors, 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : mod_authors, 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder" : 0, "MixinConfigs" : "derp.mixin.json" ]) } rename 'mixin.refmap.json', 'derp.mixin-refmap.json' } shadowJar { archiveClassifier = '' configurations = [project.configurations.shade] finalizedBy 'reobfShadowJar' } assemble.dependsOn shadowJar reobf { re shadowJar {} } publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } }  
    • All versions of Minecraft Forge suddenly black screen even without mods (tried reinstalling original Minecraft, Java, updating drivers doesn't work)
    • When i join minecraft all ok, when i join world all working fine, but when i open indentity menu, i get this The game crashed whilst unexpected error Error: java.lang.NullPointerException: Cannot invoke "top.ribs.scguns.common.Gun$Projectile.getDamage()" because "this.projectile" is null crash report here https://paste.ee/p/0vKaf
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.