Comments (16)
You can use detector signs:
http://minecraft.gamepedia.com/Custom_servers/Bukkit/TrainCarts/Signs/Detector
They detect trains between two signs.
from traincarts.
Hey,
The problem is that the check system is triggert by some sort of region enter.
Let me explain that.
When a player enters a region the check system is triggert.
It needs to check if there is a train:
- In the get out area
- In the last scene before the get out area
- In the spawn area
If there is train in one of that areas, no train needs to be spawned.
But if there is no train there, then a train needs to be spawned.
If i look at the detector sign, i think it will not give me the thing that i need.
Looking at what is explained about it, and what i know about the thing i need.
Harm
from traincarts.
I don't understand what's the issue.
Detector signs can detect trains in a region:
from traincarts.
The track is like what displayed above.
When a player enters the station region, there will be checked if there is a train on the step out or last scene or rangeer system.
This will be some what with a command system, what triggers the redstone for the checks.
Since it is hangrail, i forgat to say that earlier, there is less space below.
And most of the time, no space.
This because of the scenery that is build arround the track.
Harm
from traincarts.
I suggest having a look at this:
http://jd.mg-dev.eu/tc/com/bergerkiller/bukkit/tc/detector/DetectorRegion.html
TrackMap map = new TrackMap(startRail, direction);
map.generate(length);
DetectorRegion.create(map).register(your DetectorListener);
TrackMap: http://jd.mg-dev.eu/tc/com/bergerkiller/bukkit/tc/utils/TrackMap.html
DetectorListener: http://jd.mg-dev.eu/tc/com/bergerkiller/bukkit/tc/detector/DetectorListener.html
I'm not sure if this works, I didn't test it.
from traincarts.
Okey, i will try that. Looks what some part at what i am looking for.
Only problem is the length.
I do have the start and end Location.
But i will look for a solition for that.
from traincarts.
Try this:
TrackMap map = new TrackMap(startRail, direction, maxDistance); # maxDistance = maximum distance between the two blocks
while (map.hasNext()) {
Block next = map.next(); # get next block
if (next != null && /* check location */)
break; # exit while
}
DetectorRegion.create(map).register(your DetectorListener);
Don't use TrackMap#generate in this case.
I didn't test this but I'm 99% sure this works.
You should provide a maximum distance because otherwise it could loop forever.
from traincarts.
Okey, i think that will do that. Now coding it.
Thanks for the help.
from traincarts.
I have been looking into the detector code.
Maybe that is what i am looking for.
Only problem is now how to get tracked of the state of the detector. Is there a way to get the detectorregion name? So there can be a custom sign that tracks if that region is used and when not, spawn a train.
from traincarts.
You can activate a Wireless Redstone channel in your DetectorListener.
from traincarts.
What function do i need to use for that. Since there are multiple functions, for train or seperate cart.
Do i need to check in that function bv. for any groups, if there is a group, set status to off?
And how do i know what detector region i need to check? Is there a way to get the name or UUID? If i have placed the detector signs?
from traincarts.
You told me you didnt want to use detector signs 4 days ago...?
If you use detector signs you can just attach a lever to one of the signs and attach it to a wireless redstone transmitter.
from traincarts.
Then i didn't understand it far enough. The problem with the lever thing is that there is next to the rail no space. Since it is a hangrail and the builders don't want some levers hanging, there is that problem what i am facing now. When i can one someway track what detectorregion the detectors are, then i can build a plugin with a DetectorListener that can track the channels. And i can place a sign somewhere that i can place a redstone block next so i can use that info in redstone checks.
from traincarts.
from traincarts.
Thanks for the help. That was exactly what i was looking for.
from traincarts.
No problem!
from traincarts.
Related Issues (20)
- When typing `/train speedlimit` without any additional arguments, get the current speed of the train back. HOT 6
- [Request] Option to exempt Weighted Pressure Plates (or pressure plates in general) from pressure plate logic HOT 6
- Signs not working in 1.19.4 HOT 2
- All players will be kicked by server when trying editing a SignLink sign HOT 9
- Add stopwatch placeholder
- Spinning wheel animations go wild at speed HOT 8
- Train chests don't always preserve cart orientation/flipped status HOT 4
- Locked, Finite Train Chests Should Be Removed from the Player’s Inventory HOT 3
- Combined trains break apart after server restarting HOT 42
- Interesting deadmessage HOT 4
- After waiting at waiter sign, trains aren't launched to full speed again HOT 28
- Announce next destination HOT 1
- Folia Support HOT 3
- Failed to perform physics HOT 16
- multiple trains in/waiting at spmutex enter region after server restart HOT 38
- Switcher sign fault not switching rail to the left HOT 1
- Update the demo
- Cannot place MineCarts outside vanilla worldheight HOT 21
- Configuration Option for Permanent Chunk Loading to Reduce I/O Pressure in Train Carts HOT 4
- Powered Rail Bug HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traincarts.